Associates an S/MIME certificate with an email identity. After the certificate is active, Amazon SES API v2 can add an S/MIME signature to messages that you send from the associated address when signing is enabled on the configuration set used to send the message.
The certificate is an X.509 certificate that you manage in Certificate Manager (ACM). You identify it by its Amazon Resource Name (ARN).
-
If the email identity is a domain, you must specify a FromAddress that belongs to that domain or one of its subdomains. The certificate applies to messages sent from that address.
-
If the email identity is an email address, FromAddress is optional. If you specify it, it must exactly match the email identity.
When the association is created, the certificate begins provisioning and its status is PROVISIONING. The status changes to ACTIVE when the certificate is ready to use for signing. Each email address can have only one certificate association. If an association already exists for the address, this operation returns an error, unless the existing association is in the DEPROVISIONING state.
Parameters:
-
email_identity
(Identity)
–
The email identity, either an email address or a domain, to associate the certificate with.
-
from_address
(Optional[EmailAddress], default:
None
)
–
The email address that the certificate applies to. This value is required when the email identity is a domain, and the address must belong to that domain or one of its subdomains. When the email identity is an email address, this value is optional. If you specify it, it must exactly match the email identity.
-
certificate_arn
(CertificateArn)
–
The Amazon Resource Name (ARN) of the Certificate Manager (ACM) certificate to associate with the email identity.
Raises:
Source code in docs_src/capo_sesv2/_services/se_sv2.py
| def associate_email_identity_certificate(
self,
email_identity: "capo_sesv2.types.identity.Identity",
certificate_arn: "capo_sesv2.types.certificate_arn.CertificateArn",
*,
config_overrides: Optional[SESv2ClientConfig] = None,
from_address: Optional["capo_sesv2.types.email_address.EmailAddress"] = None,
) -> "capo_sesv2.types.associate_email_identity_certificate_response.AssociateEmailIdentityCertificateResponse":
"""<p>Associates an S/MIME certificate with an email identity. After the certificate is active, Amazon SES API v2 can add an S/MIME signature to messages that you send from the associated address when signing is enabled on the configuration set used to send the message.</p> <p>The certificate is an X.509 certificate that you manage in Certificate Manager (ACM). You identify it by its Amazon Resource Name (ARN).</p> <ul> <li> <p>If the email identity is a domain, you must specify a <code>FromAddress</code> that belongs to that domain or one of its subdomains. The certificate applies to messages sent from that address.</p> </li> <li> <p>If the email identity is an email address, <code>FromAddress</code> is optional. If you specify it, it must exactly match the email identity.</p> </li> </ul> <p>When the association is created, the certificate begins provisioning and its status is <code>PROVISIONING</code>. The status changes to <code>ACTIVE</code> when the certificate is ready to use for signing. Each email address can have only one certificate association. If an association already exists for the address, this operation returns an error, unless the existing association is in the <code>DEPROVISIONING</code> state.</p>
Args:
email_identity: <p>The email identity, either an email address or a domain, to associate the certificate with.</p>
from_address: <p>The email address that the certificate applies to. This value is required when the email identity is a domain, and the address must belong to that domain or one of its subdomains. When the email identity is an email address, this value is optional. If you specify it, it must exactly match the email identity.</p>
certificate_arn: <p>The Amazon Resource Name (ARN) of the Certificate Manager (ACM) certificate to associate with the email identity.</p>
Raises:
capo_sesv2.errors.already_exists_exception.AlreadyExistsException: <p>The resource specified in your request already exists.</p>
capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sesv2.types.associate_email_identity_certificate_request.AssociateEmailIdentityCertificateRequest]",
) -> OperationResponse[
"capo_sesv2.types.associate_email_identity_certificate_response.AssociateEmailIdentityCertificateResponse"
]:
import capo_sesv2._operations.simple_email_service_v2.associate_email_identity_certificate
output, http_response = (
capo_sesv2._operations.simple_email_service_v2.associate_email_identity_certificate.associate_email_identity_certificate(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateEmailIdentityCertificate")
)
input_: capo_sesv2.types.associate_email_identity_certificate_request.AssociateEmailIdentityCertificateRequest = {
"email_identity": email_identity,
"certificate_arn": certificate_arn,
}
if from_address is not None:
input_["from_address"] = from_address
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|