DesiredEC2Instances ignored in multi-location CloudFormation deployment
We have a CloudFormation GameLift Fleet template with this multi-location setting:
....
"Locations": [
{
"Location": "us-east-1",
"LocationCapacity": {
"DesiredEC2Instances": 1,
"MinSize": 0,
"MaxSize": 10
}
},
{
"Location": "us-west-2",
"LocationCapacity": {
"DesiredEC2Instances": 0,
"MinSize": 0,
"MaxSize": 10
}
},
{
"Location": "eu-west-1",
"LocationCapacity": {
"DesiredEC2Instances": 0,
"MinSize": 0,
"MaxSize": 10
}
}
],
...
After stack deployment, the fleet has the correct locations and respective min/max instances, but desired instances is set to 1 for all locations.
I am able to fix it in the AWS console post-deployment, but obviously this isn't ideal.
Have I misunderstood how this CloudFormation property works? Or is this a known bug?
Hi @REDACTEDUSER
Yes, this is a known issue in our backlog. See doc: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-fleet.html#cfn-gamelift-fleet-******
When creating a new fleet, GameLift automatically sets this value to "1". Once the fleet is active, you can change this value.
It's tricky to fix this because it would be a backwards-incompatible change. For instance, some people may put down a very large number for these fields currently, and if we fix the behavior as the name intended, it would break those customers due to LimitExceededException.
In the meantime, it might be possible to use CloudFormation Custom Resources to trigger a lambda to update your fleet/location capacity upon creation. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html
Ok gotcha. Missed that note in the docs.
I've decided to automate this from our deployment script when stack update completes (rather than figure out Custom Resources).
Thanks!
Relevant questions
DesiredEC2Instances ignored in multi-location CloudFormation deployment
Accepted Answerasked 9 months agoAWS::CloudFormation::Interface metadata ignored
Accepted Answerasked 5 months agoCan't create ECS deployment group using CloudFormation (loadBalancerInfo error)
Accepted Answerasked 7 months agoApp Runner Deployment Race Condition When Using CloudFormation - No Outbound Connectivity
asked 6 months agoCloudFront deployment runs infinetely
asked 4 months agocan we create route53 using aws cloudformation template,
asked 4 months agoHow to declare multi region access point in cloudformation template
asked 15 days agoCloudFormation reference the userId that is running the Template
asked 2 months agoCloudFormation template publishing without creating and publish an AMI
asked 3 years agoHttpApi timeout setting missing from SAM cloudformation template
Accepted Answerasked 2 years ago