Skip to content

(IAM Role) : Maximum policy size of 10240 bytes exceeded for role #12403

@CodeEngineTechnology

Description

@CodeEngineTechnology

❓ General Issue

Hello,
I have an IAM role that has been working fine for my AWS CodePipeline (cdk deploy works without any problem) however when I add functional testing stage to my pipeline I get the following error :

Maximum policy size of 10240 bytes exceeded for role

          functionalStage = {
            stageName: 'FunctionalTest',
            actions: [
              new codepipelineActions.CodeBuildAction({
                actionName: 'Codebuild',
                project: functionalCodeBuild,
                input: build,
              }),
            ],
          };
          codePipeline.addStage(functionalStage);

I even created multiple smaller policies and attached them to my role but didn't help.

  const lambdaRole = new iam.Role(props.scope, `lambda-role`, {
    assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
    inlinePolicies: {
      codebuild: new iam.PolicyDocument({
        statements: [eventsLambdaAccessSSMPolicy, codeBuildPipelineCWPolicy, codecommitPolicy, s3AndLogsPolicy, lambdaPolicy],
      }),
    },
  });

Is this a known issue ?
Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.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