Skip to content

Commit

Permalink
finally fixed base path mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
gugzkumar committed Dec 25, 2019
1 parent 1f45f33 commit 538bfdc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .aws-infrastructure/lib/CheetSheetNetwork-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export class CheetSheetNetworkStack extends cdk.Stack {
hostedZoneId: AWS_ROUTE53_HOSTED_ZONE_ID,
zoneName: this.siteDomainName
});
// this.constructClientUiNetwork();
this.constructClientUiNetwork();
this.constructApiNetwork();

}


Expand All @@ -40,15 +39,18 @@ export class CheetSheetNetworkStack extends cdk.Stack {
const acmCert = certificatemanager.Certificate.fromCertificateArn(this, 'SSLCertificate', AWS_ACM_CERTIFICATE_ARN);

const apiIdReference = cdk.Fn.importValue(`CheetSheetCodeStack-${ENVIRONMENT}-API-GATEWAY-API-ID`);
const api = apigateway.RestApi.fromRestApiId(this, 'RestApi', apiIdReference);

const apiDomain = new apigateway.DomainName(this, 'ApiGatewayDomain', {
domainName: apiDomainName,
certificate: acmCert
});
apiDomain.addBasePathMapping(api);


const apiDomainMapping = new apigateway.CfnBasePathMapping(this, 'ApiGatewayDomainMapping',
{
domainName: apiDomain.domainName,
restApiId: apiIdReference,
stage: 'Prod'
}
)
const targetResource = new targets.ApiGatewayDomain(apiDomain);

const ApiDNSRecord = new route53.ARecord(this, 'ApiSiteAliasRecord', {
Expand Down

0 comments on commit 538bfdc

Please sign in to comment.