-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(route53-targets): add
AppSync
route53 target (#31976)
### Issue # (if applicable) Closes #26109 ### Reason for this change This PR adds support for creating alias records on AppSync's `GraphqlApi`. ### Description of changes - Add `appsync-target.ts` file, with the `AppSync` class. - Add unit tests for this new `AppSync` target class. - Update README.md of `aws-cdk-lib/aws-route53-targets` ### Description of how you validated changes - Add unit tests ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --------- Co-authored-by: GZ <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8ccdff4
commit dc7574a
Showing
13 changed files
with
835 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...g.appsync-target.js.snapshot/appsyncdomainnameDefaultTestDeployAssert6D41B82A.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...appsync-target.js.snapshot/appsyncdomainnameDefaultTestDeployAssert6D41B82A.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...e53-targets/test/integ.appsync-target.js.snapshot/aws-cdk-appsync-alias-integ.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
142 changes: 142 additions & 0 deletions
142
...3-targets/test/integ.appsync-target.js.snapshot/aws-cdk-appsync-alias-integ.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"Resources": { | ||
"apiC8550315": { | ||
"Type": "AWS::AppSync::GraphQLApi", | ||
"Properties": { | ||
"AuthenticationType": "API_KEY", | ||
"Name": "api" | ||
} | ||
}, | ||
"apiSchema0EA92056": { | ||
"Type": "AWS::AppSync::GraphQLSchema", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"apiC8550315", | ||
"ApiId" | ||
] | ||
}, | ||
"Definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n" | ||
} | ||
}, | ||
"apiDomainNameBBFE36A4": { | ||
"Type": "AWS::AppSync::DomainName", | ||
"Properties": { | ||
"CertificateArn": "arn:aws:acm:test-region:12345678:certificate/86468209-a272-595d-b831-0efb6421265z", | ||
"Description": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"domain for api at ", | ||
{ | ||
"Fn::GetAtt": [ | ||
"apiC8550315", | ||
"GraphQLUrl" | ||
] | ||
} | ||
] | ||
] | ||
}, | ||
"DomainName": "*.example.com" | ||
} | ||
}, | ||
"apiDomainAssociation1CF2F52A": { | ||
"Type": "AWS::AppSync::DomainNameApiAssociation", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"apiC8550315", | ||
"ApiId" | ||
] | ||
}, | ||
"DomainName": "*.example.com" | ||
}, | ||
"DependsOn": [ | ||
"apiDomainNameBBFE36A4" | ||
] | ||
}, | ||
"apiDefaultApiKey6AB8D7C4": { | ||
"Type": "AWS::AppSync::ApiKey", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"apiC8550315", | ||
"ApiId" | ||
] | ||
} | ||
}, | ||
"DependsOn": [ | ||
"apiSchema0EA92056" | ||
] | ||
}, | ||
"Alias325C5727": { | ||
"Type": "AWS::Route53::RecordSet", | ||
"Properties": { | ||
"AliasTarget": { | ||
"DNSName": { | ||
"Fn::GetAtt": [ | ||
"apiDomainNameBBFE36A4", | ||
"AppSyncDomainName" | ||
] | ||
}, | ||
"HostedZoneId": { | ||
"Fn::FindInMap": [ | ||
"AWSCloudFrontPartitionHostedZoneIdMap", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
"zoneId" | ||
] | ||
} | ||
}, | ||
"HostedZoneId": "Z23ABC4XYZL05B", | ||
"Name": "*.example.com.", | ||
"Type": "A" | ||
} | ||
} | ||
}, | ||
"Mappings": { | ||
"AWSCloudFrontPartitionHostedZoneIdMap": { | ||
"aws": { | ||
"zoneId": "Z2FDTNDATAQYW2" | ||
}, | ||
"aws-cn": { | ||
"zoneId": "Z3RFFRIM2A3IF5" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ng/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.