File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1010
1111class AttachRolePoliciesStep implements Step
1212{
13+ protected array $ managedPolicies = [
14+ 'arn:aws:iam::aws:policy/AmazonElasticTranscoder_JobsSubmitter ' ,
15+ 'arn:aws:iam::aws:policy/IVSFullAccess ' ,
16+ ];
17+
1318 public function __invoke (array $ options ): StepResult
1419 {
1520 if (! Arr::get ($ options , 'dry-run ' )) {
@@ -21,10 +26,12 @@ public function __invoke(array $options): StepResult
2126 'PolicyArn ' => $ policy ['Arn ' ],
2227 ]);
2328
24- Aws::iam ()->attachRolePolicy ([
25- 'RoleName ' => $ role ['RoleName ' ],
26- 'PolicyArn ' => 'arn:aws:iam::aws:policy/AmazonElasticTranscoder_JobsSubmitter ' ,
27- ]);
29+ foreach ($ this ->managedPolicies as $ policyArn ) {
30+ Aws::iam ()->attachRolePolicy ([
31+ 'RoleName ' => $ role ['RoleName ' ],
32+ 'PolicyArn ' => $ policyArn ,
33+ ]);
34+ }
2835
2936 return StepResult::SYNCED ;
3037 }
You can’t perform that action at this time.
0 commit comments