aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.47k stars 3.83k forks source link

aws-gamelift-alpha: minSize and maxSize don't work #28359

Open wintersieck opened 8 months ago

wintersieck commented 8 months ago

Describe the bug

Setting minSize and maxSize on BuildFleet don't seem to take effect. Example:

const fleet = new gamelift.BuildFleet(this, "Game server fleet", {
  fleetName: id,
  content: build,
  instanceType: ec2.InstanceType.of(
    ec2.InstanceClass.R5,
    ec2.InstanceSize.LARGE
  ),
  desiredCapacity: 1,
  minSize: 1,
  maxSize: 2,
  runtimeConfiguration: {
    serverProcesses: [
      {
        launchPath: "/local/game/GameServer",
        concurrentExecutions: 4,
      },
    ],
  },
});

When deployed, they don't take effect when viewed in the console:

Screenshot 2023-12-13 171232

Expected Behavior

minSize and maxSize should work.

Current Behavior

minSize and maxSize don't effect anything when deployed.

Reproduction Steps

See example above.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.101.1

Framework Version

No response

Node.js Version

v20.8.1

OS

Ubuntu (WSL2 on Windows 11)

Language

TypeScript

Language Version

5.2.2

Other information

No response

pahud commented 8 months ago

Interesting. Can you check the min property value in the template from cdk synth?

As far as I can tell from here, it should be correctly passed to cloudformation? https://github.com/aws/aws-cdk/blob/b8b6bafc07b0804f6e802ba563ff3b7deaea6eee/packages/%40aws-cdk/aws-gamelift-alpha/lib/build-fleet.ts#L151

wintersieck commented 8 months ago

I had the same thought when I glanced at it (it sure looks right!). Interestingly, the template does show the correct values:

$ cdk synth <stackName> | grep Size
      MaxSize: 2
      MinSize: 1