-
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(route53resolver-alpha): fetch managed domain list id using custom resource #27085
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
# Conflicts: # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.assets.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/LambdaNodeJsLatestIntegDefaultTestDeployAssertD40B5C28.template.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/.yarn-integrity # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/delay/index.d.ts # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/delay/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/delay/license # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/delay/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/node_modules/delay/readme.md # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.0b3f5699e02d713af8ae5766d9389821142c47d17818a940c2cf9b314b1f869d/yarn.lock # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.4364f9f746d12ebe3971915c6d21f444f56a624c83b24a0a0eb3ad111da37fa0.bundle/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/.yarn-integrity # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/delay/index.d.ts # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/delay/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/delay/license # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/delay/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/node_modules/delay/readme.md # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.5c2c08a7bf5b5beff386f4f0bd21f6e002dda28002148757b3d572b235414e5c/yarn.lock # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/.yarn-integrity # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/delay/index.d.ts # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/delay/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/delay/license # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/delay/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/node_modules/delay/readme.md # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/package.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.857be83e8ab6a1d9b812ae68df0a948fd5fcd6ee578ae2c7793512fdbe647611/yarn.lock # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/asset.b7c985ebfbf370ce93607a33c3851adc0b2b6a530f4c06be487e3c2ec3c06c39.bundle/index.js # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/cdk-integ-lambda-nodejs-latest.assets.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/cdk-integ-lambda-nodejs-latest.template.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/manifest.json # packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.latest.js.snapshot/tree.json # packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions/test/integ.intrinsics.js.snapshot/asset.b7c985ebfbf370ce93607a33c3851adc0b2b6a530f4c06be487e3c2ec3c06c39.bundle/index.js # packages/@aws-cdk/custom-resource-handlers/package.json # yarn.lock
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.
Thanks (and sorry for the late review) 👍
Looks good!
Just some minor adjustments to be made in my opinion.
* and DNS tunneling to help block multiple types of threats. | ||
* Includes the `AmazonGuardDutyThreatList.` |
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.
* and DNS tunneling to help block multiple types of threats. | |
* Includes the `AmazonGuardDutyThreatList.` | |
* and DNS tunneling to help block multiple types of threats. | |
* | |
* Includes the `AmazonGuardDutyThreatList`. |
* Domains associated with Amazon GuardDuty DNS security findings. | ||
* The domains are sourced from the GuardDuty's threat intelligence systems only, |
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.
* Domains associated with Amazon GuardDuty DNS security findings. | |
* The domains are sourced from the GuardDuty's threat intelligence systems only, | |
* Domains associated with Amazon GuardDuty DNS security findings. | |
* | |
* The domains are sourced from the GuardDuty's threat intelligence systems only, |
}, | ||
], | ||
}); | ||
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {}); |
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.
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {}); | |
Template.fromStack(stack).resourceCountIs('AWS::Lambda::Function', 1); |
More appropriate assertion.
}], | ||
}); | ||
|
||
const result = new CustomResource(this, 'GetDomainListCustomResource', { |
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.
const result = new CustomResource(this, 'GetDomainListCustomResource', { | |
const resource = new CustomResource(this, 'GetDomainListCustomResource', { |
Naming.
}, | ||
}); | ||
|
||
this.firewallDomainListId = result.getAttString('DomainListId'); |
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.firewallDomainListId = result.getAttString('DomainListId'); | |
this.firewallDomainListId = resource.getAttString('DomainListId'); |
switch (event.RequestType) { | ||
case 'Create': | ||
case 'Update': | ||
const domainListName = event.ResourceProperties?.DomainListName; |
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.
const domainListName = event.ResourceProperties?.DomainListName; | |
const domainListName = event.ResourceProperties.DomainListName; |
Non-optional.
const domainListId = domainLists.find((domainList) => | ||
domainList.ManagedOwnerName === 'Route 53 Resolver DNS Firewall' | ||
&& domainList.Name === domainListName, | ||
)?.Id ?? undefined; |
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.
)?.Id ?? undefined; | |
)?.Id; |
Redundant.
/** | ||
* Get all domain lists recursively | ||
*/ | ||
async function listDomainLists(nextToken? :string): Promise<FirewallDomainListMetadata[]> { |
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.
async function listDomainLists(nextToken? :string): Promise<FirewallDomainListMetadata[]> { | |
async function listDomainLists(nextToken?: string): Promise<FirewallDomainListMetadata[]> { |
@@ -1,3 +1,4 @@ | |||
"use strict"; |
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.
Should this file be included?
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.
It was committed unintentionally. Reverted it.
@lpizzinidev Thanks for your detailed review! I think your suggestions are all applied. |
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.
Thanks 👍
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
7 similar comments
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Currently you have to specify the managed domain list ID manually in order to use it in a DNS firewall rule.
This PR adds a custom resource that finds the ID from a managed domain list name, along with a new
FirewallManagedDomainList
class that creates the custom resource and implementsIFirewallDomainList
.Closes #25614
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license