Skip to content

Yaml CFN VS. Mixed CFN in Yaml with inline JSON #387

@kisst

Description

@kisst

Current behaviour is that for json policy documents are kept in json with either | or just inline.
For example current:

    IAMRole:
        Type: "AWS::IAM::Role"
        Properties:
            Path: "/"
            RoleName: "BedrockStudioProvisioningRole"
            AssumeRolePolicyDocument: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"datazone.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}"
            MaxSessionDuration: 3600

or if the policy is too big then:

    IAMPolicy2:
       Type: "AWS::IAM::Policy"
       Properties:
           PolicyDocument: |
               {
                 "Version": "2012-10-17",
                 "Statement": [
                   {
...
etc

Neither above are pretty, a consistent native yaml would be at least my preference so even if this wouldn't be the default, at least a flag would be great.
for example:

ype: AWS::IAM::Role
Properties:
  RoleName: BedrockStudioServiceRole
  AssumeRolePolicyDocument:
    Version: '2012-10-17'
    Statement:
      - Effect: Allow
        Principal:
          Service: datazone.amazonaws.com
        Action: sts:AssumeRole
  Policies:
    - PolicyName: BedrockStudioServiceRolePolicy
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - bedrock:*
              - iam:PassRole
            Resource: '*'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions