AWS Organizations

2024/09/26 - AWS Organizations - 11 updated api methods

Changes  Add support for policy operations on the CHATBOT_POLICY policy type.

CreateOrganization (updated) Link ¶
Changes (response)
{'Organization': {'AvailablePolicyTypes': {'Type': {'CHATBOT_POLICY'}}}}

Creates an Amazon Web Services organization. The account whose user is calling the CreateOrganization operation automatically becomes the management account of the new organization.

This operation must be called using credentials from the account that is to become the new organization's management 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'
)
type FeatureSet

string

param FeatureSet

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 management account. For more information, see Consolidated billing in the Organizations User Guide . The consolidated billing feature subset isn't available for organizations in the Amazon Web Services GovCloud (US) Region.

  • ALL : In addition to all the features supported by the consolidated billing feature set, the management account can also apply any policy type to any member account in the organization. For more information, see All features in the Organizations User Guide .

rtype

dict

returns

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'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase 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 Amazon Web Services Service Authorization Reference .

      • 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 Organizations User Guide .

      • MasterAccountArn (string) --

        The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference .

      • MasterAccountId (string) --

        The unique identifier (ID) of the management 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 Amazon Web Services account that is designated as the management account for the organization.

      • AvailablePolicyTypes (list) --

        Warning

        Do not use. This field is deprecated and doesn't provide complete information about the policies in your organization.

        To determine the policies that are enabled and available for use in your organization, use the ListRoots operation instead.

        • (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.

CreatePolicy (updated) Link ¶
Changes (request, response)
Request
{'Type': {'CHATBOT_POLICY'}}
Response
{'Policy': {'PolicySummary': {'Type': {'CHATBOT_POLICY'}}}}

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.

See also: AWS API Documentation

Request Syntax

client.create_policy(
    Content='string',
    Description='string',
    Name='string',
    Type='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Content

string

param Content

[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.

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 .

type Description

string

param Description

[REQUIRED]

An optional description to assign to the policy.

type Name

string

param Name

[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.

type Type

string

param Type

[REQUIRED]

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

type Tags

list

param 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.

Note

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.

  • (dict) --

    A custom key-value pair associated with a resource within your organization.

    You can attach tags to any of the following organization resources.

    • Amazon Web Services account

    • Organizational unit (OU)

    • Organization root

    • Policy

    • Key (string) -- [REQUIRED]

      The key identifier, or name, of the tag.

    • Value (string) -- [REQUIRED]

      The string value that's associated with the key of the tag. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.

rtype

dict

returns

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase or uppercase letters, digits, or the underscore character (_).

        • 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 Amazon Web Services Service Authorization Reference .

        • 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 Amazon Web Services 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.

DescribeEffectivePolicy (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'CHATBOT_POLICY'}}
Response
{'EffectivePolicy': {'PolicyType': {'CHATBOT_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 Understanding management policy inheritance in the Organizations User Guide .

This operation can be called from any account in the organization.

See also: AWS API Documentation

Request Syntax

client.describe_effective_policy(
    PolicyType='TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY',
    TargetId='string'
)
type PolicyType

string

param PolicyType

[REQUIRED]

The type of policy that you want information about. You can specify one of the following values:

type TargetId

string

param TargetId

When you're signed in as the management 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.

rtype

dict

returns

Response Syntax

{
    'EffectivePolicy': {
        'PolicyContent': 'string',
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'TargetId': 'string',
        'PolicyType': 'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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.

DescribeOrganization (updated) Link ¶
Changes (response)
{'Organization': {'AvailablePolicyTypes': {'Type': {'CHATBOT_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()
rtype

dict

returns

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'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY',
                'Status': 'ENABLED'|'PENDING_ENABLE'|'PENDING_DISABLE'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Organization (dict) --

      A structure that contains information about the organization.

      Warning

      The AvailablePolicyTypes part of the response is deprecated, and you shouldn't use it in your apps. It doesn't include any policy type supported by Organizations other than SCPs. In the China (Ningxia) Region, no policy type is included. To determine which policy types are enabled in your organization, use the ListRoots operation.

      • 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 lowercase 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 Amazon Web Services Service Authorization Reference .

      • 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 Organizations User Guide .

      • MasterAccountArn (string) --

        The Amazon Resource Name (ARN) of the account that is designated as the management account for the organization.

        For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference .

      • MasterAccountId (string) --

        The unique identifier (ID) of the management 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 Amazon Web Services account that is designated as the management account for the organization.

      • AvailablePolicyTypes (list) --

        Warning

        Do not use. This field is deprecated and doesn't provide complete information about the policies in your organization.

        To determine the policies that are enabled and available for use in your organization, use the ListRoots operation instead.

        • (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.

DescribePolicy (updated) Link ¶
Changes (response)
{'Policy': {'PolicySummary': {'Type': {'CHATBOT_POLICY'}}}}

Retrieves information about a policy.

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.

See also: AWS API Documentation

Request Syntax

client.describe_policy(
    PolicyId='string'
)
type PolicyId

string

param PolicyId

[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 (_).

rtype

dict

returns

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase or uppercase letters, digits, or the underscore character (_).

        • 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 Amazon Web Services Service Authorization Reference .

        • 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 Amazon Web Services 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.

DisablePolicyType (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'CHATBOT_POLICY'}}
Response
{'Root': {'PolicyTypes': {'Type': {'CHATBOT_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 Amazon Web Services 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. Amazon Web Services 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 management account or by a member account that is a delegated administrator for an Amazon Web Services service.

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'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'
)
type RootId

string

param RootId

[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.

type PolicyType

string

param PolicyType

[REQUIRED]

The policy type that you want to disable in this root. You can specify one of the following values:

rtype

dict

returns

Response Syntax

{
    'Root': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string',
        'PolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 ID is unique to the organization only.

        The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase 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 Amazon Web Services Service Authorization Reference .

      • 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.

EnablePolicyType (updated) Link ¶
Changes (request, response)
Request
{'PolicyType': {'CHATBOT_POLICY'}}
Response
{'Root': {'PolicyTypes': {'Type': {'CHATBOT_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 Amazon Web Services performs in the background. Amazon Web Services 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 management account or by a member account that is a delegated administrator for an Amazon Web Services service.

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'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY'
)
type RootId

string

param RootId

[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.

type PolicyType

string

param PolicyType

[REQUIRED]

The policy type that you want to enable. You can specify one of the following values:

rtype

dict

returns

Response Syntax

{
    'Root': {
        'Id': 'string',
        'Arn': 'string',
        'Name': 'string',
        'PolicyTypes': [
            {
                'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 ID is unique to the organization only.

        The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase 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 Amazon Web Services Service Authorization Reference .

      • 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.

ListPolicies (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'CHATBOT_POLICY'}}
Response
{'Policies': {'Type': {'CHATBOT_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 management account or by a member account that is a delegated administrator for an Amazon Web Services service.

See also: AWS API Documentation

Request Syntax

client.list_policies(
    Filter='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY',
    NextToken='string',
    MaxResults=123
)
type Filter

string

param Filter

[REQUIRED]

Specifies the type of policy that you want to include in the response. You must specify one of the following values:

type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

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.

rtype

dict

returns

Response Syntax

{
    'Policies': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase or uppercase letters, digits, or the underscore character (_).

        • 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 Amazon Web Services Service Authorization Reference .

        • 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 Amazon Web Services 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 .

ListPoliciesForTarget (updated) Link ¶
Changes (request, response)
Request
{'Filter': {'CHATBOT_POLICY'}}
Response
{'Policies': {'Type': {'CHATBOT_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 management account or by a member account that is a delegated administrator for an Amazon Web Services service.

See also: AWS API Documentation

Request Syntax

client.list_policies_for_target(
    TargetId='string',
    Filter='SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_POLICY',
    NextToken='string',
    MaxResults=123
)
type TargetId

string

param TargetId

[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.

type Filter

string

param Filter

[REQUIRED]

The type of policy that you want to include in the returned list. You must specify one of the following values:

type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

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.

rtype

dict

returns

Response Syntax

{
    'Policies': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase or uppercase letters, digits, or the underscore character (_).

        • 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 Amazon Web Services Service Authorization Reference .

        • 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 Amazon Web Services 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 .

ListRoots (updated) Link ¶
Changes (response)
{'Roots': {'PolicyTypes': {'Type': {'CHATBOT_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 management account or by a member account that is a delegated administrator for an Amazon Web Services 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
)
type NextToken

string

param NextToken

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.

type MaxResults

integer

param MaxResults

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.

rtype

dict

returns

Response Syntax

{
    'Roots': [
        {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'PolicyTypes': [
                {
                    'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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. The root contains every Amazon Web Services account in the organization.

        • Id (string) --

          The unique identifier (ID) for the root. The ID is unique to the organization only.

          The regex pattern for a root ID string requires "r-" followed by from 4 to 32 lowercase 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 Amazon Web Services Service Authorization Reference .

        • 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 .

UpdatePolicy (updated) Link ¶
Changes (response)
{'Policy': {'PolicySummary': {'Type': {'CHATBOT_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 management account or by a member account that is a delegated administrator for an Amazon Web Services service.

See also: AWS API Documentation

Request Syntax

client.update_policy(
    PolicyId='string',
    Name='string',
    Description='string',
    Content='string'
)
type PolicyId

string

param 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 (_).

type Name

string

param 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.

type Description

string

param Description

If provided, the new description for the policy.

type Content

string

param 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 .

rtype

dict

returns

Response Syntax

{
    'Policy': {
        'PolicySummary': {
            'Id': 'string',
            'Arn': 'string',
            'Name': 'string',
            'Description': 'string',
            'Type': 'SERVICE_CONTROL_POLICY'|'TAG_POLICY'|'BACKUP_POLICY'|'AISERVICES_OPT_OUT_POLICY'|'CHATBOT_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 lowercase or uppercase letters, digits, or the underscore character (_).

        • 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 Amazon Web Services Service Authorization Reference .

        • 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 Amazon Web Services 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.