libZSservicesZSamazonka-iamZSamazonka-iam
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.IAM.CreatePolicyVersion

Description

Creates a new version of the specified managed policy. To update a managed policy, you create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must delete an existing version using DeletePolicyVersion before you create a new version.

Optionally, you can set the new version as the policy's default version. The default version is the version that is in effect for the IAM users, groups, and roles to which the policy is attached.

For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

Synopsis

Creating a Request

data CreatePolicyVersion Source #

See: newCreatePolicyVersion smart constructor.

Constructors

CreatePolicyVersion' 

Fields

  • setAsDefault :: Maybe Bool

    Specifies whether to set this version as the policy's default version.

    When this parameter is true, the new policy version becomes the operative version. That is, it becomes the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

    For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

  • policyArn :: Text

    The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

    For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

  • policyDocument :: Text

    The JSON policy document that you want to use as the content for this new version of the policy.

    You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.

    The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas.

    The regex pattern used to validate this parameter is a string of characters consisting of the following:

    • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
    • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
    • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

Instances

Instances details
Eq CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Read CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Show CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Generic CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersion :: Type -> Type #

NFData CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Methods

rnf :: CreatePolicyVersion -> () #

Hashable CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

AWSRequest CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Associated Types

type AWSResponse CreatePolicyVersion #

ToHeaders CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

ToPath CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

ToQuery CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

type Rep CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

type Rep CreatePolicyVersion = D1 ('MetaData "CreatePolicyVersion" "Amazonka.IAM.CreatePolicyVersion" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "CreatePolicyVersion'" 'PrefixI 'True) (S1 ('MetaSel ('Just "setAsDefault") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "policyArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyDocument") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse CreatePolicyVersion Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

newCreatePolicyVersion Source #

Create a value of CreatePolicyVersion 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:

$sel:setAsDefault:CreatePolicyVersion', createPolicyVersion_setAsDefault - Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version. That is, it becomes the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

$sel:policyArn:CreatePolicyVersion', createPolicyVersion_policyArn - The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

$sel:policyDocument:CreatePolicyVersion', createPolicyVersion_policyDocument - The JSON policy document that you want to use as the content for this new version of the policy.

You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.

The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas.

The regex pattern used to validate this parameter is a string of characters consisting of the following:

  • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
  • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
  • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

Request Lenses

createPolicyVersion_setAsDefault :: Lens' CreatePolicyVersion (Maybe Bool) Source #

Specifies whether to set this version as the policy's default version.

When this parameter is true, the new policy version becomes the operative version. That is, it becomes the version that is in effect for the IAM users, groups, and roles that the policy is attached to.

For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

createPolicyVersion_policyArn :: Lens' CreatePolicyVersion Text Source #

The Amazon Resource Name (ARN) of the IAM policy to which you want to add a new version.

For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

createPolicyVersion_policyDocument :: Lens' CreatePolicyVersion Text Source #

The JSON policy document that you want to use as the content for this new version of the policy.

You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.

The maximum length of the policy document that you can pass in this operation, including whitespace, is listed below. To view the maximum character counts of a managed policy with no whitespaces, see IAM and STS character quotas.

The regex pattern used to validate this parameter is a string of characters consisting of the following:

  • Any printable ASCII character ranging from the space character (\u0020) through the end of the ASCII character range
  • The printable characters in the Basic Latin and Latin-1 Supplement character set (through \u00FF)
  • The special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D)

Destructuring the Response

data CreatePolicyVersionResponse Source #

Contains the response to a successful CreatePolicyVersion request.

See: newCreatePolicyVersionResponse smart constructor.

Constructors

CreatePolicyVersionResponse' 

Fields

Instances

Instances details
Eq CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Read CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Show CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Generic CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

Associated Types

type Rep CreatePolicyVersionResponse :: Type -> Type #

NFData CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

type Rep CreatePolicyVersionResponse Source # 
Instance details

Defined in Amazonka.IAM.CreatePolicyVersion

type Rep CreatePolicyVersionResponse = D1 ('MetaData "CreatePolicyVersionResponse" "Amazonka.IAM.CreatePolicyVersion" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "CreatePolicyVersionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policyVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe PolicyVersion)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreatePolicyVersionResponse Source #

Create a value of CreatePolicyVersionResponse 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:

$sel:policyVersion:CreatePolicyVersionResponse', createPolicyVersionResponse_policyVersion - A structure containing details about the new policy version.

$sel:httpStatus:CreatePolicyVersionResponse', createPolicyVersionResponse_httpStatus - The response's http status code.

Response Lenses

createPolicyVersionResponse_policyVersion :: Lens' CreatePolicyVersionResponse (Maybe PolicyVersion) Source #

A structure containing details about the new policy version.