

# Set up and manage certificate actions

Certificate actions are part of your organization's inventory configuration. You turn them on and off with the `LifecycleManagement` member of `PutInventoryConfiguration`, and you read their state in `LifecycleManagement` in the `GetInventoryConfiguration` response. Send these requests to your organization's inventory home AWS Region.

**Topics**
+ [Prerequisites](#acm-certificate-actions-prereqs)
+ [Required IAM permissions](#acm-certificate-actions-permissions)
+ [Turn on certificate actions](#acm-certificate-actions-turn-on)
+ [Check configuration and provisioning status](#acm-certificate-actions-status)
+ [Accounts that join or leave the organization](#acm-certificate-actions-membership)
+ [Turn off certificate actions](#acm-certificate-actions-turn-off)

## Prerequisites
<a name="acm-certificate-actions-prereqs"></a>

Before you turn on certificate actions for organizations, check the following:
+ Your organization has an ACM plan. Both plans include certificate actions. The inventory includes your AWS Private CA resources only with the Pro plan. For more information, see [ACM plans](acm-plans.md).
+ Certificate inventory is turned on, or you turn it on in the same request. Turning on certificate actions while the inventory's `Status` is `DISABLED` fails with `ValidationException`. For more information, see [Set up and manage certificate inventory](acm-inventory-setup.md).
+ Trusted access for certificate inventory is turned on in AWS Organizations. Otherwise, member operations fail with `AccessDeniedException`.

The `management.acm.amazonaws.com` service principal has no separate trusted access or delegated administrator registration.

## Required IAM permissions
<a name="acm-certificate-actions-permissions"></a>

The principal that creates the service-linked role needs `iam:CreateServiceLinkedRole` for `management.acm.amazonaws.com`. The principal that turns certificate actions on or off needs `acm:PutInventoryConfiguration`, and a principal that reads their state needs `acm:GetInventoryConfiguration`. These can be different principals.

A caller of member operations needs the IAM action for each member operation that it calls. Every IAM action for certificate actions is in the `acm` namespace, including the actions that change AWS Private CA resources. For the list, see [ACM API permissions: Actions and resources reference](authen-apipermissions.md).

**Important**  
Certificate actions have no IAM action of their own to turn them on. Any principal that can call `PutInventoryConfiguration` can turn them on or off. Grant `acm:PutInventoryConfiguration` only to principals that you trust to allow changes in every account in your organization.

## Turn on certificate actions
<a name="acm-certificate-actions-turn-on"></a>

The management account or the delegated administrator turns on certificate actions in two steps:

1. In the management account, create the `AWSServiceRoleForCertificateManagerOrganizationManagement` service-linked role for `management.acm.amazonaws.com`. This role lets member operations act on resources in the management account. When you turn on certificate actions in the ACM console, the console creates the role with your credentials. If you use the API or the AWS CLI, create the role through IAM first.

1. From the inventory home Region, call `PutInventoryConfiguration` with your current configuration and `LifecycleManagement` set to `{"Status": "ENABLED"}`. You can do this in the same call that first turns on certificate inventory. That call must also set `InventoryTier` and come from the management account.

`PutInventoryConfiguration` replaces the scope and status settings, so send your current settings with the change. The following request body turns on certificate actions for an organization that already has certificate inventory turned on, and keeps the configuration from the example in [Turn on certificate inventory](acm-inventory-setup.md#acm-inventory-turn-on). To turn on both in your first call, add `InventoryTier`.

```json
{
  "RegionalScope": { "Mode": "EXCLUDE", "Regions": ["us-west-2"] },
  "AccountScope": {
    "Mode": "INCLUDE",
    "OrganizationalUnitIds": ["ou-ab12-cd345678"],
    "AccountIds": ["111122223333"]
  },
  "DataRetentionDays": 180,
  "Status": "ENABLED",
  "LifecycleManagement": { "Status": "ENABLED" }
}
```

The request doesn't name an administrator account. The delegated administrator is the account registered in AWS Organizations, and it can use certificate actions the same as the management account. If you register a different delegated administrator later, the new account can use them after it gets access, as described in [Who can use certificate inventory](acm-inventory.md#acm-inventory-who).

IAM and ACM authorize the two steps separately, so an IAM administrator can create the role and an ACM administrator can turn on certificate actions later. `PutInventoryConfiguration` doesn't check whether the management account's role exists.

The response returns the stored configuration. Its `LifecycleManagement` member is similar to the following:

```json
"LifecycleManagement": {
  "Status": "ENABLED",
  "ProvisioningStatus": "ENABLING"
}
```

A `ProvisioningStatus` of `ENABLING` means that ACM is asking AWS Organizations to create the service-linked role in the member accounts, including the delegated administrator account. Until the role in a target account is ready, including the management account's own role, member operations on that account's resources fail with `AccessDeniedException`.

After certificate actions are on, a later `PutInventoryConfiguration` call that leaves out `LifecycleManagement` keeps them on. Send `LifecycleManagement` only when you want to change it.

## Check configuration and provisioning status
<a name="acm-certificate-actions-status"></a>

Call `GetInventoryConfiguration` and read `LifecycleManagement` in the response. It's always returned, with a `Status` of `DISABLED` until you first turn certificate actions on. `Status` is the state that you asked for. `ProvisioningStatus` summarizes service-linked role setup across the active member accounts. It doesn't include the management account's role, which you create yourself.

The following table lists the possible `ProvisioningStatus` values for each `Status`.


| `Status` | Possible `ProvisioningStatus` values | 
| --- | --- | 
| `ENABLED` | `ENABLING`, `ENABLED`, `FAILED` | 
| `DISABLED` | `DISABLING`, `DISABLED`, `FAILED` | 
+ `ENABLING`: at least one active member account doesn't have a ready role. Member operations succeed for accounts whose roles are ready, and fail with `AccessDeniedException` for the others.
+ `ENABLED`: every active member account has a ready role.
+ `DISABLING`: ACM is applying your request to turn off certificate actions. The service-linked roles stay in your accounts.
+ `DISABLED`: certificate actions are off.
+ `FAILED`: setup or removal didn't complete in one or more member accounts. Roles that are ready stay usable. `ProvisioningStatusReason` gives the `Code` `INTERNAL_FAILURE` and a `Message` that says how many member accounts failed, such as "3 of 10 member accounts failed Management role provisioning".

To retry setup, send `LifecycleManagement` set to `{"Status": "ENABLED"}` again.

If trusted access is turned off later, `LifecycleManagement` keeps its stored values, and member operations fail with `AccessDeniedException` until trusted access is turned back on.

## Accounts that join or leave the organization
<a name="acm-certificate-actions-membership"></a>

When an account joins an organization that has certificate actions turned on, ACM asks AWS Organizations to create the service-linked role in that account. `ProvisioningStatus` returns to `ENABLING` until the new account's role is ready. ACM retries accounts whose role creation didn't complete.

When an account leaves the organization, ACM stops accepting member operations for its resources. The service-linked role stays in that account until its owner deletes it.

## Turn off certificate actions
<a name="acm-certificate-actions-turn-off"></a>

From the inventory home Region, call `PutInventoryConfiguration` with your current configuration and `LifecycleManagement` set to `{"Status": "DISABLED"}`.

```json
{
  "RegionalScope": { "Mode": "EXCLUDE", "Regions": ["us-west-2"] },
  "AccountScope": {
    "Mode": "INCLUDE",
    "OrganizationalUnitIds": ["ou-ab12-cd345678"],
    "AccountIds": ["111122223333"]
  },
  "DataRetentionDays": 180,
  "Status": "ENABLED",
  "LifecycleManagement": { "Status": "DISABLED" }
}
```

Turning off certificate inventory also turns off certificate actions at once, even though collection continues until your plan ends. You don't need to send `LifecycleManagement`. A request that sets the inventory's `Status` to `DISABLED` and `LifecycleManagement` to `ENABLED` fails with `ValidationException`.

After the change takes effect, ACM denies new member operations. The service-linked roles stay in your organization's accounts until each account owner deletes them. For more information, see [Service-linked role for certificate actions](acm-slr.md#slr-certificate-actions).