Skip to content

/AWS1/CL_ORG=>CREATEPOLICY()

About CreatePolicy

Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual Amazon Web Services account.

For more information about policies and their use, see Managing Organizations policies.

If the request includes tags, then the requester must have the organizations:TagResource permission.

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.

Method Signature

IMPORTING

Required arguments:

IV_CONTENT TYPE /AWS1/ORGPOLICYCONTENT /AWS1/ORGPOLICYCONTENT

The policy text content to add to the new policy. The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.

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.

IV_DESCRIPTION TYPE /AWS1/ORGPOLICYDESCRIPTION /AWS1/ORGPOLICYDESCRIPTION

An optional description to assign to the policy.

IV_NAME TYPE /AWS1/ORGPOLICYNAME /AWS1/ORGPOLICYNAME

The friendly name to assign to 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.

IV_TYPE TYPE /AWS1/ORGPOLICYTYPE /AWS1/ORGPOLICYTYPE

The type of policy to create. You can specify one of the following values:

Optional arguments:

IT_TAGS TYPE /AWS1/CL_ORGTAG=>TT_TAGS TT_TAGS

A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null. For more information about tagging, see Tagging Organizations resources in the Organizations User Guide.

If any one of the tags is not valid or if you exceed the allowed number of tags for a policy, then the entire request fails and the policy is not created.

RETURNING

OO_OUTPUT TYPE REF TO /AWS1/CL_ORGCREATEPOLICYRSP /AWS1/CL_ORGCREATEPOLICYRSP