Skip to content

Commit dc7574a

Browse files
ScottRobinson03GavinZZmergify[bot]
authored
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>
1 parent 8ccdff4 commit dc7574a

13 files changed

+835
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/appsyncdomainnameDefaultTestDeployAssert6D41B82A.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/appsyncdomainnameDefaultTestDeployAssert6D41B82A.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/aws-cdk-appsync-alias-integ.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"Resources": {
3+
"apiC8550315": {
4+
"Type": "AWS::AppSync::GraphQLApi",
5+
"Properties": {
6+
"AuthenticationType": "API_KEY",
7+
"Name": "api"
8+
}
9+
},
10+
"apiSchema0EA92056": {
11+
"Type": "AWS::AppSync::GraphQLSchema",
12+
"Properties": {
13+
"ApiId": {
14+
"Fn::GetAtt": [
15+
"apiC8550315",
16+
"ApiId"
17+
]
18+
},
19+
"Definition": "type test {\n version: String!\n}\ntype Query {\n getTests: [test]!\n}\ntype Mutation {\n addTest(version: String!): test\n}\n"
20+
}
21+
},
22+
"apiDomainNameBBFE36A4": {
23+
"Type": "AWS::AppSync::DomainName",
24+
"Properties": {
25+
"CertificateArn": "arn:aws:acm:test-region:12345678:certificate/86468209-a272-595d-b831-0efb6421265z",
26+
"Description": {
27+
"Fn::Join": [
28+
"",
29+
[
30+
"domain for api at ",
31+
{
32+
"Fn::GetAtt": [
33+
"apiC8550315",
34+
"GraphQLUrl"
35+
]
36+
}
37+
]
38+
]
39+
},
40+
"DomainName": "*.example.com"
41+
}
42+
},
43+
"apiDomainAssociation1CF2F52A": {
44+
"Type": "AWS::AppSync::DomainNameApiAssociation",
45+
"Properties": {
46+
"ApiId": {
47+
"Fn::GetAtt": [
48+
"apiC8550315",
49+
"ApiId"
50+
]
51+
},
52+
"DomainName": "*.example.com"
53+
},
54+
"DependsOn": [
55+
"apiDomainNameBBFE36A4"
56+
]
57+
},
58+
"apiDefaultApiKey6AB8D7C4": {
59+
"Type": "AWS::AppSync::ApiKey",
60+
"Properties": {
61+
"ApiId": {
62+
"Fn::GetAtt": [
63+
"apiC8550315",
64+
"ApiId"
65+
]
66+
}
67+
},
68+
"DependsOn": [
69+
"apiSchema0EA92056"
70+
]
71+
},
72+
"Alias325C5727": {
73+
"Type": "AWS::Route53::RecordSet",
74+
"Properties": {
75+
"AliasTarget": {
76+
"DNSName": {
77+
"Fn::GetAtt": [
78+
"apiDomainNameBBFE36A4",
79+
"AppSyncDomainName"
80+
]
81+
},
82+
"HostedZoneId": {
83+
"Fn::FindInMap": [
84+
"AWSCloudFrontPartitionHostedZoneIdMap",
85+
{
86+
"Ref": "AWS::Partition"
87+
},
88+
"zoneId"
89+
]
90+
}
91+
},
92+
"HostedZoneId": "Z23ABC4XYZL05B",
93+
"Name": "*.example.com.",
94+
"Type": "A"
95+
}
96+
}
97+
},
98+
"Mappings": {
99+
"AWSCloudFrontPartitionHostedZoneIdMap": {
100+
"aws": {
101+
"zoneId": "Z2FDTNDATAQYW2"
102+
},
103+
"aws-cn": {
104+
"zoneId": "Z3RFFRIM2A3IF5"
105+
}
106+
}
107+
},
108+
"Parameters": {
109+
"BootstrapVersion": {
110+
"Type": "AWS::SSM::Parameter::Value<String>",
111+
"Default": "/cdk-bootstrap/hnb659fds/version",
112+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
113+
}
114+
},
115+
"Rules": {
116+
"CheckBootstrapVersion": {
117+
"Assertions": [
118+
{
119+
"Assert": {
120+
"Fn::Not": [
121+
{
122+
"Fn::Contains": [
123+
[
124+
"1",
125+
"2",
126+
"3",
127+
"4",
128+
"5"
129+
],
130+
{
131+
"Ref": "BootstrapVersion"
132+
}
133+
]
134+
}
135+
]
136+
},
137+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
138+
}
139+
]
140+
}
141+
}
142+
}

packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.appsync-target.js.snapshot/integ.json

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)