

# Troubleshoot CAs for AWS IAM for agents and workloads

The following list describes common errors that you might see when you replicate, attach, or delete a certificate authority (CA) for AWS IAM for agents and workloads, together with their causes and fixes. The list names AWS CLI commands; the matching API operations behave the same way.

Replica creation fails with `LIMIT_EXCEEDED` (in the `Failed` list of a batch request) or `LimitExceededException` (from a single-Region request)  
The target Region is at its quota for CAs. A replica counts as one CA in that Region. The [batch-create-certificate-authority-replica](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/batch-create-certificate-authority-replica.html) command reports `LIMIT_EXCEEDED` for the Region, and the [create-certificate-authority-replica](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/create-certificate-authority-replica.html) command returns `LimitExceededException`. Delete a CA in that Region or request a quota increase, and then retry that Region. For more information, see [AWS Private CA service quotas](PcaLimits.md).

Replica creation fails with `CONFLICT` (in the `Failed` list of a batch request) or `ConflictException` (from a single-Region request)  
The CA already has a replica in that Region. The [list-certificate-authority-replicas](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/list-certificate-authority-replicas.html) command shows it. You don't need to take any action for that Region.

A replica operation returns `InvalidStateException`  
The primary CA isn't `ACTIVE`. You can replicate only an `ACTIVE` primary CA. Activate the CA first. For instructions on activating the CA, see [Step 2: Activate the CA](PcaWorkloadIdentity-get-started.md#workload-identity-activate-ca).

A replica operation fails with an `AccessDeniedException` from the target Region  
Your identity lacks `acm-pca:CreateCertificateAuthority` in the target Region, or `acm-pca:TagCertificateAuthority` there if you tag the replica. You receive the `AccessDeniedException` from the target Region. Both replica operations also need `acm-pca:CreateCertificateAuthorityReplica` on the primary CA. The batch operation checks it once for each replica, and one denied replica denies the whole batch. The policy in [Prerequisites](PcaWorkloadIdentity-get-started.md#workload-identity-prerequisites) grants these permissions.

**list-certificate-authority-replicas** returns `InvalidArgsException`  
You passed the Amazon Resource Name (ARN) of a replica or of a single-Region CA. Pass the ARN of the primary CA, and call the command in the primary Region.

Deleting the primary CA returns `ResourceInUseException`  
A replica isn't yet `DELETED` or `FAILED`. Delete every replica in its own Region first. Then wait until every replica that **list-certificate-authority-replicas** returns has the status `FAILED`, or the command returns no replicas, and delete the primary CA again. For the full order, see [Tear down a CA for AWS IAM for agents and workloads](PcaWorkloadIdentity-teardown.md).

Workloads in a Region can't get certificates  
Your workloads receive certificates from the CA in their own Region, issued by AWS Security Token Service (AWS STS). The Region has no `ACTIVE` primary CA or replica, or the CA is `DISABLED` there. Replicate the CA to the Region, or set the status of the CA in that Region back to `ACTIVE` with the [update-certificate-authority](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/update-certificate-authority.html) command. If your workloads run in a different account from the CA, their role also needs `acm-pca:IssueCertificate` and `acm-pca:GetCertificate` on the CA. For more information, see [Cross-account use](PcaWorkloadIdentity-considerations.md#workload-identity-considerations-cross-account).  
If you attached the CA recently, the signer might not have started yet. By default, IAM starts the signer one hour after you attach the CA, and until then AWS STS returns `RegionalSignerUnavailableException` to workloads. Wait for the signer to start, and then retry.

Attaching the CA to or detaching it from the workload identity provider in IAM fails with a permission error  
When you attach the CA, IAM calls AWS Private CA with your credentials. Your identity therefore needs `acm-pca:CreateCertificateAuthorityAssociation`, `acm-pca:DescribeCertificateAuthority`, and `acm-pca:GetCertificateAuthorityCertificate` on the primary CA. To detach the CA, your identity needs `acm-pca:DeleteCertificateAuthorityAssociation` on the primary CA. If the CA is in another account, the CA owner must grant those actions to the root principal of your account with the [create-permission](https://docs.aws.amazon.com/cli/latest/reference/acm-pca/create-permission.html) command. For instructions on granting access to another account, see [Step 4: Grant access to another account (cross-account only)](PcaWorkloadIdentity-get-started.md#workload-identity-cross-account).

For problems that aren't specific to this CA mode, see [Troubleshoot issues with AWS Private Certificate Authority](PcaTsIntro.md).