Skip to content

Commit

Permalink
chore: Fix Managed Policy ARNs with hardcoded partition in tests (#3662)
Browse files Browse the repository at this point in the history
  • Loading branch information
samson-keung authored Oct 10, 2024
1 parent 25158f1 commit 8de1ca9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ Resources:
secretsmanager:GetSecretValue]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Resources:
logs:CreateLogStream, logs:PutLogEvents]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Resources:
logs:CreateLogStream, logs:PutLogEvents, s3:ListBucket]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Resources:
Type: AWS::Serverless::StateMachine
Properties:
Policies:
- arn:aws:iam::aws:policy/AWSLambda_FullAccess
- !Sub arn:${AWS::Partition}:iam::aws:policy/AWSLambda_FullAccess
Definition:
StartAt: One
States:
Expand Down

0 comments on commit 8de1ca9

Please sign in to comment.