Tear down a CA for AWS IAM for agents and workloads
Tear down a certificate authority (CA) for AWS IAM for agents and workloads in a fixed order. First, detach the CA from the workload identity provider in IAM, and confirm that the CA has no associations. Next, delete each replica in its own Region, and delete the primary CA last. The following procedure uses the AWS CLI and the example Regions from Set up a CA for AWS IAM for agents and workloads (AWS CLI).
To tear down a CA for AWS IAM for agents and workloads
-
Important
Don't delete the CA's signer while certificates that the CA issued are still in use. Deleting it removes the CA from the trust bundle at once, and those certificates stop verifying. After a rotation, don't disable the X.509 outbound signer to remove the old CA. Disabling it also stops the new CA.
In IAM, detach the CA from the workload identity provider:
-
If the CA is the provider's only CA, disable the X.509 outbound signer.
-
If you rotated the provider to a new CA, leave the signer as it is. The old CA stops signing when the new CA starts.
Wait until the status of the CA's signer is
INACTIVE, and then delete the signer.For the signer statuses and the IAM commands, see Agent and workload identity in the IAM User Guide.
When you delete the signer, IAM removes the association between the CA and the provider. Before you continue, confirm that the CA has no associations. In the console, the Associations tab of the CA details page is empty. With the API, ListCertificateAuthorityAssociations returns no associations. For the permission that the identity needs to detach the CA, see Prerequisites.
-
-
Delete each replica in its own Region. A CA with the status
ACTIVEmust beDISABLEDbefore you can delete it. First, disable the replica with the update-certificate-authority command in the replica's Region.$aws acm-pca update-certificate-authority \ --region us-west-2 \ --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111\ --status DISABLEDThen delete the replica with the delete-certificate-authority command. Don't pass
--permanent-deletion-time-in-daysfor a replica.$aws acm-pca delete-certificate-authority \ --region us-west-2 \ --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111Issuance in that Region stops immediately, and the replica disappears from the output of list-certificate-authority-replicas. Repeat this step for every replica, for example in
eu-west-1. -
Delete the primary CA last, in the primary Region, after every replica is
DELETEDorFAILED. If the status of the primary CA is stillACTIVE, disable it first.$aws acm-pca update-certificate-authority \ --region us-east-1 \ --certificate-authority-arn arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111\ --status DISABLEDThen delete the primary CA.
$aws acm-pca delete-certificate-authority \ --region us-east-1 \ --certificate-authority-arn arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111\ --permanent-deletion-time-in-days 7The primary CA keeps the normal restoration period of 7-30 days. During that period, the restore-certificate-authority command restores the primary CA only. You can't restore a deleted replica. To get it back, create it again with create-certificate-authority-replica.
For a Java example, see Delete a CA for AWS IAM for agents and workloads. For more information about deleting and restoring a CA, see Delete your private CA.