update_resource_policy

LexModelsV2.Client.update_resource_policy(**kwargs)

Replaces the existing resource policy for a bot or bot alias with a new one. If the policy doesn't exist, Amazon Lex returns an exception.

See also: AWS API Documentation

Request Syntax

response = client.update_resource_policy(
    resourceArn='string',
    policy='string',
    expectedRevisionId='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.

  • expectedRevisionId (string) --

    The identifier of the revision of the policy to update. If this revision ID doesn't match the current revision ID, Amazon Lex throws an exception.

    If you don't specify a revision, Amazon Lex overwrites the contents of the policy with the new values.

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 is 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