amazonka-lexv2-models-2.0: Amazon Lex Model Building V2 SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.LexV2Models.CreateResourcePolicyStatement

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.

Synopsis

Creating a Request

data CreateResourcePolicyStatement Source #

See: newCreateResourcePolicyStatement smart constructor.

Constructors

CreateResourcePolicyStatement' 

Fields

  • condition :: Maybe (HashMap Text (HashMap Text Text))

    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 :: Maybe Text

    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.

  • resourceArn :: Text

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

  • statementId :: Text

    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 :: Effect

    Determines whether the statement allows or denies access to the resource.

  • principal :: [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.

  • action :: [Text]

    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.

Instances

Instances details
ToJSON CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

ToHeaders CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

ToPath CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

ToQuery CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

AWSRequest CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Generic CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Associated Types

type Rep CreateResourcePolicyStatement :: Type -> Type #

Read CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Show CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

NFData CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Eq CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Hashable CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

type AWSResponse CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

type Rep CreateResourcePolicyStatement Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

type Rep CreateResourcePolicyStatement = D1 ('MetaData "CreateResourcePolicyStatement" "Amazonka.LexV2Models.CreateResourcePolicyStatement" "amazonka-lexv2-models-2.0-5mExjJXBfuO6j0ascNcayE" 'False) (C1 ('MetaCons "CreateResourcePolicyStatement'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "condition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text (HashMap Text Text)))) :*: (S1 ('MetaSel ('Just "expectedRevisionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "resourceArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: ((S1 ('MetaSel ('Just "statementId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "effect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Effect)) :*: (S1 ('MetaSel ('Just "principal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Principal]) :*: S1 ('MetaSel ('Just "action") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text])))))

newCreateResourcePolicyStatement Source #

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 #

Constructors

CreateResourcePolicyStatementResponse' 

Fields

  • resourceArn :: Maybe Text

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

  • revisionId :: Maybe Text

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Read CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Show CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

NFData CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

Eq CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

type Rep CreateResourcePolicyStatementResponse Source # 
Instance details

Defined in Amazonka.LexV2Models.CreateResourcePolicyStatement

type Rep CreateResourcePolicyStatementResponse = D1 ('MetaData "CreateResourcePolicyStatementResponse" "Amazonka.LexV2Models.CreateResourcePolicyStatement" "amazonka-lexv2-models-2.0-5mExjJXBfuO6j0ascNcayE" 'False) (C1 ('MetaCons "CreateResourcePolicyStatementResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "resourceArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "revisionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.