Skip to content

Commit b082880

Browse files
committed
[Infrastructure] Add EC2 permissions required by PCUI private deployment only when private deployment is enabled.
1 parent bd68173 commit b082880

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

infrastructure/parallelcluster-ui.yaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,11 +859,6 @@ Resources:
859859
- ec2:DescribeInstanceTypes
860860
- ec2:DescribeSubnets
861861
- ec2:DescribeKeyPairs
862-
- ec2:DescribeNetworkInterfaces
863-
- ec2:CreateNetworkInterface
864-
- ec2:DeleteNetworkInterface
865-
- ec2:DescribeInstances
866-
- ec2:AttachNetworkInterface
867862
Resource:
868863
- '*'
869864
Effect: Allow
@@ -878,6 +873,27 @@ Resources:
878873
ec2:ResourceTag/parallelcluster:version: "*"
879874
Effect: Allow
880875
Sid: EC2ManagePolicy
876+
- Fn::If:
877+
- IsPrivate
878+
- Action:
879+
- ec2:CreateNetworkInterface
880+
- ec2:DeleteNetworkInterface
881+
- ec2:AttachNetworkInterface
882+
Resource:
883+
- !Sub arn:${AWS::Partition}:ec2:${AWS::Region}:${AWS::AccountId}:*
884+
Effect: Allow
885+
Sid: PrivateDeploymentWritePolicy
886+
- !Ref AWS::NoValue
887+
- Fn::If:
888+
- IsPrivate
889+
- Action:
890+
- ec2:DescribeNetworkInterfaces
891+
- ec2:DescribeInstances
892+
Resource:
893+
- '*'
894+
Effect: Allow
895+
Sid: PrivateDeploymentReadPolicy
896+
- !Ref AWS::NoValue
881897

882898
DescribeFsxPolicy:
883899
Type: AWS::IAM::ManagedPolicy

0 commit comments

Comments
 (0)