Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/itchy-swans-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@guardian/cdk": minor
---

feat(GuCertificate): Remove `DeletionPolicy` and `UpdateReplacePolicy`

Typically, the `DeletionPolicy` is set to support CloudFormation imports.
The `AWS::CertificateManager::Certificate` resource does not yet support CFN imports.

See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html.
4 changes: 0 additions & 4 deletions src/constructs/acm/__snapshots__/certificate.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`The GuCertificate class should create a new certificate (which requires
},
"Resources": {
"CertificateTesting28FCAC6D": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "domain-name-for-your-application.example",
"Tags": [
Expand Down Expand Up @@ -43,7 +42,6 @@ exports[`The GuCertificate class should create a new certificate (which requires
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
},
}
Expand All @@ -60,7 +58,6 @@ exports[`The GuCertificate class should create a new certificate when hosted zon
},
"Resources": {
"CertificateTesting28FCAC6D": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "domain-name-for-your-application.example",
"DomainValidationOptions": [
Expand Down Expand Up @@ -98,7 +95,6 @@ exports[`The GuCertificate class should create a new certificate when hosted zon
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
},
}
Expand Down
2 changes: 0 additions & 2 deletions src/constructs/acm/certificate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { RemovalPolicy } from "aws-cdk-lib";
import { Certificate, CertificateValidation } from "aws-cdk-lib/aws-certificatemanager";
import type { CertificateProps } from "aws-cdk-lib/aws-certificatemanager/lib/certificate";
import { HostedZone } from "aws-cdk-lib/aws-route53";
Expand Down Expand Up @@ -32,6 +31,5 @@ export class GuCertificate extends GuAppAwareConstruct(Certificate) {
app,
};
super(scope, "Certificate", awsCertificateProps);
this.applyRemovalPolicy(RemovalPolicy.RETAIN);
}
}
2 changes: 0 additions & 2 deletions src/experimental/patterns/__snapshots__/ec2-app.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ exports[`The GuEc2AppExperimental pattern matches the snapshot 1`] = `
},
},
"CertificateTestguec2app86EE2D42": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "domain-name-for-your-application.example",
"Tags": [
Expand Down Expand Up @@ -239,7 +238,6 @@ exports[`The GuEc2AppExperimental pattern matches the snapshot 1`] = `
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
"DescribeEC2PolicyFF5F9295": {
"Properties": {
Expand Down
2 changes: 0 additions & 2 deletions src/patterns/__snapshots__/api-lambda.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ exports[`The GuApiLambda pattern should allow us to link a domain name to a Lamb
},
"Resources": {
"CertificateTesting28FCAC6D": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "code.theguardian.com",
"DomainValidationOptions": [
Expand Down Expand Up @@ -87,7 +86,6 @@ exports[`The GuApiLambda pattern should allow us to link a domain name to a Lamb
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
"DNS": {
"Properties": {
Expand Down
4 changes: 0 additions & 4 deletions src/patterns/ec2-app/__snapshots__/base.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ exports[`the GuEC2App pattern can produce a restricted EC2 app locked to specifi
"Type": "AWS::AutoScaling::AutoScalingGroup",
},
"CertificateTestguec2app86EE2D42": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "domain-name-for-your-application.example",
"Tags": [
Expand Down Expand Up @@ -177,7 +176,6 @@ exports[`the GuEC2App pattern can produce a restricted EC2 app locked to specifi
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
"DescribeEC2PolicyFF5F9295": {
"Properties": {
Expand Down Expand Up @@ -1035,7 +1033,6 @@ exports[`the GuEC2App pattern should produce a functional EC2 app with minimal a
"Type": "AWS::AutoScaling::AutoScalingGroup",
},
"CertificateTestguec2app86EE2D42": {
"DeletionPolicy": "Retain",
"Properties": {
"DomainName": "domain-name-for-your-application.example",
"Tags": [
Expand Down Expand Up @@ -1067,7 +1064,6 @@ exports[`the GuEC2App pattern should produce a functional EC2 app with minimal a
"ValidationMethod": "DNS",
},
"Type": "AWS::CertificateManager::Certificate",
"UpdateReplacePolicy": "Retain",
},
"DescribeEC2PolicyFF5F9295": {
"Properties": {
Expand Down