

# Working with AWS Systems Manager Cloud Extensions profiles

An AWS Systems Manager Cloud Extensions profile stores extensions and their settings so that your resources can share them. A resource is a Lambda function or a container that runs the Cloud Extensions runtime. A profile contains two kinds of content:
+ **Profile entries** – Each profile entry adds one extension to the profile. In the entry, you choose which version of the extension to use and how to configure the extension.
+ **Extension defaults** – Values that apply to every extension in the profile, such as the IAM execution role and the authentication setting. You can override the IAM execution role for one extension in the profile entry of that extension.

A profile also has a name, a description, and tags.

You can create multiple profiles for different applications, different use cases, or different environments such as development and production. You can also combine these. For example, you can create one profile for each application in each environment. By default, an account can have 25 profiles in each AWS Region. This quota isn't adjustable.

**Topics**
+ [Understanding profiles](#cloud-extensions-profiles-understanding-profiles)
+ [Working with profiles on the console](#cloud-extensions-profiles-working-with-profiles-on-the-console)
+ [Creating a profile](#cloud-extensions-profiles-creating-a-profile)
+ [Setting extension defaults](#cloud-extensions-profiles-setting-extension-defaults)
+ [Connecting profiles to your resources](#cloud-extensions-profiles-connecting-profiles-to-your-resources)
+ [Finding extensions](#cloud-extensions-profiles-finding-extensions)
+ [Adding an extension to a profile](#cloud-extensions-profiles-adding-an-extension-to-a-profile)
+ [Approving capabilities](#cloud-extensions-profiles-approving-capabilities)
+ [Updating profile entries](#cloud-extensions-profiles-updating-profile-entries)
+ [Removing an extension from a profile](#cloud-extensions-profiles-removing-an-extension-from-a-profile)
+ [Viewing profiles](#cloud-extensions-profiles-viewing-profiles)
+ [Tagging profiles and profile entries](#cloud-extensions-profiles-tagging-profiles-and-profile-entries)
+ [Deleting profiles](#cloud-extensions-profiles-deleting-profiles)
+ [Stopping the use of Cloud Extensions](#cloud-extensions-profiles-stopping-the-use-of-cloud-extensions)
+ [Infrastructure as code](#cloud-extensions-profiles-infrastructure-as-code)
+ [Next steps](#cloud-extensions-profiles-next-steps)

## Understanding profiles
<a name="cloud-extensions-profiles-understanding-profiles"></a>

Cloud Extensions uses three kinds of resources:
+ **Extension** – A released, immutable package that AWS publishes. Each release has a semantic version, release notes, and a link to documentation. An extension declares the settings that you can configure, the capabilities that it requests, and the interfaces that it serves.
+ **Profile** – A named configuration context that holds profile entries and extension defaults.
+ **Profile entry** – The connection between one extension and one profile. In a given profile, you can add only one entry for each extension. You can't add the same extension to a profile twice.

A profile has the following properties:
+ **Name** – A name that you choose. The name must be unique in your account. A name contains 2 to 32 characters. It starts with a lowercase letter, and it contains only lowercase letters, numbers, hyphens, and underscores. A hyphen or an underscore can't be the last character or follow another hyphen or underscore. The same rule applies to the names of profile entries and to the name part of an extension ID.
+ **Description** – Text of up to 256 characters that describes the purpose or target environment of the profile.
+ **Extension defaults** – An IAM execution role and an authentication setting that apply to every extension in the profile. You can override a default for one extension by configuring the profile entry of that extension. For example, you can set a different IAM execution role in the entry.
+ **Tags** – Up to 50 key-value pairs.

A profile entry has the following properties:
+ **Version policy** – Controls which versions of the extension the entry tracks. For more information, see [Managing AWS Systems Manager Cloud Extensions updates](cloud-extensions-updates.md).
+ **Settings** – The values that you specify for the extension's settings.
+ **Capabilities that you approve** – The capabilities that the extension can use. For more information, see [Approving capabilities](#cloud-extensions-profiles-approving-capabilities).
+ **IAM execution role** – The IAM role that the extension assumes when it calls AWS services. You create the role. You attach permissions policies that allow the AWS actions that the extension needs to do its work. You add a trust policy that allows the role that the runtime runs as to assume the role.
+ **Tags** – Up to 50 key-value pairs.

In API operations and CLI commands, you can identify a profile or a profile entry by either its ID or its name. An ID contains 10 to 63 lowercase letters and numbers. You identify an extension by its ID, which has a namespace and a name, such as `aws:parameterstore`.

The Cloud Extensions runtime polls for profile changes every 45 seconds and applies them automatically. The runtime loads the profile that you name with the `--profile` option or, in Lambda, with the `AWS_CLOUDEXTENSIONS_PROFILE` environment variable.

## Working with profiles on the console
<a name="cloud-extensions-profiles-working-with-profiles-on-the-console"></a>

**To open the Cloud Extensions page**

1. Open the Systems Manager console at [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/).

1. In the navigation pane, choose **Cloud Extensions**.

The page has two tabs:
+ **Extension catalog** – Lists the extensions that you can add to a profile. To search the list, enter text in the **Find extensions** box. To add an extension, select it and choose **Add to profile**.
+ **Profiles** – Lists your profiles. For each profile, the tab shows the name, the number of extensions, and the time of the last update. The **Extensions** column shows a count, and a popover lists the extensions.

The **Get started** section at the top of the page has three steps:

1. **Create a profile** – Choose **Create profile**.

1. **Add extensions to the profile** – Choose **Add extension**. You choose extensions from the catalog and configure their settings.

1. **Connect the profile to your resources** – Your resources must point to the profile that you want them to use. To learn how, choose **Learn how to connect your compute resources**. The link opens [Configuring Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/extensions-configuration.html) in the *AWS Lambda Developer Guide*.

You can also give the setup prompt to your own AI agent, or ask the AWS assistant for help. Choose **Get setup prompt** or **Ask AWS assistant** in the **Or let your agent set it up** section. For more information, see [Setting up Cloud Extensions with an AI agent](cloud-extensions-getting-started.md#cloud-extensions-getting-started-setting-up-cloud-extensions-with-an-ai-agent).

### Creating a profile on the console
<a name="cloud-extensions-profiles-creating-a-profile-on-the-console"></a>

**To create a profile**

1. Open the **Cloud Extensions** page, as the previous procedure shows.

1. Choose **Create profile**.

1. On the **Add profile details** page, enter a **Name**. A name has 2 to 32 characters. Use lowercase letters, numbers, underscores, and hyphens. Start with a letter, and put each underscore or hyphen between letters or numbers. You can also enter a **Description** and add tags. Choose **Next**.

1. On the **Set runtime settings** page, choose the **Authentication**. The default is **IAM credentials**, which means that callers sign requests with the credentials of the compute resource. To use an access key instead, choose **Cloud Extensions access key**, and then choose a **Secret key** option. To turn authentication off, choose **None**. For the options, see [Changing the authentication settings on the console](cloud-extensions-security.md#cloud-extensions-security-changing-the-authentication-settings-on-the-console). Then choose the **Execution role**. The default is **Compute resource's role**. Choose **Next**.

1. On the **Add extension** page, select one extension. To add no extension now, choose **Skip to Review and create**. Choose **Next**.

1. If you selected an extension, the **Configure extension** page appears. Configure the extension, as [Configuring an extension on the console](#cloud-extensions-profiles-configuring-an-extension-on-the-console) shows, and then choose **Next**. If you selected no extension, the next page is **Review and create**.

1. On the **Review and create** page, review the details and the runtime settings, and then choose **Create profile**.

1. If you chose **Cloud Extensions access key** and **Generate secret**, the console shows the **Save your secret key** dialog. The dialog shows the access key ID and the secret key. The console shows the secret key only once. Copy the keys, or choose **Download CSV file**, and then choose **Done**.

After you create the profile, connect your compute resources to the profile.

### Viewing a profile on the console
<a name="cloud-extensions-profiles-viewing-a-profile-on-the-console"></a>

**To view a profile**

1. Open the **Cloud Extensions** page.

1. Choose the **Profiles** tab.

1. Choose the name of the profile.

The name and the description of the profile appear at the top of the page, with the **Delete** and **Add extension** buttons. The page shows the following content:
+ **Finish setup** – Steps that you might need to complete so that your extensions work as intended. Expand the section to read the steps. For more information, see [Finishing the setup of a profile on the console](#cloud-extensions-profiles-finishing-the-setup-of-a-profile-on-the-console).
+ **Details** – The properties of the profile. Expand the section to read them. To change the name or the description, choose **Edit**.
+ **Extensions** tab – The extensions in the profile. For each extension, the tab shows the name, the version, the update method, and a link to the usage guide. The tab has the **Remove**, **Edit**, and **Add extension** buttons, and a **Find extensions** box.
+ **Runtime settings** tab – The settings that every extension in the profile uses: the authentication and the execution role. To change the settings, choose **Edit**.
+ **Tags** tab – The tags of the profile. For more information, see [Managing tags on the console](#cloud-extensions-profiles-managing-tags-on-the-console).

### Finishing the setup of a profile on the console
<a name="cloud-extensions-profiles-finishing-the-setup-of-a-profile-on-the-console"></a>

The **Finish setup** section of a profile has the following steps:
+ **Step 1: Connect to your compute resources** – Add Cloud Extensions to your compute resources, and name this profile in each one. To learn how, choose **Learn how to connect your compute resources**, or choose **View connection instructions**.
+ **Step 2: Check permissions** – Check the IAM permissions that your compute resources need to use the extensions of the profile. Choose **Learn about the permissions extensions need**.
+ **Step 3: Finish extension setup** – Some extensions need more setup, such as a change in your code. Check the documentation of each extension.

### Adding an extension to a profile on the console
<a name="cloud-extensions-profiles-adding-an-extension-to-a-profile-on-the-console"></a>

**To add an extension to a profile**

1. Open the **Cloud Extensions** page.

1. On the **Extension catalog** tab, select the extension, and then choose **Add to profile**. You can also choose the name of an extension to open its page, and then choose **Add to profile**. Alternatively, open the profile, and then choose **Add extension**.

1. On the **Choose a profile** page, choose **Existing profile** and then choose the profile in **Profile**, or choose **New profile**. When you choose a profile, the page lists the extensions that the profile contains. Choose **Next**.

1. On the **Configure extension** page, configure the extension. For the steps, see [Configuring an extension on the console](#cloud-extensions-profiles-configuring-an-extension-on-the-console). Choose **Next**.

1. On the **Review and add** page, review the profile, the settings, and the capabilities. The page also lists what to do next. Choose **Add to profile**.

To read about an extension before you add it, open its page in the catalog. The page shows an overview, a usage guide, and the **Settings**, **Capabilities**, and **Versions** tabs. The **Versions** tab lists each version with its release time and release notes.

### Configuring an extension on the console
<a name="cloud-extensions-profiles-configuring-an-extension-on-the-console"></a>

The **Configure extension** page appears when you add an extension. The **Edit extension** page appears when you edit an extension. Both pages show the same content. The top of the page shows the name, the description, the latest version, and a link to the documentation of the extension. To configure the extension:

1. To choose how the extension updates, choose **Latest (recommended)** or **Specific version** under **Update method**. **Latest** gets new minor versions and patches as AWS releases them, but not a new major version. **Specific version** stays on the version that you choose. If you choose **Specific version**, choose the version. Changing the version resets the settings on the page to the values that the profile stores. For more information, see [Updating an extension on the console](cloud-extensions-updates.md#cloud-extensions-updates-updating-an-extension-on-the-console).

1. Under **Settings**, enter the values for the settings of the extension. A setting that has the label **optional** uses its default value when you leave the field empty. A required field that you leave empty shows the message **Enter a value.** To return every setting to its default value, choose **Reset to defaults**.

1. Some settings are groups, such as **Security** or **Cache**. The heading of a group shows a summary of the current values of its settings. Expand the group to change the settings.

1. Some settings add a capability. For example, the message **Adds capability: Save backups** appears next to a setting that makes the extension write files. Review each capability that your settings add.

1. Review the **Capabilities summary** at the end of the page. The table lists the capabilities that the extension requires or that your settings add. For each capability, the table shows the purpose, the scope, and the related settings. When you save, the console approves all of the capabilities in the summary. You don't approve each capability. The console doesn't show the path of a capability. To find the path for the CLI, run the `get-extension` command.

1. On the **Edit extension** page, choose **Save changes**. On the **Configure extension** page, choose **Next**.

You don't set authentication for an extension. You set authentication for the whole profile on the **Runtime settings** tab.

Resources that use the profile get the changes the next time that they start or receive an invocation, which can be right away.

For the settings of each extension, see the topic for the extension:
+ [Configuration options for the AWS AppConfig extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-appconfig-configuration.md)
+ [Configuration options for the Parameter Store extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-parameter-store-configuration.md)
+ [Configuration options for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-configuration.md)

### Editing or removing an extension in a profile on the console
<a name="cloud-extensions-profiles-editing-or-removing-an-extension-in-a-profile-on-the-console"></a>

**To change the settings or the version of an extension that a profile contains**

1. Open the profile, and then choose the **Extensions** tab.

1. Select the extension, and then choose **Edit**.

1. Change the settings. For the steps, see [Configuring an extension on the console](#cloud-extensions-profiles-configuring-an-extension-on-the-console).

**To remove an extension from a profile**

1. Open the profile, and then choose the **Extensions** tab.

1. Select the extension, and then choose **Remove**.

1. In the **Remove** dialog, read the warning. Compute resources that use the profile lose the extension the next time that they start or receive an invocation, which can be right away. Choose **Remove**.

The **Edit** and **Remove** buttons aren't available until you select an extension.

### Changing the runtime settings of a profile on the console
<a name="cloud-extensions-profiles-changing-the-runtime-settings-of-a-profile-on-the-console"></a>

The runtime settings are the extension defaults of the profile. The **Runtime settings** tab shows the **Authentication**, which is **IAM credentials** by default, and the **Execution role**, which is **Compute resource's role** by default. To change the settings:

1. Open the profile, and then choose the **Runtime settings** tab.

1. Choose **Edit**.

1. Change the authentication, the secret key, and the execution role. For the steps, see [Changing the authentication settings on the console](cloud-extensions-security.md#cloud-extensions-security-changing-the-authentication-settings-on-the-console) and [Choosing the execution role on the console](cloud-extensions-security.md#cloud-extensions-security-choosing-the-execution-role-on-the-console).

1. Choose **Save changes**.

### Managing tags on the console
<a name="cloud-extensions-profiles-managing-tags-on-the-console"></a>

The **Tags** tab of a profile shows the number of user tags and the number of system tags. The tab lists your tags in a table of keys and values. To find a tag, enter text in the **Search tags** box. The **System tags** section lists the tags that start with `aws:`. The system applies and updates these tags, and you can't manage them.

**To add or delete tags**

1. Open the profile, and then choose the **Tags** tab.

1. Choose **Manage user tags**.

1. To add a tag, choose **Add new tag**, and then enter a key and a value. To delete a tag, choose the delete icon in its row. The page shows how many more tags you can add. A profile can have up to 50 tags.

1. Choose **Review tag changes**.

1. In the **Review summary of tag changes** dialog, review the changes. Each row shows the key, the value, and the action, such as **New Tag added**. Choose **Confirm and apply tag changes**. To return to the page, choose **Go back**.

### Deleting a profile on the console
<a name="cloud-extensions-profiles-deleting-a-profile-on-the-console"></a>

**To delete a profile**

1. Open the profile, and then choose **Delete**.

1. In the **Delete profile** dialog, read the warning. Compute resources that name the profile stop getting its extensions the next time that they start or receive an invocation.

1. In the text box, enter `confirm`. The **Delete** button isn't available until you do.

1. Choose **Delete**.

You can't undo the deletion. The sections that follow show the same tasks with the AWS CLI.

## Creating a profile
<a name="cloud-extensions-profiles-creating-a-profile"></a>

To create a profile, run the following command:

```bash
aws cloudextensions create-profile \
  --name my-application \
  --description "Profile for my production application" \
  --tags Environment=production,Application=checkout-service
```

The command returns the profile ID, name, ARN, description, tags, and extension defaults. Use a name that's unique in your account. If a profile with that name exists, the command fails with a `ConflictException` error.

## Setting extension defaults
<a name="cloud-extensions-profiles-setting-extension-defaults"></a>

Extension defaults apply to every extension in the profile, unless the profile entry of an extension sets a different value. You can set the following defaults:
+ **executionRole** – The ARN of the IAM execution role that extensions assume when they call AWS services. You create the role. You attach permissions policies that allow the AWS actions that the extensions need to do their work. You add a trust policy that allows the role that the runtime runs as to assume the role.
+ **interfaceDefaults** – The defaults for the interfaces of the extensions. For an HTTP interface, you set the authentication in `interfaceDefaults.http.authentication`. The value is `runtimeCredentials`, `extensionKey`, or `none`. If you don't set a value, the profile uses `runtimeCredentials`. For more information, see [Authentication](cloud-extensions-security.md#cloud-extensions-security-authentication).

To set the execution role, run the following command:

```bash
aws cloudextensions update-profile \
  --identifier my-application \
  --extension-defaults '{
    "executionRole": "arn:aws:iam::111122223333:role/CloudExtensionsExecutionRole"
  }'
```

The `update-profile` command merges the extension defaults that you provide with the current defaults. A value that you leave out stays the same. A new `executionRole` replaces the current role, and an empty string removes the role. For authentication, a value of the same kind merges into the current setting. For example, an `extensionKey` value with only a secret key changes the secret key. A value of a different kind switches the profile to that kind. An empty `authentication` object resets the profile to runtime credentials.

## Connecting profiles to your resources
<a name="cloud-extensions-profiles-connecting-profiles-to-your-resources"></a>

A profile affects only the resources that point to it. A resource is a Lambda function or a container that runs the Cloud Extensions runtime. Point each resource to the profile that you want it to use. Many resources can share one profile. Cloud Extensions doesn't record which resources use a profile.
+ **Lambda** – Set the `AWS_CLOUDEXTENSIONS_PROFILE` environment variable of the function to the name or ID of the profile.
+ **Containers** – Pass the `--profile` option to the runtime. The entrypoint of the image is the runtime, so you add the option to the command of the container.

If the profile that you name doesn't exist, the runtime keeps running with nothing loaded. The runtime logs the error `initial profile retrieval failed`, and every call to an extension returns HTTP 502 with the reason `PROFILE_NOT_FOUND`.

The runtime checks for profile changes every 45 seconds. In a container, a change applies within about 45 seconds. In Lambda, the runtime runs only during invocations. A change applies in the first invocation after the 45 seconds pass. A new execution environment loads the current profile when it starts.

Each Lambda execution environment runs its own runtime with its own in-memory cache. Execution environments don't share a cache. The time that an execution environment spends frozen counts toward the cache time to live of an extension.

The role that the runtime runs as needs the `cloudextensions:SyncState` action. For more information, see [Permissions for the runtime](cloud-extensions-security.md#cloud-extensions-security-permissions-for-the-runtime), [IAM execution role](cloud-extensions-security.md#cloud-extensions-security-iam-execution-role), and [Approving capabilities](#cloud-extensions-profiles-approving-capabilities).

## Finding extensions
<a name="cloud-extensions-profiles-finding-extensions"></a>

To list the released extensions, run the following command:

```bash
aws cloudextensions list-extensions
```

The command returns the latest version of each extension. Each item includes the extension ID, name, ARN, version, description, documentation link, release notes, and release time. To filter by name, use the `--name` option.

To see the settings, capabilities, and interfaces that an extension declares, run the following command:

```bash
aws cloudextensions get-extension --identifier aws:parameterstore
```

The command returns the latest version by default. To get a specific version, use the `--extension-version` option.

To list all released versions of an extension, run the following command:

```bash
aws cloudextensions list-extension-versions --identifier aws:parameterstore
```

To list only the versions that match a version selector, use the `--version-selector` option.

## Adding an extension to a profile
<a name="cloud-extensions-profiles-adding-an-extension-to-a-profile"></a>

To add an extension to a profile, create a profile entry:

```bash
aws cloudextensions create-profile-entry \
  --profile-identifier my-application \
  --extension-identifier aws:parameterstore \
  --version-policy updateStrategy=AUTOMATIC,versionSelector=1.x.x \
  --settings file://settings.json \
  --approve {{capability-path}} {{capability-path}}
```

Use the ID of an extension that exists, such as `aws:parameterstore`. You can add an extension to a profile only once. Otherwise, the command fails with an error. The command returns the profile entry, including these fields:
+ **effectiveSettings** – The setting values that the extension uses, including default values that you didn't set.
+ **approved** – The capabilities that you approved.
+ **inherited** – The profile defaults that apply to the entry.

Cloud Extensions validates the settings that you provide against the setting definitions that the extension declares.

### Overriding profile defaults
<a name="cloud-extensions-profiles-overriding-profile-defaults"></a>

A profile entry can use values that differ from the extension defaults of the profile. The values in the entry apply to that extension only. For example, to use a different IAM execution role for one extension, set the `--execution-role` option in the entry. The following example sets a different IAM execution role:

```bash
aws cloudextensions create-profile-entry \
  --profile-identifier my-application \
  --extension-identifier aws:secretsmanager \
  --execution-role arn:aws:iam::111122223333:role/SecretsExtensionRole
```

### Interfaces of the extensions
<a name="cloud-extensions-profiles-interfaces-of-the-extensions"></a>

An extension declares the interfaces that it serves. Each interface has an ID and a base path. You can't change the base path of an interface. If you set a base path, the request fails with a `ValidationException`, and the error has the problem `BASE_PATH_LOCKED`. The following table lists the interfaces of the extensions in this guide:


| Extension | Interface ID | Base path | What the interface serves | 
| --- | --- | --- | --- | 
| AWS AppConfig | `extensionSdk` | `/appconfig` | The operations of the AWS AppConfig extension | 
| Parameter Store | `extensionSdk` | `/parameterstore` | The operations of the Parameter Store extension | 
| Secrets Manager | `workloadProvider` | `/secretsmanager` | The `get?secretId=` query API of the AWS Secrets Manager Agent | 
| Secrets Manager | `vault` | `/v1` | Path-style requests, `/{secretId}`, that are compatible with the Vault-style path of the agent and the `X-Vault-Token` header | 
| Secrets Manager | `serviceSdk` | `/secretsmanager` | The Secrets Manager `GetSecretValue` operation | 

### Using FIPS and dual-stack endpoints
<a name="cloud-extensions-profiles-using-fips-and-dual-stack-endpoints"></a>

FIPS and dual-stack endpoints for the AWS services that an extension calls follow the standard AWS SDK settings. Set the `AWS_USE_FIPS_ENDPOINT` and `AWS_USE_DUALSTACK_ENDPOINT` environment variables, or set `use_fips_endpoint` and `use_dualstack_endpoint` in the AWS config file. The profile entry has no setting for these endpoints.

## Approving capabilities
<a name="cloud-extensions-profiles-approving-capabilities"></a>

An extension declares the capabilities that it requests. Each capability is an action that the extension performs in the host environment, and each capability is one of the following types:
+ **aws** – A request to call specific operations of specific AWS services.
+ **filesystem** – A request to read or write files and directories on the host.
+ **exec** – A request to run a command on the host.

Each capability states why the extension requests it and whether the extension requires it. An extension can use a capability only after you approve the capability. To approve capabilities, pass their paths in the `--approve` option when you create or update a profile entry.

### Reviewing capabilities
<a name="cloud-extensions-profiles-reviewing-capabilities"></a>

To review the capabilities of an extension before you approve them, run the `get-extension` command and read the `configuration.capabilities` field of the output:

```bash
aws cloudextensions get-extension \
  --identifier aws:parameterstore \
  --query 'configuration.capabilities'
```

Each capability includes an ID, a purpose, a flag that shows whether the extension requires the capability, and a definition. Settings of type group can also declare capabilities. Review the purpose and the definition of each capability, and approve only the capabilities that your use case needs.

### Approving capabilities for a profile entry
<a name="cloud-extensions-profiles-approving-capabilities-for-a-profile-entry"></a>

To approve capabilities for an existing profile entry, run the following command:

```bash
aws cloudextensions update-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}} \
  --approve {{capability-path}} {{capability-path}}
```

A capability path identifies one capability instance that the extension declares. A path consists of the capability ID, prefixed by the IDs of any enclosing setting groups and by array indexes, separated by periods. The `--approve` option sets the complete list of capabilities that you approve. An update replaces the approvals that Cloud Extensions stored, so include every capability that you want to keep. To revoke an optional capability, send the list without it. An empty list revokes every capability that you can revoke. You can't revoke a required capability. The update fails in the same way as creating the entry without that capability. You can approve up to 100 capabilities for a profile entry.

If you don't approve a required capability, the request fails with a `ValidationException`. The error has the problem `REQUIRED_CAPABILITY_REQUIRES_APPROVAL`, and it names the path. A path that the extension doesn't declare fails with the problem `UNKNOWN_CAPABILITY`. If you change a setting that an approved capability depends on, approve the capability again. Otherwise, the request fails with the problem `CHANGED_SETTING_REQUIRES_REAPPROVAL`.

To see the capabilities that you approved, run the `get-profile-entry` command and read the `approved` field.

## Updating profile entries
<a name="cloud-extensions-profiles-updating-profile-entries"></a>

The `update-profile-entry` command changes only the fields that you provide. For `--identifier`, use the ID or the name of the profile entry. To change the settings of an extension, run the following command:

```bash
aws cloudextensions update-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}} \
  --settings file://settings.json
```

The runtime detects the change during its next poll, which occurs every 45 seconds by default.

To find the ID of a profile entry, list the entries of the profile:

```bash
aws cloudextensions list-profile-entries --profile-identifier my-application
```

To list only the entry for one extension, use the `--extension-name` option.

To view the details of one entry, run the following command:

```bash
aws cloudextensions get-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}}
```

## Removing an extension from a profile
<a name="cloud-extensions-profiles-removing-an-extension-from-a-profile"></a>

To remove an extension from a profile, delete the profile entry:

```bash
aws cloudextensions delete-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}}
```

The command removes the connection between the extension and the profile. The runtime stops the extension after its next poll.

## Viewing profiles
<a name="cloud-extensions-profiles-viewing-profiles"></a>

To list the profiles in your account, run the following command:

```bash
aws cloudextensions list-profiles
```

To filter the list by name, use the `--name` option. To view one profile, run the following command:

```bash
aws cloudextensions get-profile --identifier my-application
```

List commands return results in pages. Use the `--max-results` option to set the page size from 1 to 100 items. The `--next-token` option returns the next page.

## Tagging profiles and profile entries
<a name="cloud-extensions-profiles-tagging-profiles-and-profile-entries"></a>

You can tag profiles and profile entries. Use the ARN of the resource to manage tags:

```bash
aws cloudextensions tag-resource \
  --resource-arn {{profile-arn}} \
  --tags Environment=production
aws cloudextensions list-tags-for-resource --resource-arn {{profile-arn}}
aws cloudextensions untag-resource \
  --resource-arn {{profile-arn}} \
  --tag-keys Environment
```

A resource can have up to 50 tags. A tag key contains 1 to 128 characters, and a tag value contains up to 256 characters.

## Deleting profiles
<a name="cloud-extensions-profiles-deleting-profiles"></a>

To delete a profile, run the following command:

```bash
aws cloudextensions delete-profile --identifier my-application
```

Deleting a profile also deletes its profile entries.

## Stopping the use of Cloud Extensions
<a name="cloud-extensions-profiles-stopping-the-use-of-cloud-extensions"></a>

**To stop using Cloud Extensions, point your application back at the AWS services, and remove the runtime**

1. Change your application so that it calls the AWS services instead of the local endpoint of the runtime. If the application must keep working during the change, do this step first. After you remove the runtime, any call to the local endpoint fails.

1. Remove the runtime:
   + **Lambda** – Remove the Cloud Extensions layer and the `AWS_CLOUDEXTENSIONS_` environment variables from the function.
   + **Containers** – Remove the container of the runtime from your container definition. If you used the runtime image as a base image, build your image from a different base image.

1. Delete the profiles that you no longer need. For the steps, see the preceding section.

Cloud Extensions doesn't create resources in your account. You can delete the resources that you created for your extensions when you no longer need them. These resources include the secrets for extension keys, the IAM execution roles, and the `cloudextensions:SyncState` permission of the role of your function or container. The logs and metrics in CloudWatch stay under your retention settings.

## Infrastructure as code
<a name="cloud-extensions-profiles-infrastructure-as-code"></a>

The AWS CloudFormation resource types `AWS::CloudExtensions::Profile` and `AWS::CloudExtensions::ProfileEntry` create profiles and profile entries. The properties mirror the API, in Pascal case.

The `AWS::CloudExtensions::Profile` resource type has the following properties:
+ `Name` - Required.
+ `Description`
+ `ExtensionDefaults` - The execution role and the defaults for the interfaces. Set the authentication in `ExtensionDefaults.InterfaceDefaults.Http.Authentication`, with exactly one of the following properties:
  + `None` - A Boolean value that turns authentication off.
  + `RuntimeCredentials` - An empty object. Clients sign requests with the AWS credentials that the runtime has.
  + `ExtensionKey` - An access key ID and a secret key. `AccessKeyId` is read-only, and it has `CXEK` and 16 more characters. For `SecretKey`, set exactly one of `Literal` or `Reference`. `Literal` is write-only, and it has 16 to 36 characters: a-z, A-Z, 0-9, and hyphens. `Reference` is the ARN of a Secrets Manager secret. To have Cloud Extensions generate the secret key, omit `SecretKey`.

  When you omit the authentication, clients sign requests with runtime credentials.
+ `Tags`

You can't set the `Arn` and `Id` of a profile. The `Arn` identifies the resource.

The `AWS::CloudExtensions::ProfileEntry` resource type has the following properties:
+ `ProfileId` - Required. You set this property only when you create the entry.
+ `ExtensionId` - Required. You set this property only when you create the entry.
+ `ExecutionRole`
+ `VersionPolicy`
+ `Settings` - Write-only.
+ `Approve`
+ `Interfaces` - One item for each interface of the extension.
+ `Tags`

You can't set the `Arn`, `Id`, `ProfileName`, `ExtensionName`, `Approved`, `EffectiveSettings`, and `Inherited` properties of a profile entry. Cloud Extensions sets them. `Inherited` returns the defaults that the entry inherits from its profile.

The Lambda function examples of the [Lambda function example for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-lambda-example.md) and the [Lambda function example for the AWS AppConfig extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-appconfig-lambda-example.md) include AWS CloudFormation templates. The templates create a function and its permissions. They don't create profiles or profile entries.

## Next steps
<a name="cloud-extensions-profiles-next-steps"></a>
+ [Managing AWS Systems Manager Cloud Extensions updates](cloud-extensions-updates.md)
+ [Security in AWS Systems Manager Cloud Extensions](cloud-extensions-security.md)
+ [Monitoring AWS Systems Manager Cloud Extensions](cloud-extensions-monitoring.md)
+ [Troubleshooting AWS Systems Manager Cloud Extensions](cloud-extensions-troubleshooting.md)