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

Description Usage Arguments Value Request syntax Examples

View source: R/organizations_operations.R

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.

Usage

1
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 Service Control Policy Syntax in the AWS Organizations User Guide.

Value

A list with the following syntax:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

1
2
3
4
5
6
svc$update_policy(
  PolicyId = "string",
  Name = "string",
  Description = "string",
  Content = "string"
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

paws.management documentation built on March 8, 2021, 1:07 a.m.