sparse-intern-71089
02/12/2020, 1:55 AMwhite-balloon-205
refined-vegetable-66224
02/12/2020, 1:23 PMtargetGroup-${envName}
, {`
port: 80,
targetType: "instance"
});
`const autoScalingGroup = cluster.createAutoScalingGroup(insig-express-autoscaling-${envName}
, {`
targetGroups: [targetGroup],
subnetIds: awsx.ec2.Vpc.getDefault().publicSubnetIds,
templateParameters: {
minSize: fargate.desiredCount || 2,
maxSize: fargate.maxCount || 10,
defaultCooldown: fargate.defaultCooldown || 60
},
launchConfigurationArgs: {
associatePublicIpAddress: true
},
});
`autoScalingGroup.scaleToTrackAverageCPUUtilization(keepAround50Percent-${envName}
, {`
targetValue: 50,
});
`const policy = autoScalingGroup.scaleToTrackRequestCountPerTarget(onHighRequest-${envName}
, {`
targetValue: 2000,
targetGroup: targetGroup,
});
busy-magazine-48939
03/18/2020, 10:30 AMcreateAutoScalingGroup
method – under the hood it uses cloudformation template that expects that targetGroup will be of a different type - Instance
.busy-magazine-48939
03/18/2020, 10:59 AMA list of target groups to associate with the Auto Scaling group. All target groups must have the “instance” [targetType].