create_resource_policy
async
¶
create_resource_policy(
resource_arn: AmazonResourceName,
policy: Policy,
*,
config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
) -> CreateResourcePolicyResponse
Creates a new resource policy with the specified policy statements.
Parameters:
-
resource_arn(AmazonResourceName) –The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
-
policy(Policy) –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.
Raises:
-
InternalServerException–The service encountered an unexpected condition. Try your request again.
-
PreconditionFailedException–Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.
-
ResourceNotFoundException–You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.
-
ServiceQuotaExceededException–You have reached a quota for your bot.
-
ThrottlingException–Your request rate is too high. Reduce the frequency of requests.
-
ValidationException–One of the input parameters in your request isn't valid. Check the parameters and try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.