

# Secure workloads with AWS Private Certificate Authority and AWS IAM for agents

AWS Identity and Access Management (IAM) issues short-lived X.509 certificates for agent and workload identity through [AWS IAM for agents](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html). The certificate authority (CA) in AWS Private Certificate Authority (AWS Private CA) must be in the service-affiliated mode with the **AWS IAM for agents and workloads** service affiliation. You associate the CA with a workload identity provider by attaching the CA as the provider's X.509 outbound signer in IAM. The CA then issues certificates only for that provider's workloads, through AWS STS.

Each workload receives its certificate from the provider's X.509 outbound signer, in the AWS Region where the workload runs. For the certificate validity, see [Operations on a CA for AWS IAM for agents and workloads](PcaWorkloadIdentity-considerations.md#workload-identity-considerations-operations). Because issuance is Region-local, the CA is a multi-Region CA. You create the primary CA in the US East (N. Virginia) Region (`us-east-1`) and replicate it to every other Region where your workloads run. Each replica shares the ID, key material, and CA certificate of the primary CA.

**Note**  
AWS IAM for agents is in preview release and is subject to change.

This section covers the AWS Private CA side of the integration: creating, replicating, and deleting the CA. For instructions on creating a workload identity provider, attaching the CA as its X.509 outbound signer, and configuring workloads, see [Agent and workload identity](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*.

The following diagram shows how a CA for AWS IAM for agents and workloads issues certificates to your workloads. The flow has five steps.

1. You create and activate the primary CA in the US East (N. Virginia) Region (`us-east-1`).

1. You replicate the CA to each Region where your workloads run.

1. You attach the CA to the workload identity provider in IAM as its X.509 outbound signer.

1. A workload calls the AWS STS `GetCertificate` operation in its own Region.

1. AWS STS issues the certificate from the CA in that same Region.

In a Region with no `ACTIVE` copy of the CA, AWS STS issues no certificates.

![Five numbered boxes linked by arrows, from creating the primary CA to AWS STS issuing the certificate, with a note about Regions without an ACTIVE CA.](https://docs.aws.amazon.com/privateca/latest/userguide/images/workload_identity_flow.png)


The following terms describe the resources involved.

Workload identity provider  
The IAM resource through which your workloads receive their identities. A provider issues X.509 certificates only after you attach a CA to it as an X.509 outbound signer.

X.509 outbound signer  
The CA that signs the X.509 certificates for a provider's workloads. You attach a AWS Private CA CA to a provider as its X.509 outbound signer in IAM. A provider has one X.509 outbound signer for each key algorithm. To issue certificates with more than one key algorithm, such as RSA and ECDSA, attach a CA for each.  
IAM identifies the CA by the CA owner's AWS account ID and the CA ID, not by the CA's Amazon Resource Name (ARN). The ARN is specific to one AWS Region, but the provider is not. The CA ID is the same in every Region where the CA exists.  
You attach, disable, enable, and delete the signer in IAM, and you rotate the provider to a new CA there. For more information, see [Agent and workload identity](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*.

Associations  
An association links a service-affiliated CA to a resource of the affiliated service. For AWS IAM for agents and workloads, the associated resource is a workload identity provider, and attaching the CA as the provider's X.509 outbound signer creates the association. A CA can be associated with more than one provider.  
You don't call AWS Private CA to create associations. IAM creates the association when you attach the CA as the X.509 outbound signer of a workload identity provider, and removes it when you delete the signer. For the permissions that these actions need, see [Prerequisites](PcaWorkloadIdentity-get-started.md#workload-identity-prerequisites). For the sequence in which to detach, disable, and delete the CA, see [Tear down a CA for AWS IAM for agents and workloads](PcaWorkloadIdentity-teardown.md).  
In the console, the **Associations** tab of the CA details page lists the **Resource ARN** of each associated workload identity provider.

Primary CA and replicas  
A CA with the AWS IAM for agents and workloads affiliation is a multi-Region CA. The CA that you create in the US East (N. Virginia) Region (`us-east-1`) is the primary CA. A replica is a complete CA in another Region that shares the primary CA's ID, key material, CA certificate, and configuration. A replica's ARN differs from the primary CA's ARN only in the Region field, as the following example shows.  

```
arn:aws:acm-pca:us-east-1:{{123456789012}}:certificate-authority/{{a1b2c3d4-5678-90ab-cdef-EXAMPLE11111}}
arn:aws:acm-pca:us-west-2:{{123456789012}}:certificate-authority/{{a1b2c3d4-5678-90ab-cdef-EXAMPLE11111}}
```
Replication is your responsibility. IAM doesn't replicate the CA for you. You create replicas with [CreateCertificateAuthorityReplica](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityReplica.html) or [BatchCreateCertificateAuthorityReplica](https://docs.aws.amazon.com/privateca/latest/APIReference/API_BatchCreateCertificateAuthorityReplica.html), and you list them with [ListCertificateAuthorityReplicas](https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorityReplicas.html). All three operations take the ARN of the primary CA, and you call them in the primary Region.  
The [DescribeCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_DescribeCertificateAuthority.html) and [ListCertificateAuthorities](https://docs.aws.amazon.com/privateca/latest/APIReference/API_ListCertificateAuthorities.html) responses for a multi-Region CA include a `MultiRegionConfiguration` structure. Its `MultiRegionType` member is `PRIMARY` for the primary CA and `REPLICA` for a replica. The structure is absent for a single-Region CA.