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(appsync): support custom domain mappings #19368

Merged
merged 11 commits into from
Mar 18, 2022
Prev Previous commit
Next Next commit
Fix linting warnings and errors
  • Loading branch information
cgarvis committed Mar 17, 2022
commit 60ca733358cd8ddf823db5d55b4b8bdd1f7201ca
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ export class GraphqlApi extends GraphqlApiBase {
certificateArn: props.domainName.certificate.certificateArn,
description: `domain for ${this.name} at ${this.graphqlUrl}`,
});

new CfnDomainNameApiAssociation(this, 'DomainAssociation', {
domainName: props.domainName.domainName,
apiId: this.apiId,
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-appsync/test/appsync.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as path from 'path';
import { Template } from '@aws-cdk/assertions';
import { Certificate } from '@aws-cdk/aws-certificatemanager';
import * as iam from '@aws-cdk/aws-iam';
import * as cdk from '@aws-cdk/core';
import * as appsync from '../lib';
import { Certificate } from '@aws-cdk/aws-certificatemanager';

let stack: cdk.Stack;
let api: appsync.GraphqlApi;
Expand Down Expand Up @@ -178,16 +178,16 @@ test('appsync GraphqlApi should be configured with custom domain when specified'
// THEN
Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DomainNameApiAssociation', {
ApiId: {
"Fn::GetAtt": [
"apicustomcwlogsrole508EAC74",
"ApiId",
'Fn::GetAtt': [
'apicustomcwlogsrole508EAC74',
'ApiId',
],
},
DomainName: domainName,
});

Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DomainName', {
CertificateArn: { "Ref": "AcmCertificate49D3B5AF" },
CertificateArn: { Ref: 'AcmCertificate49D3B5AF' },
DomainName: domainName,
});
});