Skip to content

(module name): short issue description #16256

@lkoniecz

Description

@lkoniecz

Reproduction Steps

bucket = aws_s3.Bucket(
    scope=self,
    id='bucket'
    bucket_name=bucket
)

user = aws_iam.User.from_user_arn(
    scope=self,
    id='FeatureUser',
    user_arn=arn:aws:iam::<my-account>:user/cfs/us-east-1/iam-FeatureConfigUser-EOJ4HFI3OAZ4
)

please note that path is non empty
Following snippet generates:

  FeatureUserPolicy82BF0C1A:
    Type: AWS::IAM::Policy
    Properties:
      PolicyDocument:
        Statement:
          - Action:
              - s3:GetObject*
              - s3:GetBucket*
              - s3:List*
            Effect: Allow
            Resource:
              - Fn::GetAtt:
                  - ConfigIntegrationstarchestsconfigs2AECC85D
                  - Arn
              - Fn::Join:
                  - ""
                  - - Fn::GetAtt:
                        - ConfigIntegrationstarchestsconfigs2AECC85D
                        - Arn
                    - /*
        Version: "2012-10-17"
      PolicyName: FeatureUserPolicy82BF0C1A
      Users:
        - cfs/us-east-1/iam-FeatureConfigUser-EOJ4HFI3OAZ4

fails with

The specified value for userName is invalid. It must contain only alphanumeric characters and/or the following: +=,.@_- (Service: AmazonIdentityManagement; Status Code: 400; Error Code: ValidationError;

What did you expect to happen?

Generates policy strips the path part as the user name is unique anyway

Environment

  • **CDK CLI Version : 1.110.1
  • Framework Version:
  • Node.js Version: all
  • **OS : all
  • Language (Version): all

This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions