Skip to content

Commit 798f9c7

Browse files
committed
[Policies] Group storage policies and SSM policies to reduce the number of policies attached to the PCUI lambda role.
This change is required to leave space for future policies since the maximum number of attachable policies is 10.
1 parent fbd8925 commit 798f9c7

File tree

1 file changed

+9
-33
lines changed

1 file changed

+9
-33
lines changed

infrastructure/parallelcluster-ui.yaml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -855,19 +855,16 @@ Resources:
855855
# Required for Lambda logging and XRay
856856
- !Sub arn:${AWS::Partition}:iam::aws:policy/AWSXRayDaemonWriteAccess
857857
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
858-
# Access to the ParllelCluster API
858+
# Access to the ParallelCluster API
859859
- !Ref ParallelClusterApiGatewayInvoke
860860
# Required to run ParallelClusterUI functionalities
861861
- !Ref CognitoPolicy
862862
- !Ref EC2Policy
863-
- !Ref DescribeFsxPolicy
864-
- !Ref DescribeEfsPolicy
863+
- !Ref StoragePolicy
865864
- !Ref CostMonitoringAndPricingPolicy
866-
- !Ref SsmSendPolicy
867-
- !Ref SsmGetCommandInvocationPolicy
865+
- !Ref SsmPolicy
868866
PermissionsBoundary: !If [UsePermissionBoundary, !Ref PermissionsBoundaryPolicy, !Ref 'AWS::NoValue']
869867

870-
871868
ParallelClusterUIApiGatewayInvoke:
872869
Type: AWS::Lambda::Permission
873870
Properties:
@@ -973,11 +970,11 @@ Resources:
973970
Sid: PrivateDeploymentReadPolicy
974971
- !Ref AWS::NoValue
975972

976-
DescribeFsxPolicy:
973+
StoragePolicy:
977974
Type: AWS::IAM::ManagedPolicy
978975
Properties:
979976
ManagedPolicyName: !Sub
980-
- ${IAMRoleAndPolicyPrefix}DescribeFsxPolicy-${StackIdSuffix}
977+
- ${IAMRoleAndPolicyPrefix}StoragePolicy-${StackIdSuffix}
981978
- { StackIdSuffix: !Select [ 0, !Split [ '-', !Select [ 2, !Split [ '/', !Ref 'AWS::StackId' ] ] ] ] }
982979
PolicyDocument:
983980
Version: '2012-10-17'
@@ -991,23 +988,13 @@ Resources:
991988
- !Sub arn:${AWS::Partition}:fsx:*:${AWS::AccountId}:file-system/*
992989
- !Sub arn:${AWS::Partition}:fsx:*:${AWS::AccountId}:file-cache/*
993990
Effect: Allow
994-
Sid: FsxPolicy
995-
996-
DescribeEfsPolicy:
997-
Type: AWS::IAM::ManagedPolicy
998-
Properties:
999-
ManagedPolicyName: !Sub
1000-
- ${IAMRoleAndPolicyPrefix}DescribeEfsPolicy-${StackIdSuffix}
1001-
- { StackIdSuffix: !Select [ 0, !Split [ '-', !Select [ 2, !Split [ '/', !Ref 'AWS::StackId' ] ] ] ] }
1002-
PolicyDocument:
1003-
Version: '2012-10-17'
1004-
Statement:
991+
Sid: FsxRead
1005992
- Action:
1006993
- elasticfilesystem:DescribeFileSystems
1007994
Resource:
1008995
- !Sub arn:${AWS::Partition}:elasticfilesystem:*:${AWS::AccountId}:file-system/*
1009996
Effect: Allow
1010-
Sid: EfsPolicy
997+
Sid: EfsRead
1011998

1012999
CostMonitoringAndPricingPolicy:
10131000
Type: AWS::IAM::ManagedPolicy
@@ -1036,12 +1023,11 @@ Resources:
10361023
Effect: Allow
10371024
Sid: PricingPolicy
10381025

1039-
1040-
SsmSendPolicy:
1026+
SsmPolicy:
10411027
Type: AWS::IAM::ManagedPolicy
10421028
Properties:
10431029
ManagedPolicyName: !Sub
1044-
- ${IAMRoleAndPolicyPrefix}SsmSendPolicy-${StackIdSuffix}
1030+
- ${IAMRoleAndPolicyPrefix}SsmPolicy-${StackIdSuffix}
10451031
- { StackIdSuffix: !Select [ 0, !Split [ '-', !Select [ 2, !Split [ '/', !Ref 'AWS::StackId' ] ] ] ] }
10461032
PolicyDocument:
10471033
Version: '2012-10-17'
@@ -1061,16 +1047,6 @@ Resources:
10611047
- !Sub arn:${AWS::Partition}:ssm:*::document/AWS-RunShellScript
10621048
Effect: Allow
10631049
Sid: SsmSendPolicyCommand
1064-
1065-
SsmGetCommandInvocationPolicy:
1066-
Type: AWS::IAM::ManagedPolicy
1067-
Properties:
1068-
ManagedPolicyName: !Sub
1069-
- ${IAMRoleAndPolicyPrefix}SsmGetCommandInvocationPolicy-${StackIdSuffix}
1070-
- { StackIdSuffix: !Select [ 0, !Split [ '-', !Select [ 2, !Split [ '/', !Ref 'AWS::StackId' ] ] ] ] }
1071-
PolicyDocument:
1072-
Version: '2012-10-17'
1073-
Statement:
10741050
- Action:
10751051
- ssm:GetCommandInvocation
10761052
Resource:

0 commit comments

Comments
 (0)