Last chance! 50% off unlimited learning
Sale ends in
Updates an existing policy with a new name, description, or content. If you don\'t supply any parameter, that value remains unchanged. You can\'t change a policy\'s type.
organizations_update_policy(PolicyId, Name, Description, Content)
[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 lowercase or uppercase letters, digits, or the underscore character (\_).
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.
If provided, the new description for the policy.
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.
svc$update_policy( PolicyId = "string", Name = "string", Description = "string", Content = "string" )
This operation can be called only from the organization\'s master account.
# 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
svc$update_policy(
Description = "This description replaces the original.",
Name = "Renamed-Policy",
PolicyId = "p-examplepolicyid111"
)
# 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
svc$update_policy(
Content = "{ \\\"Version\\\": \\\"2012-10-17\\\", \\\"Statement\\\": {\\\"Effect\\\": ...",
PolicyId = "p-examplepolicyid111"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab