Closed (works as designed)
Project:
Cloud
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
3 Dec 2018 at 01:44 UTC
Updated:
15 Jan 2019 at 00:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xiaohua guan commentedComment #3
xiaohua guan commentedComment #4
xiaohua guan commentedComment #5
xiaohua guan commentedComment #6
xiaohua guan commented@yas
Here is the screenshot.
Comment #7
xiaohua guan commentedComment #8
xiaohua guan commented@yas
I implement the feature as the followings.
1. Change field "security groups" to select element, and the element can be selected multiply like the screenshot in comment #6.
2. Fill the select element "security groups" with all security groups which belong to the instance's vpc.
3. Change test case testUpdateInstanceType to testUpdateInstanceAttributes.
Please review the patch file.
Comment #9
yas@xiaohua-guan
Thank you for the patch including the tests! Let's change the following code from:
To:
Comment #10
yasComment #11
xiaohua guan commentedComment #12
xiaohua guan commentedComment #13
xiaohua guan commented@yas
Thanks for your code review and comments.
I modified code as you said. Furthermore, I change the form field "security groups" to required.
Please review the new patch.
Comment #14
yasThank you for your new patch including the refactoring. I reviewed your new patch. It looks good to me.
Comment #15
baldwinlouie commentedThe constant should be defined with the const keyword, and not with define() function.
See this url for reference
https://www.drupal.org/node/1362360
Comment #16
xiaohua guan commentedComment #17
xiaohua guan commentedComment #18
xiaohua guan commented@yas, @baldwinlouie
Thanks for comments.
I modified the code. Please review the new patch file. Thanks.
Comment #19
yasThank you for the modification. I'll push and merge the patch.
Comment #21
yasComment #23
baldwinlouie commentedNot all instances are part of a VPC. In my test AWS console, I do not have instances that are part of a VPC. This code can potentially bring back an empty list.
Combine with the fact that selecting a security is required, there will be cases where you cannot edit an instance because of an empty security group list.
See attached screenshot.
Comment #24
yas@baldwinlouie,
According to AWS document at https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html,
We have a long long history to use AWS. Therefore you (we) might be able to launch a NON-VPC instance. However, in most of cases I guess NON-VPC instance support should not be the problem since using VPC is the best practice (and now strictly forced to use for newer AWS users) even if we can technically launch a NON-VPC instance. Also, when AWS adds a new region, now they give a default VPC to a user (such as Paris, Stockholm and etc.)
Also you can refer to the forum discussion at https://forums.aws.amazon.com/thread.jspa?threadID=182773
How do you think about it?
Comment #25
baldwinlouie commented@yas, Thank you for the explanation. I understand that VPC is best practice and the default. I think we should document it somewhere in the README.txt file that we are only supporting EC2 VPC.
My followup question is what should happen to users that *ARE* from EC2 classic and they try to add an EC2 region, such as myself? (I have been using my own aws account, which is REALLY old. That is why I can still launch EC2 classic instances)
One idea I have is that when a user sets up a cloud config, we verify if the account is ec2-classic or ec2-vpc, by calling this API: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-ec2-2016-11-15.html#d... . If they are ec2-classic, we error out and let the user know that we do not support EC2-classic?
What do you think? We can move this discussion to another issue. I am marking this one Closed (works as designed)
Comment #26
yas@baldwinlouie,
A new VPC region is automatically added by AWS w/ default VPC that AWS provide when they are ready.
If you don't have an existing VPC since it is a classic account, you need to create your own VPC (at least one VPC) if you want to launch a VPC-enabled instance.
Thank you for your comment. Yes, we should document that we are only supporting EC2 VPC in the README.txt file.
I totally agree that your idea:
When a user sets up a cloud config, we verify if the account is ec2-classic or ec2-vpc, by calling this API
Also, We'll move this discussion to another issue.