paws.management (version 0.1.0)

organizations_update_policy: Updates an existing policy with a new name, description, or content

Description

Updates an existing policy with a new name, description, or content. If any parameter is not supplied, that value remains unchanged. Note that you cannot change a policy's type.

Usage

organizations_update_policy(PolicyId, Name, Description, Content)

Arguments

PolicyId

[required] The unique identifier (ID) of the policy that you want to update.

The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.

Name

If provided, the new name for the policy.

The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.

Description

If provided, the new description for the policy.

Content

If provided, the new content for the policy. The text must be correctly formatted JSON that complies with the syntax for the policy's type. For more information, see Service Control Policy Syntax in the AWS Organizations User Guide.

Request syntax

svc$update_policy(
  PolicyId = "string",
  Name = "string",
  Description = "string",
  Content = "string"
)

Details

This operation can be called only from the organization's master account.

Examples

Run this code
# NOT RUN {
# The following example shows how to rename a policy and give it a new
# description and new content. The output confirms the new name and
# description text:/n/n
# }
# NOT RUN {
svc$update_policy(
  Description = "This description replaces the original.",
  Name = "Renamed-Policy",
  PolicyId = "p-examplepolicyid111"
)
# }
# NOT RUN {
# The following example shows how to replace the JSON text of the SCP from
# the preceding example with a new JSON policy text string that allows S3
# actions instead of EC2 actions:/n/n
# }
# NOT RUN {
svc$update_policy(
  Content = "{ \\\"Version\\\": \\\"2012-10-17\\\", \\\"Statement\\\": {\\\"Effect\\\": ...",
  PolicyId = "p-examplepolicyid111"
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab