-
Notifications
You must be signed in to change notification settings - Fork 249
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(Implement aws-route53-alb): Implement new construct #421
Conversation
…s into Issue351 Bring up to date with main
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…s into Issue351 Update local.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Minor typos need to be addressed but overall good construct
source/patterns/@aws-solutions-constructs/aws-route53-alb/README.md
Outdated
Show resolved
Hide resolved
public readonly loadBalancer: elb.ApplicationLoadBalancer; | ||
|
||
/** | ||
* @summary Constructs a new instance of the LambdaToStepfunctionsProps class. |
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 be Route53ToAlb class
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.
oops :-)
|
||
| **Name** | **Type** | **Description** | | ||
|:-------------|:----------------|-----------------| | ||
| privateHostedZoneProps? | [route53.PrivateHostedZoneProps](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-route53.PrivateHostedZoneProps.html) | Optional custom properties for a new Private Hosted Zone. Cannot be specified for a public API. Cannot specify a VPC, it will use the VPC in existingVpc or the VPC created by the construct. Providing both this and existingHostedZoneInterfaceis an error. | |
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.
Is it missing PublicHostedZoneProps
if customer chose to set publicApi
to true
?
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.
No, the construct doesn't support creating a public Hosted Zone (too many external dependencies). It will only configure a Public Hosted Zone that already exists. The thought is that externally facing DNS settings are not dynamic parts of a stack that are set up and torn down every time, but do get reconfigured to point to new internal infrastructure.
*/ | ||
constructor(scope: Construct, id: string, props: Route53ToAlbProps) { | ||
super(scope, id); | ||
defaults.CheckProps(props); |
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.
Is the CheckProps
method updated to validate Route53 props?
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 yet - CheckProps() has checks that are common to multiple constructs, all Route53 checks are unique to this construct. If/when we create another Route53 constructs, we'll identify the common checks and move them to CheckProps().
super(scope, id); | ||
defaults.CheckProps(props); | ||
|
||
if ((props?.logAccessLogs === false) && (props.loggingBucketProps)) { |
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.
Is there test coverage to validate this and the following scenarios?
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.
Hmm - I'll check. I ensured 100% statement/branch coverage for the new core components, but checking this module it only had 96.8/87.1% coverage.
const props: Route53ToAlbProps = { | ||
publicApi: true, | ||
existingHostedZoneInterface: newZone, | ||
existingVpc: newVpc, |
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.
Is it required to provide existingVpc
for Public hosted zone?
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.
No, a public hosted zone exists outside a VPC so we can create a new VPC or use one provided. A private hosted zone is DNS within a VPC, so it defines a VPC and which must be provided as the existingVpc.
export function CreateLambdaTargetGroup( | ||
scope: Construct, | ||
id: string, | ||
lambdaFunction: 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.
The input type can be IFunction
return listener; | ||
} | ||
|
||
export function CreateLambdaTargetGroup( |
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.
Is this a convenient helper function for customer to add lambda target? I don't see it being used from anywhere other than the test code
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.
There's no reason a client couldn't use it, although I struggle to come up with a use case.
}); | ||
} | ||
|
||
export function AddTarget( |
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.
Are the customers required to use this utility function to add target(s) for Alb? Is this documented in README?
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.
No/No
if (props.privateHostedZoneProps.vpc) { | ||
throw new Error('All VPC specs must be provided at the Construct level in Route53ToAlbProps'); | ||
} | ||
const manufacturedProps: r53.PrivateHostedZoneProps = defaults.overrideProps(props.privateHostedZoneProps, { vpc: this.vpc }); |
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.
Are the default props for privateHostedZoneProps
missing from core
package? Do we need to enable security best practices for Route53 e.g. Logging, health checks, etc.?
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/logging-monitoring.html
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'm not sure that page is best practices, our actual Best Practices page is a little thin.
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.
Opening an Issue to address this in a fast follow
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue #, if available:
351
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.