Skip to content

create_domain_for_organization async

create_domain_for_organization(
    name: str,
    identity_providers: IdentityProviderList,
    domain_access_role_arn: IamRoleArn,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    identity_provider_configuration: Optional[IdentityProviderConfiguration] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateDomainForOrganizationOutput

Creates an organization-scoped domain for the caller's AWS Organization. Only the organization's management account can call this operation.

Parameters:

  • name (str) –

    A name that identifies the organization domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.

  • identity_providers (IdentityProviderList) –

    The identity providers to configure for the domain.

  • identity_provider_configuration (Optional[IdentityProviderConfiguration], default: None ) –

    Identity provider configuration for the domain.

  • domain_access_role_arn (IamRoleArn) –

    The ARN of an IAM role in the management account used for domain access. You must create this role, and its trust policy must allow the service principal to assume it.

  • tags (Optional[TagMap], default: None ) –

    The tags to associate with the domain.

  • client_token (Optional[ClientToken], default: None ) –

    Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.

Raises:

Examples:

Create an organization domain The following example creates an organization-scoped domain from the organization's management account, configures it with an Identity Center instance, and supplies an IAM role in the management account for domain access. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.create_domain_for_organization(name='prod-observability-org', identity_providers=['IDC'], identity_provider_configuration={'identityCenterConfiguration': {'identityCenterInstanceArn': 'arn:aws:sso:::instance/ssoins-1234567890abcdef'}}, domain_access_role_arn='arn:aws:iam::123456789012:role/CloudWatchOrganizationDomainAccessRole', tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def create_domain_for_organization(
    self,
    name: str,
    identity_providers: "capo_cloudwatchomni.types.identity_provider_list.IdentityProviderList",
    domain_access_role_arn: "capo_cloudwatchomni.types.iam_role_arn.IamRoleArn",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    identity_provider_configuration: Optional[
        "capo_cloudwatchomni.types.identity_provider_configuration.IdentityProviderConfiguration"
    ] = None,
    tags: Optional["capo_cloudwatchomni.types.tag_map.TagMap"] = None,
    client_token: Optional[
        "capo_cloudwatchomni.types.client_token.ClientToken"
    ] = None,
) -> "capo_cloudwatchomni.types.create_domain_for_organization_output.CreateDomainForOrganizationOutput":
    """Creates an organization-scoped domain for the caller's AWS Organization. Only the organization's management account can call this operation.

    Args:
        name: A name that identifies the organization domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
        identity_providers: The identity providers to configure for the domain.
        identity_provider_configuration: Identity provider configuration for the domain.
        domain_access_role_arn: The ARN of an IAM role in the management account used for domain access. You must create this role, and its trust policy must allow the service principal to assume it.
        tags: The tags to associate with the domain.
        client_token: Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.conflict_exception.ConflictException: The operation could not be completed because of a conflict with the current state of the resource.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create an organization domain
        The following example creates an organization-scoped domain from the organization's management account, configures it with an Identity Center instance, and supplies an IAM role in the management account for domain access. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.create_domain_for_organization(name='prod-observability-org', identity_providers=['IDC'], identity_provider_configuration={'identityCenterConfiguration': {'identityCenterInstanceArn': 'arn:aws:sso:::instance/ssoins-1234567890abcdef'}}, domain_access_role_arn='arn:aws:iam::123456789012:role/CloudWatchOrganizationDomainAccessRole', tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.create_domain_for_organization_input.CreateDomainForOrganizationInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.create_domain_for_organization_output.CreateDomainForOrganizationOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_domain_for_organization

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_domain_for_organization.async_create_domain_for_organization(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomainForOrganization")
    )
    input_: capo_cloudwatchomni.types.create_domain_for_organization_input.CreateDomainForOrganizationInput = {
        "name": name,
        "identity_providers": identity_providers,
        "domain_access_role_arn": domain_access_role_arn,
    }
    if identity_provider_configuration is not None:
        input_["identity_provider_configuration"] = identity_provider_configuration
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output