Skip to content

Commit

Permalink
feat(route53-targets): add AppSync route53 target (#31976)
Browse files Browse the repository at this point in the history
### 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
3 people authored Nov 29, 2024
1 parent 8ccdff4 commit dc7574a
Show file tree
Hide file tree
Showing 13 changed files with 835 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dc7574a

Please sign in to comment.