Skip to content

Commit c7b9b5f

Browse files
committed
fix: revert to previous index based policy
1 parent 199fc37 commit c7b9b5f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/LambdaFunction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ export class LambdaFunction extends pulumi.ComponentResource {
8888

8989
// Attach any additional policies
9090
const policyArns = [...(args.policyArns || []), cloudWatchPolicy.policy.arn]
91-
policyArns.map(arn => {
92-
const name = pulumi.output(arn).apply(name => name.split(':').reverse()[0])
93-
const policyAttachmentName = pulumi.interpolate`${name}-${this.role.name}-attachment`.get()
91+
policyArns.map((arn, index) => {
92+
const policyAttachmentName = `${this.role.name}-policy-${index}`
9493
return new aws.iam.RolePolicyAttachment(
9594
policyAttachmentName,
9695
{

0 commit comments

Comments
 (0)