Skip to content

Commit 8de1ca9

Browse files
authored
chore: Fix Managed Policy ARNs with hardcoded partition in tests (#3662)
1 parent 25158f1 commit 8de1ca9

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

integration/resources/templates/combination/api_with_authorizers_max.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Resources:
125125
Type: AWS::IAM::Role
126126
Properties:
127127
ManagedPolicyArns:
128-
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
129-
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
128+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
129+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
130130
AssumeRolePolicyDocument:
131131
Version: '2012-10-17'
132132
Statement:

integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ Resources:
138138
Type: AWS::IAM::Role
139139
Properties:
140140
ManagedPolicyArns:
141-
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
142-
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
141+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
142+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
143143
AssumeRolePolicyDocument:
144144
Version: '2012-10-17'
145145
Statement:

integration/resources/templates/combination/function_with_mq.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ Resources:
101101
secretsmanager:GetSecretValue]
102102
Effect: Allow
103103
Resource: '*'
104-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
104+
ManagedPolicyArns:
105+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
105106
Tags:
106107
- {Value: SAM, Key: lambda:createdBy}
107108

integration/resources/templates/combination/function_with_msk.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Resources:
2727
logs:CreateLogStream, logs:PutLogEvents]
2828
Effect: Allow
2929
Resource: '*'
30-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
30+
ManagedPolicyArns:
31+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
3132
Tags:
3233
- {Value: SAM, Key: lambda:createdBy}
3334

integration/resources/templates/combination/function_with_msk_trigger_and_s3_onfailure_events_destinations.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Resources:
2727
logs:CreateLogStream, logs:PutLogEvents, s3:ListBucket]
2828
Effect: Allow
2929
Resource: '*'
30-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
30+
ManagedPolicyArns:
31+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
3132
Tags:
3233
- {Value: SAM, Key: lambda:createdBy}
3334

integration/resources/templates/single/state_machine_with_api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Resources:
1919
Type: AWS::Serverless::StateMachine
2020
Properties:
2121
Policies:
22-
- arn:aws:iam::aws:policy/AWSLambda_FullAccess
22+
- !Sub arn:${AWS::Partition}:iam::aws:policy/AWSLambda_FullAccess
2323
Definition:
2424
StartAt: One
2525
States:

0 commit comments

Comments
 (0)