Skip to content

Update Policy

organizations_update_policy R Documentation

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

Description

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.

This operation can be called only from the organization's management account or by a member account that is a delegated administrator for an Amazon Web Services service.

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 lowercase or uppercase letters, digits, or the underscore character (_).

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 SCP syntax in the Organizations User Guide.

The maximum size of a policy document depends on the policy's type. For more information, see Maximum and minimum values in the Organizations User Guide.

Value

A list with the following syntax:

list(
  Policy = list(
    PolicySummary = list(
      Id = "string",
      Arn = "string",
      Name = "string",
      Description = "string",
      Type = "SERVICE_CONTROL_POLICY"|"TAG_POLICY"|"BACKUP_POLICY"|"AISERVICES_OPT_OUT_POLICY",
      AwsManaged = TRUE|FALSE
    ),
    Content = "string"
  )
)

Request syntax

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

Examples

## 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\": \"Allow\", \"A...",
  PolicyId = "p-examplepolicyid111"
)

## End(Not run)