Skip to content

import_certificate

import_certificate(
    certificate_identifier: String,
    *,
    config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
    certificate_pem: Optional[SecretString] = None,
    certificate_wallet: Optional[CertificateWallet] = None,
    tags: Optional[TagList] = None,
    kms_key_id: Optional[String] = None,
) -> ImportCertificateResponse

Uploads the specified certificate.

Parameters:

  • certificate_identifier (String) –

    A customer-assigned name for the certificate. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen or contain two consecutive hyphens.

  • certificate_pem (Optional[SecretString], default: None ) –

    The contents of a .pem file, which contains an X.509 certificate.

  • certificate_wallet (Optional[CertificateWallet], default: None ) –

    The location of an imported Oracle Wallet certificate for use with SSL. Provide the name of a .sso file using the fileb:// prefix. You can't provide the certificate inline.

    Example: filebase64("${path.root}/rds-ca-2019-root.sso")

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

    The tags associated with the certificate.

  • kms_key_id (Optional[String], default: None ) –

    An KMS key identifier that is used to encrypt the certificate.

    If you don't specify a value for the KmsKeyId parameter, then DMS uses your default encryption key.

    KMS creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each Amazon Web Services Region.

Raises:

Examples:

Import certificate Uploads the specified certificate.

>>> client.import_certificate(certificate_identifier='', certificate_pem='')
Source code in docs_src/capo_database_migration_service/_services/database_migration_service.py
def import_certificate(
    self,
    certificate_identifier: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[DatabaseMigrationServiceClientConfig] = None,
    certificate_pem: Optional[
        "capo_database_migration_service.types.secret_string.SecretString"
    ] = None,
    certificate_wallet: Optional[
        "capo_database_migration_service.types.certificate_wallet.CertificateWallet"
    ] = None,
    tags: Optional["capo_database_migration_service.types.tag_list.TagList"] = None,
    kms_key_id: Optional[
        "capo_database_migration_service.types.string.String"
    ] = None,
) -> "capo_database_migration_service.types.import_certificate_response.ImportCertificateResponse":
    """<p>Uploads the specified certificate.</p>

    Args:
        certificate_identifier: <p>A customer-assigned name for the certificate. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen or contain two consecutive hyphens.</p>
        certificate_pem: <p>The contents of a <code>.pem</code> file, which contains an X.509 certificate.</p>
        certificate_wallet: <p>The location of an imported Oracle Wallet certificate for use with SSL. Provide the name of a <code>.sso</code> file using the <code>fileb://</code> prefix. You can't provide the certificate inline.</p> <p>Example: <code>filebase64("${path.root}/rds-ca-2019-root.sso")</code> </p>
        tags: <p>The tags associated with the certificate.</p>
        kms_key_id: <p>An KMS key identifier that is used to encrypt the certificate.</p> <p>If you don't specify a value for the <code>KmsKeyId</code> parameter, then DMS uses your default encryption key.</p> <p>KMS creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each Amazon Web Services Region.</p>

    Raises:
        capo_database_migration_service.errors.invalid_certificate_fault.InvalidCertificateFault: <p>The certificate was not valid.</p>
        capo_database_migration_service.errors.kms_key_not_accessible_fault.KMSKeyNotAccessibleFault: <p>DMS cannot access the KMS key.</p>
        capo_database_migration_service.errors.resource_already_exists_fault.ResourceAlreadyExistsFault: <p>The resource you are attempting to create already exists.</p>
        capo_database_migration_service.errors.resource_quota_exceeded_fault.ResourceQuotaExceededFault: <p>The quota for this resource quota has been exceeded.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Import certificate
        Uploads the specified certificate.

        >>> client.import_certificate(certificate_identifier='', certificate_pem='')
    """

    def _handler(
        req: "OperationRequest[capo_database_migration_service.types.import_certificate_message.ImportCertificateMessage]",
    ) -> OperationResponse[
        "capo_database_migration_service.types.import_certificate_response.ImportCertificateResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.import_certificate

        output, http_response = (
            capo_database_migration_service._operations.amazon_dm_sv20160101.import_certificate.import_certificate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_database_migration_service.types.import_certificate_message.ImportCertificateMessage",
    ) -> dict[str, Any]:
        import capo_database_migration_service.types.import_certificate_message

        return capo_database_migration_service.types.import_certificate_message.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ImportCertificate", redact_input=_redact_input),
    )
    input_: capo_database_migration_service.types.import_certificate_message.ImportCertificateMessage = {
        "certificate_identifier": certificate_identifier
    }
    if certificate_pem is not None:
        input_["certificate_pem"] = certificate_pem
    if certificate_wallet is not None:
        input_["certificate_wallet"] = certificate_wallet
    if tags is not None:
        input_["tags"] = tags
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id

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