Skip to content

Commit 7b55daa

Browse files
committed
[Permissions] Add new stack parameter 'AdditionalPoliciesPCAPI' to add custom permissions for the ParallelCluster API Lambda role, on top of the default ones.
1 parent 65178a5 commit 7b55daa

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

infrastructure/environments/demo-cfn-create-args.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Parameters:
2626
# ParameterValue: "subnet-xxxxxxxxxx,subnet-xxxxxxxxxx,subnet-xxxxxxxxxx"
2727
# - ParameterKey: LambdaSecurityGroupIds
2828
# ParameterValue: sg-xxxxxxxxxx
29+
# - ParameterKey: AdditionalPoliciesPCAPI
30+
# ParameterValue: arn:aws:iam::xxxxxxxxxx:policy/xxxxxxxxxx
2931
# - ParameterKey: PermissionsBoundaryPolicy
3032
# ParameterValue: arn:aws:iam::xxxxxxxxxx:policy/xxxxxxxxxx
3133
# - ParameterKey: PermissionsBoundaryPolicyPCAPI

infrastructure/environments/demo-cfn-update-args.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Parameters:
2626
UsePreviousValue: true
2727
- ParameterKey: LambdaSecurityGroupIds
2828
UsePreviousValue: true
29+
- ParameterKey: AdditionalPoliciesPCAPI
30+
UsePreviousValue: true
2931
- ParameterKey: PermissionsBoundaryPolicy
3032
UsePreviousValue: true
3133
- ParameterKey: PermissionsBoundaryPolicyPCAPI

infrastructure/parallelcluster-ui.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ Parameters:
5757
Description: 'ARN of the IAM policy to use as permissions boundary for every IAM role created by ParallelCluster API infrastructure. [ParallelCluster >= 3.8.0]'
5858
Default: ''
5959
AllowedPattern: "^(arn:.*:iam::.*:policy\\/([a-zA-Z0-9_-]+))|()$"
60+
AdditionalPoliciesPCAPI:
61+
Type: String
62+
Description: |
63+
(OPTIONAL) ARN of the additional IAM policy to be attached to the default execution role for the ParallelCluster Lambda function.
64+
Only one policy can be specified.
65+
Default: ''
66+
AllowedPattern: "^(arn:.*:iam::.*:policy\\/([a-zA-Z0-9_-]+))|()$"
6067
IAMRoleAndPolicyPrefix:
6168
Type: String
6269
Description: 'Prefix applied to the name of every IAM role and policy (max length: 10). [ParallelCluster >= 3.8.0]'
@@ -113,6 +120,7 @@ Metadata:
113120
- Label:
114121
default: (Optional) Permissions
115122
Parameters:
123+
- AdditionalPoliciesPCAPI
116124
- IAMRoleAndPolicyPrefix
117125
- PermissionsBoundaryPolicy
118126
- PermissionsBoundaryPolicyPCAPI
@@ -169,6 +177,7 @@ Conditions:
169177
UseIAMRoleAndPolicyPrefix: !Not [!Equals [!Ref IAMRoleAndPolicyPrefix, '']]
170178
UseCustomDomain: !Not [!Equals [!Ref CustomDomain, '']]
171179
UseCognitoCustomDomain: !Not [!Equals [!Ref CognitoCustomDomain, '']]
180+
UseAdditionalPoliciesPCAPI: !Not [!Equals [!Ref AdditionalPoliciesPCAPI, '']]
172181

173182
Mappings:
174183
ParallelClusterUI:
@@ -204,6 +213,7 @@ Resources:
204213
Parameters:
205214
PermissionsBoundaryPolicy: !If [ UsePermissionBoundaryPCAPI, !Ref PermissionsBoundaryPolicyPCAPI, !Ref AWS::NoValue ]
206215
IAMRoleAndPolicyPrefix: !If [ UseIAMRoleAndPolicyPrefix, !Ref IAMRoleAndPolicyPrefix, !Ref AWS::NoValue ]
216+
ParallelClusterFunctionAdditionalPolicies: !If [ UseAdditionalPoliciesPCAPI, !Ref AdditionalPoliciesPCAPI, !Ref AWS::NoValue ]
207217
ApiDefinitionS3Uri: !Sub s3://${AWS::Region}-aws-parallelcluster/parallelcluster/${Version}/api/ParallelCluster.openapi.yaml
208218
CreateApiUserRole: False
209219
EnableIamAdminAccess: True

0 commit comments

Comments
 (0)