Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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
- data CreatePolicyVersion = CreatePolicyVersion' {
- setAsDefault :: Maybe Bool
- policyArn :: Text
- policyDocument :: Text
- newCreatePolicyVersion :: Text -> Text -> CreatePolicyVersion
- createPolicyVersion_setAsDefault :: Lens' CreatePolicyVersion (Maybe Bool)
- createPolicyVersion_policyArn :: Lens' CreatePolicyVersion Text
- createPolicyVersion_policyDocument :: Lens' CreatePolicyVersion Text
- data CreatePolicyVersionResponse = CreatePolicyVersionResponse' {}
- newCreatePolicyVersionResponse :: Int -> CreatePolicyVersionResponse
- createPolicyVersionResponse_policyVersion :: Lens' CreatePolicyVersionResponse (Maybe PolicyVersion)
- createPolicyVersionResponse_httpStatus :: Lens' CreatePolicyVersionResponse Int
Creating a Request
data CreatePolicyVersion Source #
See: newCreatePolicyVersion
smart constructor.
CreatePolicyVersion' | |
|
Instances
newCreatePolicyVersion Source #
:: Text | |
-> Text | |
-> CreatePolicyVersion |
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.
CreatePolicyVersionResponse' | |
|
Instances
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.
createPolicyVersionResponse_httpStatus :: Lens' CreatePolicyVersionResponse Int Source #
The response's http status code.