Skip to content

Commit

Permalink
[#3737] Add app param to ignore manual replica count scaling
Browse files Browse the repository at this point in the history
### What is the feature/fix?

Add app param to ignore manual replica count scaling
  • Loading branch information
nightfury1204 committed Aug 9, 2024
1 parent 1a027ce commit 584ad69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions provider/aws/formation/app.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
"Type": "String",
"Default": ""
},
"IgnoreManualScaleCount": {
"Type": "String",
"Default": "No",
"AllowedValues": [ "Yes", "No" ]
},
"InternalDomains": {
"Type": "String",
"Default": "Yes",
Expand Down Expand Up @@ -389,6 +394,7 @@
"LogGroup": { "Fn::If": [ "EnableCloudWatch", { "Ref": "LogGroup" }, { "Ref": "AWS::NoValue" } ] },
"InternalDomains": { "Ref": "InternalDomains" },
"Isolate": { "Fn::If": [ "IsolateServices", "Yes", "No" ] },
"IgnoreManualScaleCount": { "Ref": "IgnoreManualScaleCount" },
"Memory": { "Fn::Select": [ 2, { "Ref": "{{ upper .Name }}Formation" } ] },
"Policies": "{{ join .Policies "," }}",
"Private": { "Ref": "Private" },
Expand Down
12 changes: 9 additions & 3 deletions provider/aws/formation/service.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"Private": { "Fn::Equals": [ { "Ref": "Private" }, "Yes" ] },
"RackUrl": { "Fn::Equals": [ { "Ref": "RackUrl" }, "Yes" ] },
"EnableContainerReadonlyRootFilesystem": { "Fn::Equals": [ { "Ref": "EnableContainerReadonlyRootFilesystem" }, "Yes" ] },
"EnableIgnoreManualScaleCount": { "Fn::Equals": [ { "Ref": "IgnoreManualScaleCount" }, "Yes" ] },
"RouteHttp": { "Fn::Equals": [ { "Ref": "RedirectHttps" }, "No" ] },
"TaskTags": { "Fn::Equals": [ { "Ref": "TaskTags" }, "Yes" ] }
},
Expand Down Expand Up @@ -74,6 +75,11 @@
"Default": "No",
"AllowedValues": [ "Yes", "Spot", "No" ]
},
"IgnoreManualScaleCount": {
"Type": "String",
"Default": "No",
"AllowedValues": [ "Yes", "No" ]
},
"InternalDomains": {
"Type": "String",
"Default": "Yes",
Expand Down Expand Up @@ -217,15 +223,15 @@
"Properties": {
"ServiceToken": { "Fn::ImportValue": { "Fn::Sub": "${Rack}:CustomTopic" } },
"X": "{{.Scale.Count.Min}}",
"Y": { "Ref": "Count" }
"Y": { "Fn::If": [ "EnableIgnoreManualScaleCount", "{{.Scale.Count.Min}}", { "Ref": "Count" } ] }
}
},
"MaxCount": {
"Type": "Custom::MathMax",
"Properties": {
"ServiceToken": { "Fn::ImportValue": { "Fn::Sub": "${Rack}:CustomTopic" } },
"X": "{{.Scale.Count.Max}}",
"Y": { "Ref": "Count" }
"Y": { "Fn::If": [ "EnableIgnoreManualScaleCount", "{{.Scale.Count.Max}}", { "Ref": "Count" } ] }
}
},
"AutoscalingRole": {
Expand Down Expand Up @@ -584,7 +590,7 @@
{{ if .Agent.Enabled }}
"SchedulingStrategy": "DAEMON",
{{ else }}
"DesiredCount": { "Ref": "Count" },
"DesiredCount": { "Fn::If": [ "EnableIgnoreManualScaleCount", { "Ref": "AWS::NoValue" }, { "Ref": "Count" } ] },
"SchedulingStrategy": "REPLICA",
"PlacementStrategies": { "Fn::If": [ "FargateEither",
{ "Ref": "AWS::NoValue" },
Expand Down

0 comments on commit 584ad69

Please sign in to comment.