in src/experimental/patterns/ec2-app.ts [210:234]
private constructor(scope: GuStack) {
const { stackId } = scope;
super(scope, "AsgRollingUpdatePolicy", {
statements: [
// Allow usage of command `cfn-signal`.
new PolicyStatement({
actions: ["cloudformation:SignalResource"],
effect: Effect.ALLOW,
resources: [stackId],
}),
/*
Allow usage of command `aws elbv2 describe-target-health`.
AWS Elastic Load Balancing does not support resource based policies, so the resource has to be `*` (any) here.
See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html
*/
new PolicyStatement({
actions: ["elasticloadbalancing:DescribeTargetHealth"],
effect: Effect.ALLOW,
resources: ["*"],
}),
],
});
}