Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addNewCert(name: string, domains: string[]) {
const domainName = domains[0]
const altNames = domains.slice(1)
const subjectAlternativeNames = altNames.length > 0 ? altNames : undefined
const props: CM.CertificateProps = { domainName, subjectAlternativeNames }
return new CM.Certificate(this, `${this.id}-${name}`, props)
}
constructor(scope) {
super(scope, 'scale-your-cloudformation');
const domainName = 'scaleyourcloudformation.com';
const cert = new Certificate(this, 'cert', {
domainName,
validationMethod: ValidationMethod.DNS,
});
const websiteBucket = new Bucket(this, 'WebsiteBucket', {
domainName,
removalPolicy: RemovalPolicy.DESTROY,
websiteIndexDocument: 'index.html',
websiteErrorDocument: 'error.html',
});
const originId = new CfnCloudFrontOriginAccessIdentity(
this,
'OriginAccessIdentity',
{
cloudFrontOriginAccessIdentityConfig: {
export const addNewCert = (
stack: Construct,
name: string,
domains: string[]
) => {
const domainName = domains[0]
const altNames = domains.slice(1)
const subjectAlternativeNames = altNames.length ? altNames : undefined
const props: CM.CertificateProps = { domainName, subjectAlternativeNames }
return new CM.Certificate(stack, `${name}Certificate`, props).certificateArn
}
const noCertFound = `No Certificate found, that matches all domains. Make sure