Skip to content

Commit

Permalink
add DeletionPolicy Retain to DNS zones
Browse files Browse the repository at this point in the history
this can easily create a conflict if you start manually adding records to the zone
  • Loading branch information
tj committed Sep 30, 2020
1 parent ef62b9e commit 1509824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platform/lambda/stack/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ func dnsZone(c *Config, m Map, domain string) interface{} {

// new zone
m[id] = Map{
"Type": "AWS::Route53::HostedZone",
"Type": "AWS::Route53::HostedZone",
"DeletionPolicy": "Retain",
"Properties": Map{
"Name": domain,
},
Expand Down
2 changes: 2 additions & 0 deletions platform/lambda/stack/resources/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ func Example_stageDNSZone() {
dump(c, "DnsZoneUpExampleCom")
// Output:
// {
// "DeletionPolicy": "Retain",
// "Properties": {
// "Name": "up-example.com"
// },
Expand Down Expand Up @@ -522,6 +523,7 @@ func Example_dnsZone() {
dump(c, "DnsZoneUpExampleCom")
// Output:
// {
// "DeletionPolicy": "Retain",
// "Properties": {
// "Name": "up-example.com"
// },
Expand Down

0 comments on commit 1509824

Please sign in to comment.