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(aws-route53-targets): add global accelerator target to route53 alias targets #13407

Merged
merged 15 commits into from Mar 5, 2021

Conversation

@luketn
Copy link
Contributor

@luketn luketn commented Mar 4, 2021

Closes #12839

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

@gitpod-io
Copy link

@gitpod-io gitpod-io bot commented Mar 4, 2021

Copy link
Contributor

@njlynch njlynch left a comment

Looks great! Just one change necessary, due to the fact we can't fully support union types in the CDK.

* If passing a string value, it must be a valid domain name for an existing Global Accelerator. e.g. xyz.awsglobalaccelerator.com
* If passing an instance of an accelerator created within CDK, the accelerator.dnsName property will be used as the target.
*/
constructor(private readonly accelerator: string | globalaccelerator.IAccelerator) {

This comment has been minimized.

@njlynch

njlynch Mar 5, 2021
Contributor

Unfortunately, we can't use type unions in our public APIs as they cannot be strongly-modeled in all languages the CDK supports.

Solutions:

  1. Typically we recommend using static methods instead (e.g., GlobalAcceleratorTarget.domain('xyz.awsglobalaccelerator.com'), GlobalAcceleratorTarget.accelerator(accelerator)).
  2. Within this package, it looks like maybe just creating a second class like ApiGateway/ApiGatewayDomain is an existing, alternative pattern. So you could create GlobalAcceleratorTarget and GlobalAcceleratorDomainTarget.
  3. Final alternative would be to just create this GlobalAcceleratorTarget that accepts an IAccelerator, and add the GlobalAcceleratorDomainTarget (that takes the domain name/string) later based on feedback from the community.

I think given the existing patterns in this module options 2 or 3 are the principal of least surprise; I'm happy either way.

This comment has been minimized.

@luketn

luketn Mar 5, 2021
Author Contributor

Went with option 2. I think it actually makes the code a little cleaner, although it might not be as intuitive to locate and use.

@mergify mergify bot dismissed njlynch’s stale review Mar 5, 2021

Pull request has been modified.

@njlynch
njlynch approved these changes Mar 5, 2021
Copy link
Contributor

@njlynch njlynch left a comment

Thanks for the contribution!

@mergify
Copy link
Contributor

@mergify mergify bot commented Mar 5, 2021

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-cdk-automation
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation commented Mar 5, 2021

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: f6fce6d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

@mergify mergify bot commented Mar 5, 2021

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).

@mergify mergify bot merged commit 2672a55 into aws:master Mar 5, 2021
7 checks passed
7 checks passed
@github-actions
auto-approve
Details
@github-actions
validate-pr
Details
AWS CodeBuild us-east-1 (AutoBuildProject89A8053A-LhjRyN9kxr8o) Build succeeded for project AutoBuildProject89A8053A-LhjRyN9kxr8o
Details
@gitpod-io
Gitpod Open an online workspace in Gitpod
Details
@mergify
Rule: automatic merge (merge) The pull request has been merged automatically
Details
@semantic-pull-requests
Semantic Pull Request ready to be squashed
Details
@mergify
Summary 5 potential rules
Details
This was referenced Mar 8, 2021
cornerwings added a commit to cornerwings/aws-cdk that referenced this pull request Mar 8, 2021
…lias targets (aws#13407)

Closes aws#12839 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants