Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cloudform_1 = require("cloudform");
exports.DomainName = new cloudform_1.ApiGateway.DomainName({
DomainName: cloudform_1.Fn.Join(".", [cloudform_1.Fn.Ref("SubDomain"), cloudform_1.Fn.ImportValue("RootDomain")]),
CertificateArn: cloudform_1.Fn.ImportValue("Certificate")
}).dependsOn("ApiGateway");
exports.BasePathMapping = (branch) => {
const basePathMapping = new cloudform_1.ApiGateway.BasePathMapping({
RestApiId: cloudform_1.Fn.Ref("ApiGateway"),
DomainName: cloudform_1.Fn.Join(".", [cloudform_1.Fn.Ref("SubDomain"), config_1.config.ROOT_DOMAIN]),
BasePath: cloudform_1.Fn.Ref("BasePath"),
Stage: cloudform_1.Fn.Ref("GitHubBranch")
});
if (branch === "master") {
basePathMapping.dependsOn("DomainName");
}
else {
basePathMapping.dependsOn("ApiGatewayStage");
}
return basePathMapping;
};