-
Notifications
You must be signed in to change notification settings - Fork 4k
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(synthetics): add vpc configuration #18447
feat(synthetics): add vpc configuration #18447
Conversation
This PR is a continuation of aws#11865 with the intention of filling out the remaining RunConfig values as well as adding missing VpcConfig properties. I wasn't sure whether VPC settings should be top level (like Lambda) or in their own configuration object, so I made them seperate for now.
packages/@aws-cdk/aws-synthetics/test/integ.canary.expected.json
Outdated
Show resolved
Hide resolved
Hi @RichiCoder1, thanks for opening this PR! As a first step, lets split this into two PRs, one for runConfig and one for vpcConfig. Specifically for |
Partially completeness, partially convenience. I'm personally using the
I probably should have seen this ask coming, I'll see what I can do :). Before I do so, do we want the VPC configuration options to be top level options, or a sub config like I have in this PR? |
I don't think its partially complete -- environment variables is its own thing separate from timeout and tracing. The canary L2 is not simply a shell for the L1 and we do not need to adhere to how cfn clusters properties; this means that supplying env variables in the L2 is visible at the top level. But sure, I hear your point that its low-hanging fruit and Duration/Size is better to work with. Happy to add them. For |
Sorry for taking so long to circle back around on this. Gonna scope it back down to VPC (current biggest pain point IMHO) and then can do a follow up on Run Config props. |
This is should be good to review now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RichiCoder1! Thanks for the PR - it looks like a great start. I don't have much experience with vpcs, so I'm hoping we can lean on your context to provide the best possible experience for our users.
* Returns a canary schedule object | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should go back to the way it was
@@ -69,4 +70,15 @@ new synthetics.Canary(stack, 'MyPythonCanary', { | |||
runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_1_0, | |||
}); | |||
|
|||
const vpc = new ec2.Vpc(stack, 'MyVpc', { maxAzs: 2 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this in a new integ test file called integ.vpc-canary.ts
. If you can come up with stack verification steps that would be great too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. For stack verification, do mean something like checking the underlying Lambda is in a VPC, or simulate some sort of VPC-only scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best if we can check underlying lambda is in vpc, if possible. i don't actually know how.
@@ -499,6 +499,7 @@ | |||
"./aws-iotthingsgraph": "./aws-iotthingsgraph/index.js", | |||
"./aws-iotwireless": "./aws-iotwireless/index.js", | |||
"./aws-ivs": "./aws-ivs/index.js", | |||
"./aws-kafkaconnect": "./aws-kafkaconnect/index.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, don't know how I missed this. Might have been added by some tooling or a bad merge. I'll strip it out and see if it comes back
Co-authored-by: Kaizen Conroy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @RichiCoder1. Approved, though I am going to wait on a second pair of eyes before we get this merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RichiCoder1 just a couple of comments, the main one around implementing IConnectable
.
Since the Canary
class can now have security groups, it should implement ec2.IConnectable
export class Canary extends cdk.Resource implements ec2.IConnectable {
* | ||
* @default false | ||
*/ | ||
readonly allowPrivateSubnet?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed. I think it should be fine to just add this to the documentation in the readme and the vpcSubnets
docstring. Users will specify if they want to place it in isolated subnets via the vpcSubnets
prop, asking again here feels like a "are you sure you know what you are doing?" and I don't think that is needed.
Nuked |
Pull request has been modified.
Nuked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 1 more comment and then we are good to go!
environmentVariables: props.environmentVariables, | ||
vpcId: props.vpc.vpcId, | ||
subnetIds, | ||
securityGroupIds: securityGroups.map(sg => sg.securityGroupId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pull the list of security groups from this.connections
since users will be able to modify this connections object.
securityGroupIds: Lazy.listValue({ produce: () => this.connections.securityGroups.map(sg => sg.securityGroupId) }),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corymhall Done! Though used Lazy.list
as I got a warning that listValue
was deprecated and that seemed to be the replacement. Good to know too, I was wondering how this sort of lazy evaluation worked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @RichiCoder1. Thanks for the contribution!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This PR adds vpc support to synthetics and is a continuation of #11865.
See Running a canary on a vpc.
Fixes #9954
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license