Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
Synopsis
- data CreateResourcePolicyStatement = CreateResourcePolicyStatement' {}
- newCreateResourcePolicyStatement :: Text -> Text -> Effect -> CreateResourcePolicyStatement
- createResourcePolicyStatement_condition :: Lens' CreateResourcePolicyStatement (Maybe (HashMap Text (HashMap Text Text)))
- createResourcePolicyStatement_expectedRevisionId :: Lens' CreateResourcePolicyStatement (Maybe Text)
- createResourcePolicyStatement_resourceArn :: Lens' CreateResourcePolicyStatement Text
- createResourcePolicyStatement_statementId :: Lens' CreateResourcePolicyStatement Text
- createResourcePolicyStatement_effect :: Lens' CreateResourcePolicyStatement Effect
- createResourcePolicyStatement_principal :: Lens' CreateResourcePolicyStatement [Principal]
- createResourcePolicyStatement_action :: Lens' CreateResourcePolicyStatement [Text]
- data CreateResourcePolicyStatementResponse = CreateResourcePolicyStatementResponse' {
- resourceArn :: Maybe Text
- revisionId :: Maybe Text
- httpStatus :: Int
- newCreateResourcePolicyStatementResponse :: Int -> CreateResourcePolicyStatementResponse
- createResourcePolicyStatementResponse_resourceArn :: Lens' CreateResourcePolicyStatementResponse (Maybe Text)
- createResourcePolicyStatementResponse_revisionId :: Lens' CreateResourcePolicyStatementResponse (Maybe Text)
- createResourcePolicyStatementResponse_httpStatus :: Lens' CreateResourcePolicyStatementResponse Int
Creating a Request
data CreateResourcePolicyStatement Source #
See: newCreateResourcePolicyStatement
smart constructor.
CreateResourcePolicyStatement' | |
|
Instances
newCreateResourcePolicyStatement Source #
:: Text | |
-> Text | |
-> Effect | |
-> CreateResourcePolicyStatement |
Create a value of CreateResourcePolicyStatement
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateResourcePolicyStatement
, createResourcePolicyStatement_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 .
$sel:expectedRevisionId:CreateResourcePolicyStatement'
, createResourcePolicyStatement_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.
CreateResourcePolicyStatement
, createResourcePolicyStatement_resourceArn
- The Amazon Resource Name (ARN) of the bot or bot alias that the resource
policy is attached to.
$sel:statementId:CreateResourcePolicyStatement'
, createResourcePolicyStatement_statementId
- 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.
$sel:effect:CreateResourcePolicyStatement'
, createResourcePolicyStatement_effect
- Determines whether the statement allows or denies access to the
resource.
$sel:principal:CreateResourcePolicyStatement'
, createResourcePolicyStatement_principal
- 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.
$sel:action:CreateResourcePolicyStatement'
, createResourcePolicyStatement_action
- 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.
Request Lenses
createResourcePolicyStatement_condition :: Lens' CreateResourcePolicyStatement (Maybe (HashMap Text (HashMap Text Text))) Source #
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 .
createResourcePolicyStatement_expectedRevisionId :: Lens' CreateResourcePolicyStatement (Maybe Text) Source #
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.
createResourcePolicyStatement_resourceArn :: Lens' CreateResourcePolicyStatement Text Source #
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
createResourcePolicyStatement_statementId :: Lens' CreateResourcePolicyStatement Text Source #
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.
createResourcePolicyStatement_effect :: Lens' CreateResourcePolicyStatement Effect Source #
Determines whether the statement allows or denies access to the resource.
createResourcePolicyStatement_principal :: Lens' CreateResourcePolicyStatement [Principal] Source #
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.
createResourcePolicyStatement_action :: Lens' CreateResourcePolicyStatement [Text] Source #
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.
Destructuring the Response
data CreateResourcePolicyStatementResponse Source #
See: newCreateResourcePolicyStatementResponse
smart constructor.
CreateResourcePolicyStatementResponse' | |
|
Instances
newCreateResourcePolicyStatementResponse Source #
Create a value of CreateResourcePolicyStatementResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateResourcePolicyStatement
, createResourcePolicyStatementResponse_resourceArn
- The Amazon Resource Name (ARN) of the bot or bot alias that the resource
policy is attached to.
$sel:revisionId:CreateResourcePolicyStatementResponse'
, createResourcePolicyStatementResponse_revisionId
- 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.
$sel:httpStatus:CreateResourcePolicyStatementResponse'
, createResourcePolicyStatementResponse_httpStatus
- The response's http status code.
Response Lenses
createResourcePolicyStatementResponse_resourceArn :: Lens' CreateResourcePolicyStatementResponse (Maybe Text) Source #
The Amazon Resource Name (ARN) of the bot or bot alias that the resource policy is attached to.
createResourcePolicyStatementResponse_revisionId :: Lens' CreateResourcePolicyStatementResponse (Maybe Text) Source #
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.
createResourcePolicyStatementResponse_httpStatus :: Lens' CreateResourcePolicyStatementResponse Int Source #
The response's http status code.