2020/06/24 - AWS Organizations - 11 updated api methods
Changes This release adds support for a new backup policy type for AWS Organizations.
{'Organization': {'AvailablePolicyTypes': {'Type': {'BACKUP_POLICY'}}}}
Creates an AWS organization. The account whose user is calling the CreateOrganization operation automatically becomes the master account of the new organization.
This operation must be called using credentials from the account that is to become the new organization's master account. The principal must also have the relevant IAM permissions.
By default (or if you set the FeatureSet parameter to ALL ), the new organization is created with all features enabled and service control policies automatically enabled in the root. If you instead choose to create the organization supporting only the consolidated billing features by setting the FeatureSet parameter to CONSOLIDATED_BILLING" , no policy types are enabled by default, and you can't use organization policies
See also: AWS API Documentation
Request Syntax
client.create_organization( FeatureSet='ALL'|'CONSOLIDATED_BILLING' )
string
Specifies the feature set supported by the new organization. Each feature set supports different levels of functionality.
CONSOLIDATED_BILLING : All member accounts have their bills consolidated to and paid by the master account. For more information, see Consolidated billing in the AWS Organizations User Guide. The consolidated billing feature subset isn't available for organizations in the AWS GovCloud (US) Region.
ALL : In addition to all the features supported by the consolidated billing feature set, the master account can also apply any policy type to any member account in the organization. For more information, see All features in the AWS Organizations User Guide.
dict
Response Syntax
{ 'Organization': { 'Id': 'string', 'Arn': 'string', 'FeatureSet': 'ALL'|'CONSOLIDATED_BILLING', 'MasterAccountArn': 'string', 'MasterAccountId': 'string', 'MasterAccountEmail': 'string', 'AvailablePolicyTypes': [ { 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE' }, ] } }
Response Structure
(dict) --
Organization (dict) --
A structure that contains details about the newly created organization.
Id (string) --
The unique identifier (ID) of an organization.
The regex pattern for an organization ID string requires "o-" followed by from 10 to 32 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of an organization.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
FeatureSet (string) --
Specifies the functionality that currently is available to the organization. If set to "ALL", then all features are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information, see Enabling All Features in Your Organization in the AWS Organizations User Guide .
MasterAccountArn (string) --
The Amazon Resource Name (ARN) of the account that is designated as the master account for the organization.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
MasterAccountId (string) --
The unique identifier (ID) of the master account of an organization.
The regex pattern for an account ID string requires exactly 12 digits.
MasterAccountEmail (string) --
The email address that is associated with the AWS account that is designated as the master account for the organization.
AvailablePolicyTypes (list) --
A list of policy types that are enabled for this organization. For example, if your organization has all features enabled, then service control policies (SCPs) are included in the list.
Note
Even if a policy type is shown as available in the organization, you can separately enable and disable them at the root level by using EnablePolicyType and DisablePolicyType . Use ListRoots to see the status of a policy type in that root.
(dict) --
Contains information about a policy type and its status in the associated root.
Type (string) --
The name of the policy type.
Status (string) --
The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.
{'Type': {'BACKUP_POLICY'}}Response
{'Policy': {'PolicySummary': {'Type': {'BACKUP_POLICY'}}}}
Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual AWS account.
For more information about policies and their use, see Managing Organization Policies .
This operation can be called only from the organization's master account.
See also: AWS API Documentation
Request Syntax
client.create_policy( Content='string', Description='string', Name='string', Type='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY' )
string
[REQUIRED]
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.
string
[REQUIRED]
An optional description to assign to the policy.
string
[REQUIRED]
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.
string
[REQUIRED]
The type of policy to create. You can specify one of the following values:
dict
Response Syntax
{ 'Policy': { 'PolicySummary': { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'Description': 'string', 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'AwsManaged': True|False }, 'Content': 'string' } }
Response Structure
(dict) --
Policy (dict) --
A structure that contains details about the newly created policy.
PolicySummary (dict) --
A structure that contains additional details about the policy.
Id (string) --
The unique identifier (ID) of the policy.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the policy.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of 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 (string) --
The description of the policy.
Type (string) --
The type of policy.
AwsManaged (boolean) --
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
Content (string) --
The text content of the policy.
{'PolicyType': {'BACKUP_POLICY'}}Response
{'EffectivePolicy': {'PolicyType': {'BACKUP_POLICY'}}}
Returns the contents of the effective policy for specified policy type and account. The effective policy is the aggregation of any policies of the specified type that the account inherits, plus any policy of that type that is directly attached to the account.
This operation applies only to policy types other than service control policies (SCPs).
For more information about policy inheritance, see How Policy Inheritance Works in the AWS Organizations User Guide .
This operation can be called only from the organization's master account or by a member account that is a delegated administrator for an AWS service.
See also: AWS API Documentation
Request Syntax
client.describe_effective_policy( PolicyType='TAG_POLICY'|'BACKUP_POLICY', TargetId='string' )
string
[REQUIRED]
The type of policy that you want information about. You can specify one of the following values:
string
When you're signed in as the master account, specify the ID of the account that you want details about. Specifying an organization root or organizational unit (OU) as the target is not supported.
dict
Response Syntax
{ 'EffectivePolicy': { 'PolicyContent': 'string', 'LastUpdatedTimestamp': datetime(2015, 1, 1), 'TargetId': 'string', 'PolicyType': 'TAG_POLICY'|'BACKUP_POLICY' } }
Response Structure
(dict) --
EffectivePolicy (dict) --
The contents of the effective policy.
PolicyContent (string) --
The text content of the policy.
LastUpdatedTimestamp (datetime) --
The time of the last update to this policy.
TargetId (string) --
The account ID of the policy target.
PolicyType (string) --
The policy type.
{'Organization': {'AvailablePolicyTypes': {'Type': {'BACKUP_POLICY'}}}}
Retrieves information about the organization that the user's account belongs to.
This operation can be called from any account in the organization.
Note
Even if a policy type is shown as available in the organization, you can disable it separately at the root level with DisablePolicyType . Use ListRoots to see the status of policy types for a specified root.
See also: AWS API Documentation
Request Syntax
client.describe_organization()
dict
Response Syntax
{ 'Organization': { 'Id': 'string', 'Arn': 'string', 'FeatureSet': 'ALL'|'CONSOLIDATED_BILLING', 'MasterAccountArn': 'string', 'MasterAccountId': 'string', 'MasterAccountEmail': 'string', 'AvailablePolicyTypes': [ { 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE' }, ] } }
Response Structure
(dict) --
Organization (dict) --
A structure that contains information about the organization.
Id (string) --
The unique identifier (ID) of an organization.
The regex pattern for an organization ID string requires "o-" followed by from 10 to 32 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of an organization.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
FeatureSet (string) --
Specifies the functionality that currently is available to the organization. If set to "ALL", then all features are enabled and policies can be applied to accounts in the organization. If set to "CONSOLIDATED_BILLING", then only consolidated billing functionality is available. For more information, see Enabling All Features in Your Organization in the AWS Organizations User Guide .
MasterAccountArn (string) --
The Amazon Resource Name (ARN) of the account that is designated as the master account for the organization.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
MasterAccountId (string) --
The unique identifier (ID) of the master account of an organization.
The regex pattern for an account ID string requires exactly 12 digits.
MasterAccountEmail (string) --
The email address that is associated with the AWS account that is designated as the master account for the organization.
AvailablePolicyTypes (list) --
A list of policy types that are enabled for this organization. For example, if your organization has all features enabled, then service control policies (SCPs) are included in the list.
Note
Even if a policy type is shown as available in the organization, you can separately enable and disable them at the root level by using EnablePolicyType and DisablePolicyType . Use ListRoots to see the status of a policy type in that root.
(dict) --
Contains information about a policy type and its status in the associated root.
Type (string) --
The name of the policy type.
Status (string) --
The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.
{'Policy': {'PolicySummary': {'Type': {'BACKUP_POLICY'}}}}
Retrieves information about a policy.
This operation can be called only from the organization's master account or by a member account that is a delegated administrator for an AWS service.
See also: AWS API Documentation
Request Syntax
client.describe_policy( PolicyId='string' )
string
[REQUIRED]
The unique identifier (ID) of the policy that you want details about. You can get the ID from the ListPolicies or ListPoliciesForTarget operations.
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 (_).
dict
Response Syntax
{ 'Policy': { 'PolicySummary': { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'Description': 'string', 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'AwsManaged': True|False }, 'Content': 'string' } }
Response Structure
(dict) --
Policy (dict) --
A structure that contains details about the specified policy.
PolicySummary (dict) --
A structure that contains additional details about the policy.
Id (string) --
The unique identifier (ID) of the policy.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the policy.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of 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 (string) --
The description of the policy.
Type (string) --
The type of policy.
AwsManaged (boolean) --
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
Content (string) --
The text content of the policy.
{'PolicyType': {'BACKUP_POLICY'}}Response
{'Root': {'PolicyTypes': {'Type': {'BACKUP_POLICY'}}}}
Disables an organizational policy type in a root. A policy of a certain type can be attached to entities in a root only if that type is enabled in the root. After you perform this operation, you no longer can attach policies of the specified type to that root or to any organizational unit (OU) or account in that root. You can undo this by using the EnablePolicyType operation.
This is an asynchronous request that AWS performs in the background. If you disable a policy type for a root, it still appears enabled for the organization if all features are enabled for the organization. AWS recommends that you first use ListRoots to see the status of policy types for a specified root, and then use this operation.
This operation can be called only from the organization's master account.
To view the status of available policy types in the organization, use DescribeOrganization .
See also: AWS API Documentation
Request Syntax
client.disable_policy_type( RootId='string', PolicyType='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY' )
string
[REQUIRED]
The unique identifier (ID) of the root in which you want to disable a policy type. You can get the ID from the ListRoots operation.
The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.
string
[REQUIRED]
The policy type that you want to disable in this root. You can specify one of the following values:
dict
Response Syntax
{ 'Root': { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'PolicyTypes': [ { 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE' }, ] } }
Response Structure
(dict) --
Root (dict) --
A structure that shows the root with the updated list of enabled policy types.
Id (string) --
The unique identifier (ID) for the root.
The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the root.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of the root.
The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.
PolicyTypes (list) --
The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.
Note
Even if a policy type is shown as available in the organization, you can separately enable and disable them at the root level by using EnablePolicyType and DisablePolicyType . Use DescribeOrganization to see the availability of the policy types in that organization.
(dict) --
Contains information about a policy type and its status in the associated root.
Type (string) --
The name of the policy type.
Status (string) --
The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.
{'PolicyType': {'BACKUP_POLICY'}}Response
{'Root': {'PolicyTypes': {'Type': {'BACKUP_POLICY'}}}}
Enables a policy type in a root. After you enable a policy type in a root, you can attach policies of that type to the root, any organizational unit (OU), or account in that root. You can undo this by using the DisablePolicyType operation.
This is an asynchronous request that AWS performs in the background. AWS recommends that you first use ListRoots to see the status of policy types for a specified root, and then use this operation.
This operation can be called only from the organization's master account.
You can enable a policy type in a root only if that policy type is available in the organization. To view the status of available policy types in the organization, use DescribeOrganization .
See also: AWS API Documentation
Request Syntax
client.enable_policy_type( RootId='string', PolicyType='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY' )
string
[REQUIRED]
The unique identifier (ID) of the root in which you want to enable a policy type. You can get the ID from the ListRoots operation.
The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase letters or digits.
string
[REQUIRED]
The policy type that you want to enable. You can specify one of the following values:
dict
Response Syntax
{ 'Root': { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'PolicyTypes': [ { 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE' }, ] } }
Response Structure
(dict) --
Root (dict) --
A structure that shows the root with the updated list of enabled policy types.
Id (string) --
The unique identifier (ID) for the root.
The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the root.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of the root.
The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.
PolicyTypes (list) --
The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.
Note
Even if a policy type is shown as available in the organization, you can separately enable and disable them at the root level by using EnablePolicyType and DisablePolicyType . Use DescribeOrganization to see the availability of the policy types in that organization.
(dict) --
Contains information about a policy type and its status in the associated root.
Type (string) --
The name of the policy type.
Status (string) --
The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.
{'Filter': {'BACKUP_POLICY'}}Response
{'Policies': {'Type': {'BACKUP_POLICY'}}}
Retrieves the list of all policies in an organization of a specified type.
Note
Always check the NextToken response parameter for a null value when calling a List* operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.
This operation can be called only from the organization's master account or by a member account that is a delegated administrator for an AWS service.
See also: AWS API Documentation
Request Syntax
client.list_policies( Filter='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', NextToken='string', MaxResults=123 )
string
[REQUIRED]
Specifies the type of policy that you want to include in the response. You must specify one of the following values:
string
The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.
integer
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.
dict
Response Syntax
{ 'Policies': [ { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'Description': 'string', 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'AwsManaged': True|False }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Policies (list) --
A list of policies that match the filter criteria in the request. The output list doesn't include the policy contents. To see the content for a policy, see DescribePolicy .
(dict) --
Contains information about a policy, but does not include the content. To see the content of a policy, see DescribePolicy .
Id (string) --
The unique identifier (ID) of the policy.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the policy.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of 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 (string) --
The description of the policy.
Type (string) --
The type of policy.
AwsManaged (boolean) --
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null .
{'Filter': {'BACKUP_POLICY'}}Response
{'Policies': {'Type': {'BACKUP_POLICY'}}}
Lists the policies that are directly attached to the specified target root, organizational unit (OU), or account. You must specify the policy type that you want included in the returned list.
Note
Always check the NextToken response parameter for a null value when calling a List* operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.
This operation can be called only from the organization's master account or by a member account that is a delegated administrator for an AWS service.
See also: AWS API Documentation
Request Syntax
client.list_policies_for_target( TargetId='string', Filter='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', NextToken='string', MaxResults=123 )
string
[REQUIRED]
The unique identifier (ID) of the root, organizational unit, or account whose policies you want to list.
The regex pattern for a target ID string requires one of the following:
Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits.
Account - A string that consists of exactly 12 digits.
Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.
string
[REQUIRED]
The type of policy that you want to include in the returned list. You must specify one of the following values:
string
The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.
integer
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.
dict
Response Syntax
{ 'Policies': [ { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'Description': 'string', 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'AwsManaged': True|False }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Policies (list) --
The list of policies that match the criteria in the request.
(dict) --
Contains information about a policy, but does not include the content. To see the content of a policy, see DescribePolicy .
Id (string) --
The unique identifier (ID) of the policy.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the policy.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of 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 (string) --
The description of the policy.
Type (string) --
The type of policy.
AwsManaged (boolean) --
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null .
{'Roots': {'PolicyTypes': {'Type': {'BACKUP_POLICY'}}}}
Lists the roots that are defined in the current organization.
Note
Always check the NextToken response parameter for a null value when calling a List* operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.
This operation can be called only from the organization's master account or by a member account that is a delegated administrator for an AWS service.
Note
Policy types can be enabled and disabled in roots. This is distinct from whether they're available in the organization. When you enable all features, you make policy types available for use in that organization. Individual policy types can then be enabled and disabled in a root. To see the availability of a policy type in an organization, use DescribeOrganization .
See also: AWS API Documentation
Request Syntax
client.list_roots( NextToken='string', MaxResults=123 )
string
The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value of the previous call's NextToken response to indicate where the output should continue from.
integer
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that Organizations might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.
dict
Response Syntax
{ 'Roots': [ { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'PolicyTypes': [ { 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Roots (list) --
A list of roots that are defined in an organization.
(dict) --
Contains details about a root. A root is a top-level parent node in the hierarchy of an organization that can contain organizational units (OUs) and accounts. Every root contains every AWS account in the organization. Each root enables the accounts to be organized in a different way and to have different policy types enabled for use in that root.
Id (string) --
The unique identifier (ID) for the root.
The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the root.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of the root.
The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range.
PolicyTypes (list) --
The types of policies that are currently enabled for the root and therefore can be attached to the root or to its OUs or accounts.
Note
Even if a policy type is shown as available in the organization, you can separately enable and disable them at the root level by using EnablePolicyType and DisablePolicyType . Use DescribeOrganization to see the availability of the policy types in that organization.
(dict) --
Contains information about a policy type and its status in the associated root.
Type (string) --
The name of the policy type.
Status (string) --
The status of the policy type as it relates to the associated root. To attach a policy of the specified type to a root or to an OU or account in that root, it must be available in the organization and enabled for that root.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null .
{'Policy': {'PolicySummary': {'Type': {'BACKUP_POLICY'}}}}
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 master account.
See also: AWS API Documentation
Request Syntax
client.update_policy( PolicyId='string', Name='string', Description='string', Content='string' )
string
[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 (_).
string
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.
string
If provided, the new description for the policy.
string
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.
dict
Response Syntax
{ 'Policy': { 'PolicySummary': { 'Id': 'string', 'Arn': 'string', 'Name': 'string', 'Description': 'string', 'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY', 'AwsManaged': True|False }, 'Content': 'string' } }
Response Structure
(dict) --
Policy (dict) --
A structure that contains details about the updated policy, showing the requested changes.
PolicySummary (dict) --
A structure that contains additional details about the policy.
Id (string) --
The unique identifier (ID) of the policy.
The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lower-case letters or digits.
Arn (string) --
The Amazon Resource Name (ARN) of the policy.
For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the AWS Organizations User Guide .
Name (string) --
The friendly name of 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 (string) --
The description of the policy.
Type (string) --
The type of policy.
AwsManaged (boolean) --
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
Content (string) --
The text content of the policy.