diff --git a/provider/aws/formation/app.json.tmpl b/provider/aws/formation/app.json.tmpl index ac1d75debc..63aa9da674 100644 --- a/provider/aws/formation/app.json.tmpl +++ b/provider/aws/formation/app.json.tmpl @@ -17,6 +17,7 @@ "FargateTimersBase": { "Fn::Equals": [ { "Ref": "FargateTimers" }, "Yes" ] }, "FargateTimersSpot": { "Fn::Equals": [ { "Ref": "FargateTimers" }, "Spot" ] }, "InternalDomains": { "Fn::Equals": [ { "Ref": "InternalDomains" }, "Yes" ] }, + "InternalRack": { "Fn::Equals": [ { "Ref": "InternalRack" }, "Yes" ] }, "Isolate": { "Fn::And": [ { "Condition": "Private" }, { "Fn::Equals": [ { "Ref": "Isolate" }, "Yes" ] } ] }, "IsolateServices": { "Fn::Or": [ { "Condition": "FargateServicesEither" }, { "Condition": "Isolate" } ] }, "Private": { "Fn::Equals": [ { "Ref": "Private" }, "Yes" ] }, @@ -81,6 +82,11 @@ "Default": "Yes", "AllowedValues": [ "Yes", "No" ] }, + "InternalRack": { + "Type": "String", + "Default": "No", + "AllowedValues": [ "Yes", "No" ] + }, "Isolate": { "Type": "String", "Default": "No", @@ -192,7 +198,7 @@ "Name": { "Fn::Sub": "{{.Name}}.{{$.App}}.${Rack}.convox." }, "Type": "CNAME", "TTL": "3600", - "ResourceRecords": [ { "Fn::ImportValue": { "Fn::Sub": "${Rack}:Domain{{ if .Internal }}Internal{{ end }}" } } ] + "ResourceRecords": [ { "Fn::If": [ "InternalRack", { "Fn::ImportValue": { "Fn::Sub": "${Rack}:DomainInternal" } }, { "Fn::ImportValue": { "Fn::Sub": "${Rack}:Domain" } } ] } ] } }, {{ if not (certificate $.Certificates .Domains) }} diff --git a/provider/aws/releases.go b/provider/aws/releases.go index 7ebf27cd38..0c763429c7 100644 --- a/provider/aws/releases.go +++ b/provider/aws/releases.go @@ -347,12 +347,29 @@ func (p *Provider) ReleasePromote(app, id string, opts structs.ReleasePromoteOpt return err } + internal, err := p.stackParameter(p.Rack, "Internal") + if err != nil { + return err + } + + internalOnly, err := p.stackParameter(p.Rack, "InternalOnly") + if err != nil { + return err + } + + anyInternal := "No" + + if (internal == "Yes" || internalOnly == "Yes") { + anyInternal = "Yes" + } + private, err := p.stackParameter(p.Rack, "Private") if err != nil { return err } updates := map[string]string{ + "InternalRack": anyInternal, "LogBucket": p.LogBucket, "Private": private, }