Skip to content

Create Resource Policy Statement

lexmodelsv2_create_resource_policy_statement R Documentation

Adds a new resource policy statement to a bot or bot alias

Description

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't create a resource policy statement that allows cross-account access.

You need to add the create_resource_policy or update_resource_policy action to the bot role in order to call the API.

Usage

lexmodelsv2_create_resource_policy_statement(resourceArn, statementId,
  effect, principal, action, condition, expectedRevisionId)

Arguments

resourceArn

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

statementId

[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.

effect

[required] Determines whether the statement allows or denies access to the resource.

principal

[required] An IAM principal, such as an IAM user, IAM role, or Amazon Web Services services that is allowed or denied access to a resource. For more information, see Amazon Web Services JSON policy elements: Principal.

action

[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.

condition

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 .

expectedRevisionId

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.

Value

A list with the following syntax:

list(
  resourceArn = "string",
  revisionId = "string"
)

Request syntax

svc$create_resource_policy_statement(
  resourceArn = "string",
  statementId = "string",
  effect = "Allow"|"Deny",
  principal = list(
    list(
      service = "string",
      arn = "string"
    )
  ),
  action = list(
    "string"
  ),
  condition = list(
    list(
      "string"
    )
  ),
  expectedRevisionId = "string"
)