Skip to content

Instantly share code, notes, and snippets.

@nirsky
Created June 4, 2020 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirsky/ff5e55cd81586220b1b44176ab29647f to your computer and use it in GitHub Desktop.
Save nirsky/ff5e55cd81586220b1b44176ab29647f to your computer and use it in GitHub Desktop.
// Create your ECS cluster, don't use the capacity option.
// We will add it in a different statement so we can keep the returned AutoScalingGroup
const ecsCluster = new ecs.Cluster(this, 'ecs-cluster', {
vpc: myVPC,
clusterName: 'my-cluster',
// ...other props
});
const autoScalingGroup: AutoScalingGroup = ecsCluster.addCapacity('cluster-capacity', {
instanceType: InstanceType.of(InstanceClass.T2, InstanceSize.LARGE),
keyName: 'some-key..',
desiredCapacity: 2,
// ...other props
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment