Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public addCapacity(id: string, options: AddCapacityOptions): autoscaling.AutoScalingGroup {
const autoScalingGroup = new autoscaling.AutoScalingGroup(this, id, {
...options,
vpc: this.vpc,
machineImage: options.machineImage || new EcsOptimizedAmi(),
updateType: options.updateType || autoscaling.UpdateType.REPLACING_UPDATE,
instanceType: options.instanceType,
});
this.addAutoScalingGroup(autoScalingGroup, options);
return autoScalingGroup;
}
public addCapacity(id: string, options: CapacityOptions): autoscaling.AutoScalingGroup {
const asg = new autoscaling.AutoScalingGroup(this, id, {
...options,
vpc: this.vpc,
machineImage: new EksOptimizedImage({
nodeType: nodeTypeForInstanceType(options.instanceType),
kubernetesVersion: this.version,
}),
updateType: options.updateType || autoscaling.UpdateType.ROLLING_UPDATE,
instanceType: options.instanceType,
});
this.addAutoScalingGroup(asg, {
mapRole: options.mapRole,
bootstrapOptions: options.bootstrapOptions,
bootstrapEnabled: options.bootstrapEnabled
});