aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

ForEach not able to create IAM Role policy #1864

Open Ankits19 opened 9 months ago

Ankits19 commented 9 months ago

Resource Name

'AWS::IAM::RolePolicy'

Details

I am trying to create one RolePolicy with multiple resources to be allowed (accepted as parameters from users as CommaDelimitedList.

It transforms not correct, and while creation of Policy it fails :(

I want my permission to be like:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1702056876959", "Action": "s3:*", "Effect": "Allow", "Resource": [ "arn:aws:s3:::bucket1", "arn:aws:s3:::bucket2" } ] }

`--- AWSTemplateFormatVersion: "2010-09-09" Transform: AWS::LanguageExtensions

Parameters: BucketList: Description: List of S3 buckets Type: CommaDelimitedList

Resources: VolumeRolePolicy: Type: 'AWS::IAM::RolePolicy' Properties: PolicyName: volume-policy PolicyDocument: Statement: