Skip to content

create_domain

create_domain(
    name: str,
    identity_providers: IdentityProviderList,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    identity_provider_configuration: Optional[IdentityProviderConfiguration] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateDomainOutput

Creates a domain with identity provider configuration. Use GetDomain to retrieve the domain, UpdateDomain to change its configuration, and CreateSpace to add spaces within it.

Parameters:

  • name (str) –

    A name that identifies the 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.

  • 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 a domain The following example creates an Identity Center domain and configures it with an Identity Center instance. The name must be 3-63 characters of lowercase letters, numbers, and hyphens, and the endpoint URLs are derived from it. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.create_domain(name='prod-observability', identity_providers=['IDC'], identity_provider_configuration={'identityCenterConfiguration': {'identityCenterInstanceArn': 'arn:aws:sso:::instance/ssoins-1234567890abcdef'}}, tags={'Team': 'observability'}, client_token='3f2a9c1e-7b04-4d8a-9e15-6c2b8d0f4a73')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def create_domain(
    self,
    name: str,
    identity_providers: "capo_cloudwatchomni.types.identity_provider_list.IdentityProviderList",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = 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_output.CreateDomainOutput":
    """Creates a domain with identity provider configuration. Use GetDomain to retrieve the domain, UpdateDomain to change its configuration, and CreateSpace to add spaces within it.

    Args:
        name: A name that identifies the 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.
        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.service_quota_exceeded_exception.ServiceQuotaExceededException: A service quota was exceeded.
        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 a domain
        The following example creates an Identity Center domain and configures it with an Identity Center instance. The name must be 3-63 characters of lowercase letters, numbers, and hyphens, and the endpoint URLs are derived from it. Payloads are shown as JSON; on the wire they are CBOR-encoded.

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

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.create_domain_input.CreateDomainInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.create_domain_output.CreateDomainOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_domain

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.create_domain.create_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomain")
    )
    input_: capo_cloudwatchomni.types.create_domain_input.CreateDomainInput = {
        "name": name,
        "identity_providers": identity_providers,
    }
    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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output