Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: assign custom security groups #508 #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patlachance
Copy link

@patlachance patlachance commented Apr 19, 2017

#508 Handling Security Groups and Security Group IDs for AWS

To attach custom security groups to your "nanocloud exec servers", proceed as follow:

From AWS console or using the aws-cli tool

  • find your AWS SubNet ID
  • find your AWS Security Group names or AWS Security Group IDs

Then, configure your Nanocloud environment using the values just found by changing config/env/development or creating a config/local.js file

  • set the 'awsMachineSubnet' parameter
  • set either awsSecurityGroups or awsSecurityGroupIds parameter

Sample config/local.js file:

module.exports = {
  nanocloud: {
    awsMachineSubnet: 'subnet-1a2b3c4d',
    awsSecurityGroupIds: ['sg-1a2b3c4d']
  }

You must choose Security Group(s) or Security Groups ID(s) that are define within the VPC containing the subnet referred to by the awsMachineSubnet parameter.

Configure only one of the two parameters. Setting both is useless and might result in provisioning error if they don't match.

Please note that using Security Group name(s) is only supported in EC2-Classic or in the default VPC, not in user-created VPCs. From AWS EC2 'runInstances' SDK function documentation
(http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#runInstances-property)

  • SecurityGroups — (Array)
    [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead.

Default: Amazon EC2 uses the default security group.

  • SecurityGroupIds — (Array)
    One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

Notes:

  • couldn't find existing tests for the AWS driver at all, so example to start from to test these new parameters but tested them on my config and it works.

From AWS EC2 'runInstances' SDK function documentation
(http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/EC2.html#runInstances-property)

- SecurityGroups — (Array<String>)
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead.

Default: Amazon EC2 uses the default security group.

- SecurityGroupIds — (Array<String>)
One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.542% when pulling bc59199 on patlachance:feature-508-assign-custom-security-groups into eaf00b4 on Nanocloud:master.

Copy link
Contributor

@Gentux Gentux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't fully test this feature, but I can say the code is clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants