Skip to content

The final policy size is bigger than the limit #40

Description

@amoghesturi

I am using the following configuration and receiving error

custom:
  configFile: ${file(./config/${self:provider.stage}.yml)}
  stage: ${opt:stage, self:provider.stage}
  domains:
    production: ${self:custom.configFile.DOMAIN}
    development: ${self:custom.configFile.DOMAIN}
    qa: ${self:custom.configFile.DOMAIN}
  customDomain:
    domainName: ${self:custom.domains.${self:custom.stage}}
    basePath: dummyPath
    createRoute53Record: true
    endpointType: 'regional'
    stage: ${self:provider.stage}
  serverless-layers:
    - common:
        layersDeploymentBucket: 'platform-${self:provider.stage}-${self:provider.region}'
        dependenciesPath: ./package.json
        compatibleRuntimes: ["nodejs14.x"]
  region: ${self:custom.configFile.REGION, 'ap-south-1'}
  logSubscription:
    enabled: ${self:custom.configFile.LOG_AGGREGATION, true}
    destinationArn: ${self:custom.configFile.LOG_STREAM} // Pointing to 

provider:
  iam:
    role:
      managedPolicies:
        - arn:aws:iam::#{AWS::AccountId}:policy/platform_${self:provider.stage}
        - arn:aws:iam::aws:policy/AmazonAPIGatewayInvokeFullAccess
        - arn:aws:iam::aws:policy/AmazonAPIGatewayAdministrator
        - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
        - arn:aws:iam::aws:policy/AWSLambda_FullAccess
        - arn:aws:iam::aws:policy/AmazonSESFullAccess
  deploymentBucket:
    name: com.serverless.${self:provider.stage}.${self:provider.region}.deploys

We have more than 15 rest API functions deployed through this and we are receiving the following error

An error occurred: FunctionNameLogLambdaPermission - The final policy size (20798) is bigger than the limit (20480). (Service: AWSLambda; Status Code: 400; Error Code: PolicyLengthExceededException; Request ID: <>; Proxy: null).

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