

# Considerations

A certificate authority (CA) with the AWS IAM for agents and workloads affiliation behaves differently from a general-purpose CA. Its configuration is fixed when you create it, some operations work only on the primary CA, and others work independently in each AWS Region. Keep the following considerations in mind.

## Operations on a CA for AWS IAM for agents and workloads
<a name="workload-identity-considerations-operations"></a>

The following table describes how AWS Private CA API operations behave on a CA with the AWS IAM for agents and workloads affiliation. Unless the table says otherwise, an operation that works on the primary CA also works on a replica, in the replica's Region.



| Operation | Behavior | 
| --- | --- | 
| [IssueCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html) | End-entity certificates are issued only through AWS Security Token Service (AWS STS), and only for workload identity providers that are associated with the CA. AWS STS issues them from the primary CA or from an `ACTIVE` replica in the workload's Region. The service affiliation limits the validity of issued certificates to at most one day. AWS STS issues workload certificates that are valid for 1 to 12 hours. You can issue only the CA's own certificate, to activate a root CA. | 
| [ImportCertificateAuthorityCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html) | Primary CA only, exactly once, to activate the CA. You can't import a CA certificate after that or on a replica, so you can't replace the CA certificate. AWS Private CA creates replicas with the CA certificate already installed. To change the CA certificate, create a new CA and rotate the workload identity provider to it in IAM. | 
| [UpdateCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_UpdateCertificateAuthority.html) | Changes only the status, to `ACTIVE` or `DISABLED`, on the primary CA and on each replica independently. You can't change the revocation configuration. You can't disable the primary CA while a replica is `CREATING`. | 
| [PutPolicy](https://docs.aws.amazon.com/privateca/latest/APIReference/API_PutPolicy.html)<br />[DeletePolicy](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeletePolicy.html) | You can't call these operations on the CA. | 
| [CreatePermission](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreatePermission.html)<br />[DeletePermission](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeletePermission.html) | Primary CA only. You can't call these operations on a replica, and a permission that you create on the primary CA applies in every Region. The principal must be the root principal of another AWS account. You can grant only `CreateCertificateAuthorityAssociation`, `DeleteCertificateAuthorityAssociation`, `DescribeCertificateAuthority`, and `GetCertificateAuthorityCertificate`. You can't grant `IssueCertificate` or `GetCertificate`. | 
| [TagCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_TagCertificateAuthority.html)<br />[UntagCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_UntagCertificateAuthority.html) | Per Region. Tags aren't replicated. To tag a replica, specify tags when you create it, or call `TagCertificateAuthority` in the replica's Region. | 
| [RevokeCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_RevokeCertificate.html)<br />[CreateCertificateAuthorityAuditReport](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html) | Not supported. | 
| [RestoreCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_RestoreCertificateAuthority.html) | Primary CA only, within its restoration period. You can't restore a replica. To bring back a deleted replica, create it again with `CreateCertificateAuthorityReplica`. | 
| [DeleteCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DeleteCertificateAuthority.html) | For a replica, call the operation in the replica's Region. Don't specify `PermanentDeletionTimeInDays`. If you do, the request fails with `ValidationException`. You can't delete a replica while it's `CREATING`. An `ACTIVE` replica must be `DISABLED` before you can delete it.<br />You can't delete the primary CA until every replica is `DELETED` or `FAILED`. Until then, the request fails with `ResourceInUseException`. You can still restore the primary CA for 7 to 30 days after you delete it, depending on the `PermanentDeletionTimeInDays` that you set. | 
| [CreateCertificateAuthorityReplica](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityReplica.html)<br />[BatchCreateCertificateAuthorityReplica](https://docs.aws.amazon.com/privateca/latest/APIReference/API_BatchCreateCertificateAuthorityReplica.html)<br />[ListCertificateAuthorityReplicas](https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorityReplicas.html) | These operations take the Amazon Resource Name (ARN) of the primary CA. Call them in the primary Region. `BatchCreateCertificateAuthorityReplica` creates replicas in up to 20 Regions in one call; `CreateCertificateAuthorityReplica` creates one. The primary CA must be `ACTIVE`. The target Region must differ from the primary Region and must be enabled for your account. For the permissions that these operations need, see [Prerequisites](PcaWorkloadIdentity-get-started.md#workload-identity-prerequisites). | 

## Quotas
<a name="workload-identity-considerations-quotas"></a>

A replica counts as one CA against the CA quota of its Region. If the target Region is at its quota, `CreateCertificateAuthorityReplica` fails with `LimitExceededException`. `BatchCreateCertificateAuthorityReplica` lists such a Region under `Failed` with the failure reason `LIMIT_EXCEEDED`. A CA with this affiliation has no lifetime quota on the number of certificates that it issues. For more information, see [AWS Private CA service quotas](PcaLimits.md).

## Cross-account use
<a name="workload-identity-considerations-cross-account"></a>

The workload identity provider and the workloads can be in a different AWS account from the CA. The following diagram shows three accounts in one organization in AWS Organizations and what each needs. The account that owns the CA runs the **create-permission** command for the account whose identity attaches the CA. A user or role in that account attaches the CA to the organization-level workload identity provider and needs the permissions for that action in its own identity policy. A workload in any account of the organization asks AWS STS for a certificate. When that account differs from the account that owns the CA, the workload's role needs the policy statement that lets AWS STS issue certificates from the CA.

If you attach the CA to an account-level provider in another account, that provider issues no certificates.

![Three accounts in one organization: the CA owner grants permissions, a role in the attaching account attaches the CA to the provider, and a workload requests a certificate from AWS STS.](https://docs.aws.amazon.com/privateca/latest/userguide/images/workload_identity_cross_account.png)


Workloads in a different account from the CA need an organization-level workload identity provider. The account that owns the CA and the accounts of the workloads must be in the same organization in AWS Organizations. An account-level provider serves only workloads in the account that owns the CA.

If the provider is in another account, the account that owns the CA grants the four grantable actions on the primary CA. The grantee is the root principal of the account whose identity attaches the CA. For an organization-level provider, that identity is in the organization's management account or in a delegated administrator account. For instructions on using the **create-permission** command, see [Step 4: Grant access to another account (cross-account only)](PcaWorkloadIdentity-get-started.md#workload-identity-cross-account). For the permissions that this identity needs in its own identity policy to attach or detach the CA, see [Prerequisites](PcaWorkloadIdentity-get-started.md#workload-identity-prerequisites).

If your workloads run in a different account from the CA, add the following statement to the identity policy of their IAM role. Replace the account ID and the CA ID with your own values.

```json
{
  "Sid": "LetSTSIssueFromTheCA",
  "Effect": "Allow",
  "Action": [
    "acm-pca:IssueCertificate",
    "acm-pca:GetCertificate"
  ],
  "Resource": "arn:aws:acm-pca:*:{{123456789012}}:certificate-authority/{{a1b2c3d4-5678-90ab-cdef-EXAMPLE11111}}",
  "Condition": {
    "Bool": {
      "aws:ViaAWSService": "true"
    }
  }
}
```

The Region wildcard in the `Resource` ARN covers the primary CA and every replica, because they share one CA ID. The `aws:ViaAWSService` condition limits the permission to requests that come through an AWS service, so the role can't call these operations directly. Workloads in the account that owns the CA don't need this statement.

For more information about cross-account access to a CA, see [Security best practices for Cross-account access to private CAs](pca-resource-sharing.md).

## No deletion protection
<a name="workload-identity-considerations-no-deletion-protection"></a>

The AWS IAM for agents and workloads affiliation doesn't protect the CA from deletion. With the AWS Private CA API, you can disable or delete a CA with this affiliation while it is still attached to a workload identity provider. For the console behavior, see [Service-affiliated CAs on the console](service-affiliated-cas.md#service-affiliated-cas-console). If you disable or delete the CA while it is attached, workloads that use the provider can no longer get certificates in the affected Regions.

Before you disable or delete the CA, detach it from the provider in IAM and confirm that the CA has no associations. Don't delete the CA's signer while certificates that the CA issued are still in use. After a rotation, don't disable the signer to remove the old CA, because disabling it also stops the new CA. For instructions, see [Tear down a CA for AWS IAM for agents and workloads](PcaWorkloadIdentity-teardown.md).

## Pricing
<a name="workload-identity-considerations-pricing"></a>

For the latest AWS Private CA pricing information, see [AWS Private Certificate Authority Pricing](https://aws.amazon.com/private-ca/pricing/). You can also use the [AWS pricing calculator](https://calculator.aws/#/createCalculator/certificateManager) to estimate costs. 