Skip to content

Commit 336853b

Browse files
committed
Internal DNS records based on Rack status, not app status
1 parent e962bfa commit 336853b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

provider/aws/formation/app.json.tmpl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"FargateTimersBase": { "Fn::Equals": [ { "Ref": "FargateTimers" }, "Yes" ] },
1818
"FargateTimersSpot": { "Fn::Equals": [ { "Ref": "FargateTimers" }, "Spot" ] },
1919
"InternalDomains": { "Fn::Equals": [ { "Ref": "InternalDomains" }, "Yes" ] },
20+
"InternalRack": { "Fn::Equals": [ { "Ref": "InternalRack" }, "Yes" ] },
2021
"Isolate": { "Fn::And": [ { "Condition": "Private" }, { "Fn::Equals": [ { "Ref": "Isolate" }, "Yes" ] } ] },
2122
"IsolateServices": { "Fn::Or": [ { "Condition": "FargateServicesEither" }, { "Condition": "Isolate" } ] },
2223
"Private": { "Fn::Equals": [ { "Ref": "Private" }, "Yes" ] },
@@ -81,6 +82,11 @@
8182
"Default": "Yes",
8283
"AllowedValues": [ "Yes", "No" ]
8384
},
85+
"InternalRack": {
86+
"Type": "String",
87+
"Default": "No",
88+
"AllowedValues": [ "Yes", "No" ]
89+
},
8490
"Isolate": {
8591
"Type": "String",
8692
"Default": "No",
@@ -192,7 +198,7 @@
192198
"Name": { "Fn::Sub": "{{.Name}}.{{$.App}}.${Rack}.convox." },
193199
"Type": "CNAME",
194200
"TTL": "3600",
195-
"ResourceRecords": [ { "Fn::ImportValue": { "Fn::Sub": "${Rack}:Domain{{ if .Internal }}Internal{{ end }}" } } ]
201+
"ResourceRecords": [ { "Fn::If": [ "InternalRack", { "Fn::ImportValue": { "Fn::Sub": "${Rack}:DomainInternal" } }, { "Fn::ImportValue": { "Fn::Sub": "${Rack}:Domain" } } ] } ]
196202
}
197203
},
198204
{{ if not (certificate $.Certificates .Domains) }}

provider/aws/releases.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,29 @@ func (p *Provider) ReleasePromote(app, id string, opts structs.ReleasePromoteOpt
347347
return err
348348
}
349349

350+
internal, err := p.stackParameter(p.Rack, "Internal")
351+
if err != nil {
352+
return err
353+
}
354+
355+
internalOnly, err := p.stackParameter(p.Rack, "InternalOnly")
356+
if err != nil {
357+
return err
358+
}
359+
360+
anyInternal := "No"
361+
362+
if (internal == "Yes" || internalOnly == "Yes") {
363+
anyInternal = "Yes"
364+
}
365+
350366
private, err := p.stackParameter(p.Rack, "Private")
351367
if err != nil {
352368
return err
353369
}
354370

355371
updates := map[string]string{
372+
"InternalRack": anyInternal,
356373
"LogBucket": p.LogBucket,
357374
"Private": private,
358375
}

0 commit comments

Comments
 (0)