Skip to content

disassociate_enclave_certificate_iam_role async

disassociate_enclave_certificate_iam_role(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    certificate_arn: Optional[CertificateId] = None,
    role_arn: Optional[RoleId] = None,
    dry_run: Optional[Boolean] = None,
) -> DisassociateEnclaveCertificateIamRoleResult

Disassociates an IAM role from an Certificate Manager (ACM) certificate. Disassociating an IAM role from an ACM certificate removes the Amazon S3 object that contains the certificate, certificate chain, and encrypted private key from the Amazon S3 bucket. It also revokes the IAM role's permission to use the KMS key used to encrypt the private key. This effectively revokes the role's permission to use the certificate.

Parameters:

  • certificate_arn (Optional[CertificateId], default: None ) –

    The ARN of the ACM certificate from which to disassociate the IAM role.

  • role_arn (Optional[RoleId], default: None ) –

    The ARN of the IAM role to disassociate.

  • 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 disassociate_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.disassociate_enclave_certificate_iam_role_result.DisassociateEnclaveCertificateIamRoleResult":
    """<p>Disassociates an IAM role from an Certificate Manager (ACM) certificate. Disassociating an IAM role from an ACM certificate removes the Amazon S3 object that contains the certificate, certificate chain, and encrypted private key from the Amazon S3 bucket. It also revokes the IAM role's permission to use the KMS key used to encrypt the private key. This effectively revokes the role's permission to use the certificate.</p>

    Args:
        certificate_arn: <p>The ARN of the ACM certificate from which to disassociate the IAM role.</p>
        role_arn: <p>The ARN of the IAM role to disassociate.</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.disassociate_enclave_certificate_iam_role_request.DisassociateEnclaveCertificateIamRoleRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.disassociate_enclave_certificate_iam_role_result.DisassociateEnclaveCertificateIamRoleResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disassociate_enclave_certificate_iam_role

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.disassociate_enclave_certificate_iam_role.async_disassociate_enclave_certificate_iam_role(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateEnclaveCertificateIamRole")
    )
    input_: capo_ec2.types.disassociate_enclave_certificate_iam_role_request.DisassociateEnclaveCertificateIamRoleRequest = {}
    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