Lambda / Client / exceptions / PublicPolicyException

PublicPolicyException

class Lambda.Client.exceptions.PublicPolicyException

The resource-based policy you tried to add to the Lambda function would grant public access to it, and your account’s BlockPublicAccess setting prevents public access. For more information about blocking public access to Lambda functions, see Block public access to Lambda resources.

Example

try:
  ...
except client.exceptions.PublicPolicyException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Type': 'string',
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) –

    The resource-based policy you tried to add to the Lambda function would grant public access to it, and your account’s BlockPublicAccess setting prevents public access. For more information about blocking public access to Lambda functions, see Block public access to Lambda resources.

    • Type (string) –

      The exception type.

    • Message (string) –

      The exception message.

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.