Skip to content

Commit 1509824

Browse files
committed
add DeletionPolicy Retain to DNS zones
this can easily create a conflict if you start manually adding records to the zone
1 parent ef62b9e commit 1509824

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

platform/lambda/stack/resources/resources.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func dnsZone(c *Config, m Map, domain string) interface{} {
109109

110110
// new zone
111111
m[id] = Map{
112-
"Type": "AWS::Route53::HostedZone",
112+
"Type": "AWS::Route53::HostedZone",
113+
"DeletionPolicy": "Retain",
113114
"Properties": Map{
114115
"Name": domain,
115116
},

platform/lambda/stack/resources/resources_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ func Example_stageDNSZone() {
458458
dump(c, "DnsZoneUpExampleCom")
459459
// Output:
460460
// {
461+
// "DeletionPolicy": "Retain",
461462
// "Properties": {
462463
// "Name": "up-example.com"
463464
// },
@@ -522,6 +523,7 @@ func Example_dnsZone() {
522523
dump(c, "DnsZoneUpExampleCom")
523524
// Output:
524525
// {
526+
// "DeletionPolicy": "Retain",
525527
// "Properties": {
526528
// "Name": "up-example.com"
527529
// },

0 commit comments

Comments
 (0)