Lambda / Client / get_public_access_block_config

get_public_access_block_config#

Lambda.Client.get_public_access_block_config(**kwargs)#

Note

The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won’t be available in all Amazon Web Services Regions until September 30, 2024.

Retrieve the public-access settings for a function.

See also: AWS API Documentation

Request Syntax

response = client.get_public_access_block_config(
    ResourceArn='string'
)
Parameters:

ResourceArn (string) –

[REQUIRED]

The Amazon Resource Name (ARN) of the function you want to retrieve public-access settings for.

Return type:

dict

Returns:

Response Syntax

{
    'PublicAccessBlockConfig': {
        'BlockPublicPolicy': True|False,
        'RestrictPublicResource': True|False
    }
}

Response Structure

  • (dict) –

    • PublicAccessBlockConfig (dict) –

      The public-access settings configured for the function you specified

      • BlockPublicPolicy (boolean) –

        To block the creation of resource-based policies that would grant public access to your function, set BlockPublicPolicy to true. To allow the creation of resource-based policies that would grant public access to your function, set BlockPublicPolicy to false.

      • RestrictPublicResource (boolean) –

        To block public access to your function, even if its resource-based policy allows it, set RestrictPublicResource to true. To allow public access to a function with a resource-based policy that permits it, set RestrictPublicResource to false.

Exceptions

  • Lambda.Client.exceptions.ServiceException

  • Lambda.Client.exceptions.ResourceNotFoundException

  • Lambda.Client.exceptions.TooManyRequestsException

  • Lambda.Client.exceptions.InvalidParameterValueException