Daniel Gato
01/28/2022, 1:42 PMconst iotAuthPolicy = new iot.CfnPolicy(this, 'IotAuthPolicy', {
policyName: 'iot-auth-policy',
policyDocument: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:*",
"Resource": "*"
}
]
},
});
This policy remains after we remove even when we define:
if (app.stage !== "prod") {
app.setDefaultRemovalPolicy(RemovalPolicy.DESTROY);
}
Daniel Gato
01/28/2022, 2:46 PMnew cloudfront.Distribution(this, "Distribution", {
domainNames: [scope.customDomainName('xxx')],
certificate:
new acm.DnsValidatedCertificate(this, "Certificate", {
domainName: scope.customDomainName('xxx'),
hostedZone:
route53.HostedZone.fromLookup(this, "HostedZone", {
domainName: '<http://xxx.io|xxx.io>',
}),
region: "us-east-1",
}),
defaultBehavior: {
origin: new cfOrigins.S3Origin(this.xxx.s3Bucket, {
originPath: 'public',
}),
viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
},
});