LexModelsV2 / Client / create_resource_policy

create_resource_policy#

LexModelsV2.Client.create_resource_policy(**kwargs)#

Creates a new resource policy with the specified policy statements.

See also: AWS API Documentation

Request Syntax

response = client.create_resource_policy(
    resourceArn='string',
    policy='string'
)
Parameters:
  • resourceArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.

  • policy (string) –

    [REQUIRED]

    A resource policy to add to the resource. The policy is a JSON structure that contains one or more statements that define the policy. The policy must follow the IAM syntax. For more information about the contents of a JSON policy document, see IAM JSON policy reference.

    If the policy isn’t valid, Amazon Lex returns a validation exception.

Return type:

dict

Returns:

Response Syntax

{
    'resourceArn': 'string',
    'revisionId': 'string'
}

Response Structure

  • (dict) –

    • resourceArn (string) –

      The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy was attached to.

    • revisionId (string) –

      The current revision of the resource policy. Use the revision ID to make sure that you are updating the most current version of a resource policy when you add a policy statement to a resource, delete a resource, or update a resource.

Exceptions

  • LexModelsV2.Client.exceptions.ResourceNotFoundException

  • LexModelsV2.Client.exceptions.ServiceQuotaExceededException

  • LexModelsV2.Client.exceptions.PreconditionFailedException

  • LexModelsV2.Client.exceptions.ValidationException

  • LexModelsV2.Client.exceptions.InternalServerException

  • LexModelsV2.Client.exceptions.ThrottlingException