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

feat(deadline): add security group configuration for Repository and RenderQueue #319

Merged
merged 3 commits into from
Feb 26, 2021

Conversation

jericht
Copy link
Contributor

@jericht jericht commented Feb 19, 2021

Fixes #307

Changes

  • RenderQueue: Add addSecurityGroups method that adds security groups to the AutoScalingGroup, LoadBalancer, or both.
  • Repository: Add addSecurityGroup method that adds security groups to the DatabaseConnection.
  • DatabaseConnection
    • DocDB: Adds security groups to the CfnDBCluster.
    • MongoDB: Adds security groups to the MongoDB server.
  • MongoDbInstance: Added an addSecurityGroup method to add security groups to the AutoScalingGroup of the StaticPrivateIpServer.

Testing

  • Added unit tests
  • Manual end-to-end tests by modifying the All-In-AWS-Infrastructure-Basic typescript sample app
    • Added a new SecurityGroup in StorageTier and added it to the Repository construct in the ServiceTier.
    • Added a new SecurityGroup in ServiceTier and added it to the RenderQueue construct in the ServiceTier.
    • Verified that the new security groups get added to the correct resources:
      • Repository (DocDB): Added to the DocDB Cluster
      • Repository (MongoDB): Added to the AutoScalingGroup
      • RenderQueue: Added to the AutoScalingGroup and LoadBalancer
    • Test cases
      1. DocDB repository, pass security groups into constructors
      2. DocDB repository, use addSecurityGroup(s) methods to add security groups
      3. MongoDB repository, pass security groups into constructors
      4. MongoDB repository, use addSecurityGroup(s) methods to add security groups

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@jericht jericht force-pushed the jericht/expand_security_group_config branch 5 times, most recently from 73c3c83 to eb2878f Compare February 23, 2021 00:09
@jericht jericht marked this pull request as ready for review February 23, 2021 00:11
@ddneilson ddneilson self-requested a review February 24, 2021 17:29
@jericht jericht force-pushed the jericht/expand_security_group_config branch 2 times, most recently from 3425e70 to e67d618 Compare February 24, 2021 17:35
Copy link
Contributor

@kozlove-aws kozlove-aws left a comment

Choose a reason for hiding this comment

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

Change looks good. Just a couple small remarks

/**
* Options to add additional security groups to the `RenderQueue`.
*/
readonly securityGroups?: RenderQueueSecurityGroupsOptions;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about more informative variable name?
Like securityGroupsOptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

/**
* The `AutoScalingGroup` security groups.
*/
readonly autoScalingGroup?: ISecurityGroup[];
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Maybe name these backend and frontend instead? frontend -> Security group for the load balancer. backend -> Security group for everything behind the load balancer. It's probable that we add the Deadline WebService to this same construct, and it makes some sense for it to have the same SG as the RCS.

  2. The normal pattern in CDK constructs is to accept a single ISecurityGroup as a construct property, rather than an array, and then expose an addSecurityGroups() method. What do you think about following that pattern here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, updated

packages/aws-rfdk/lib/deadline/lib/render-queue.ts Outdated Show resolved Hide resolved
packages/aws-rfdk/lib/deadline/lib/render-queue.ts Outdated Show resolved Hide resolved
packages/aws-rfdk/lib/deadline/lib/repository.ts Outdated Show resolved Hide resolved
packages/aws-rfdk/lib/deadline/lib/repository.ts Outdated Show resolved Hide resolved
@jericht jericht force-pushed the jericht/expand_security_group_config branch from e67d618 to 4fd6663 Compare February 25, 2021 22:08
ddneilson
ddneilson previously approved these changes Feb 26, 2021
Copy link
Contributor

@ddneilson ddneilson left a comment

Choose a reason for hiding this comment

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

This is great work, Jericho. Thanks for the contribution!

@jericht jericht force-pushed the jericht/expand_security_group_config branch from b399e39 to c557523 Compare February 26, 2021 16:59
Copy link
Contributor

@kozlove-aws kozlove-aws left a comment

Choose a reason for hiding this comment

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

Looks good for me.

@ddneilson ddneilson merged commit b7a43d6 into aws:mainline Feb 26, 2021
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.

Expand configuration options for Security Group configuration
3 participants