Skip to content

create_domain_name

create_domain_name(
    domain_name: DomainName,
    certificate_arn: CertificateArn,
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[TagMap] = None,
) -> CreateDomainNameResponse

Creates a custom DomainName object.

Parameters:

  • domain_name (DomainName) –

    The domain name.

  • certificate_arn (CertificateArn) –

    The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

  • description (Optional[Description], default: None ) –

    A description of the DomainName.

Raises:

  • AccessDeniedException –

    You don't have access to perform this operation on this resource.

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.

  • InternalFailureException –

    An internal AppSync error occurred. Try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appsync/_services/app_sync.py
def create_domain_name(
    self,
    domain_name: "capo_appsync.types.domain_name.DomainName",
    certificate_arn: "capo_appsync.types.certificate_arn.CertificateArn",
    *,
    config_overrides: Optional[AppSyncClientConfig] = None,
    description: Optional["capo_appsync.types.description.Description"] = None,
    tags: Optional["capo_appsync.types.tag_map.TagMap"] = None,
) -> "capo_appsync.types.create_domain_name_response.CreateDomainNameResponse":
    """<p>Creates a custom <code>DomainName</code> object.</p>

    Args:
        domain_name: <p>The domain name.</p>
        certificate_arn: <p>The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.</p>
        description: <p>A description of the <code>DomainName</code>.</p>

    Raises:
        capo_appsync.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to perform this operation on this resource.</p>
        capo_appsync.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.</p>
        capo_appsync.errors.internal_failure_exception.InternalFailureException: <p>An internal AppSync error occurred. Try your request again.</p>
        capo_appsync.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appsync.types.create_domain_name_request.CreateDomainNameRequest]",
    ) -> OperationResponse[
        "capo_appsync.types.create_domain_name_response.CreateDomainNameResponse"
    ]:
        import capo_appsync._operations.aws_deepdish_control_plane_service.create_domain_name

        output, http_response = (
            capo_appsync._operations.aws_deepdish_control_plane_service.create_domain_name.create_domain_name(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomainName")
    )
    input_: capo_appsync.types.create_domain_name_request.CreateDomainNameRequest = {
        "domain_name": domain_name,
        "certificate_arn": certificate_arn,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output