Creates a new managed policy for your Amazon Web Services account.
This operation creates a policy version with a version identifier of v1
and sets v1 as the policy's default version. For more information about policy versions,
see Versioning for managed policies in the
IAM User Guide.
As a best practice, you can validate your IAM policies.
To learn more, see Validating IAM policies
in the IAM User Guide.
The request was rejected because multiple requests to change this object were submitted
simultaneously. Wait a few minutes and submit your request again.
The request was rejected because it attempted to create resources beyond the current
Amazon Web Services account limits. The error message describes the limit exceeded.
Creates a new managed policy for your Amazon Web Services account.
This operation creates a policy version with a version identifier of
v1
and sets v1 as the policy's default version. For more information about policy versions, see Versioning for managed policies in the IAM User Guide.As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide.
For more information about managed policies in general, see Managed policies and inline policies in the IAM User Guide.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreatePolicyCommandInput
Returns
CreatePolicyCommandOutput
See
input
shape.response
shape.config
shape.Throws
ConcurrentModificationException (client fault)
The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.
Throws
EntityAlreadyExistsException (client fault)
The request was rejected because it attempted to create a resource that already exists.
Throws
InvalidInputException (client fault)
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
Throws
LimitExceededException (client fault)
The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
Throws
MalformedPolicyDocumentException (client fault)
The request was rejected because the policy document was malformed. The error message describes the specific error.
Throws
ServiceFailureException (server fault)
The request processing has failed because of an unknown error, exception or failure.