Associates an Identity and Access Management (IAM) role with an Certificate Manager (ACM) certificate. This enables the certificate to be used by the ACM for Nitro Enclaves application inside an enclave. For more information, see Certificate Manager for Nitro Enclaves in the Amazon Web Services Nitro Enclaves User Guide.
When the IAM role is associated with the ACM certificate, the certificate, certificate chain, and encrypted private key are placed in an Amazon S3 location that only the associated IAM role can access. The private key of the certificate is encrypted with an Amazon Web Services managed key that has an attached attestation-based key policy.
To enable the IAM role to access the Amazon S3 object, you must grant it permission to call s3:GetObject on the Amazon S3 bucket returned by the command. To enable the IAM role to access the KMS key, you must grant it permission to call kms:Decrypt on the KMS key returned by the command. For more information, see Grant the role permission to access the certificate and encryption key in the Amazon Web Services Nitro Enclaves User Guide.
Parameters:
-
certificate_arn
(Optional[CertificateId], default:
None
)
–
The ARN of the ACM certificate with which to associate the IAM role.
-
role_arn
(Optional[RoleId], default:
None
)
–
The ARN of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.
-
dry_run
(Optional[Boolean], default:
None
)
–
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
Raises:
Source code in docs_src/capo_ec2/_services/async_ec2.py
| async def associate_enclave_certificate_iam_role(
self,
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
certificate_arn: Optional["capo_ec2.types.certificate_id.CertificateId"] = None,
role_arn: Optional["capo_ec2.types.role_id.RoleId"] = None,
dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.associate_enclave_certificate_iam_role_result.AssociateEnclaveCertificateIamRoleResult":
"""<p>Associates an Identity and Access Management (IAM) role with an Certificate Manager (ACM) certificate. This enables the certificate to be used by the ACM for Nitro Enclaves application inside an enclave. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html">Certificate Manager for Nitro Enclaves</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p> <p>When the IAM role is associated with the ACM certificate, the certificate, certificate chain, and encrypted private key are placed in an Amazon S3 location that only the associated IAM role can access. The private key of the certificate is encrypted with an Amazon Web Services managed key that has an attached attestation-based key policy.</p> <p>To enable the IAM role to access the Amazon S3 object, you must grant it permission to call <code>s3:GetObject</code> on the Amazon S3 bucket returned by the command. To enable the IAM role to access the KMS key, you must grant it permission to call <code>kms:Decrypt</code> on the KMS key returned by the command. For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html#add-policy"> Grant the role permission to access the certificate and encryption key</a> in the <i>Amazon Web Services Nitro Enclaves User Guide</i>.</p>
Args:
certificate_arn: <p>The ARN of the ACM certificate with which to associate the IAM role.</p>
role_arn: <p>The ARN of the IAM role to associate with the ACM certificate. You can associate up to 16 IAM roles with an ACM certificate.</p>
dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ec2.types.associate_enclave_certificate_iam_role_request.AssociateEnclaveCertificateIamRoleRequest]",
) -> AsyncOperationResponse[
"capo_ec2.types.associate_enclave_certificate_iam_role_result.AssociateEnclaveCertificateIamRoleResult"
]:
import capo_ec2._operations.amazon_ec2.associate_enclave_certificate_iam_role
(
output,
http_response,
) = await capo_ec2._operations.amazon_ec2.associate_enclave_certificate_iam_role.async_associate_enclave_certificate_iam_role(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateEnclaveCertificateIamRole")
)
input_: capo_ec2.types.associate_enclave_certificate_iam_role_request.AssociateEnclaveCertificateIamRoleRequest = {}
if certificate_arn is not None:
input_["certificate_arn"] = certificate_arn
if role_arn is not None:
input_["role_arn"] = role_arn
if dry_run is not None:
input_["dry_run"] = dry_run
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|