2021/05/20 - Amazon Lex Model Building V2 - 6 new api methods
Removes an existing policy from a bot or bot alias. If the resource doesn't have a policy attached, Amazon Lex returns an exception.
See also: AWS API Documentation
Request Syntax
client.delete_resource_policy( resourceArn='string', expectedRevisionId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that has the resource policy attached.
string
The identifier of the revision to edit. If this ID doesn't match the current revision number, Amazon Lex returns an exception
If you don't specify a revision ID, Amazon Lex will delete the current policy.
dict
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 deleted from.
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.
Creates a new resource policy with the specified policy statements.
See also: AWS API Documentation
Request Syntax
client.create_resource_policy( resourceArn='string', policy='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
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.
dict
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.
Deletes a policy statement from a resource policy. If you delete the last statement from a policy, the policy is deleted. If you specify a statement ID that doesn't exist in the policy, or if the bot or bot alias doesn't have a policy attached, Amazon Lex returns an exception.
See also: AWS API Documentation
Request Syntax
client.delete_resource_policy_statement( resourceArn='string', statementId='string', expectedRevisionId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
string
[REQUIRED]
The name of the statement (SID) to delete from the policy.
string
The identifier of the revision of the policy to delete the statement from. 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 removes the current contents of the statement.
dict
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 statement was removed from.
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.
Adds a new resource policy statement to a bot or bot alias. If a resource policy exists, the statement is added to the current resource policy. If a policy doesn't exist, a new policy is created.
You can create a resource policy statement that allows cross-account access.
See also: AWS API Documentation
Request Syntax
client.create_resource_policy_statement( resourceArn='string', statementId='string', effect='Allow'|'Deny', principal=[ { 'service': 'string', 'arn': 'string' }, ], action=[ 'string', ], condition={ 'string': { 'string': 'string' } }, expectedRevisionId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
string
[REQUIRED]
The name of the statement. The ID is the same as the Sid IAM property. The statement name must be unique within the policy. For more information, see IAM JSON policy elements: Sid.
string
[REQUIRED]
Determines whether the statement allows or denies access to the resource.
list
[REQUIRED]
An IAM principal, such as an IAM users, IAM roles, or AWS services that is allowed or denied access to a resource. For more information, see AWS JSON policy elements: Principal.
(dict) --
The IAM principal that you allowing or denying access to an Amazon Lex action. You must provide a service or an arn, but not both in the same statement. For more information, see AWS JSON policy elements: Principal.
service (string) --
The name of the AWS service that should allowed or denied access to an Amazon Lex action.
arn (string) --
The Amazon Resource Name (ARN) of the principal.
list
[REQUIRED]
The Amazon Lex action that this policy either allows or denies. The action must apply to the resource type of the specified ARN. For more information, see Actions, resources, and condition keys for Amazon Lex V2.
(string) --
dict
Specifies a condition when the policy is in effect. If the principal of the policy is a service principal, you must provide two condition blocks, one with a SourceAccount global condition key and one with a SourceArn global condition key.
For more information, see IAM JSON policy elements: Condition.
(string) --
(dict) --
(string) --
(string) --
string
The identifier of the revision of the policy to edit. 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.
dict
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.
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
client.update_resource_policy( resourceArn='string', policy='string', expectedRevisionId='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
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.
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.
dict
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.
Gets the resource policy and policy revision for a bot or bot alias.
See also: AWS API Documentation
Request Syntax
client.describe_resource_policy( resourceArn='string' )
string
[REQUIRED]
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
dict
Response Syntax
{ 'resourceArn': 'string', 'policy': '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.
policy (string) --
The JSON structure that contains the resource policy. For more information about the contents of a JSON policy document, see IAM JSON policy reference.
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.