# mulesoft Amazon Secrets Manager Properties Provider - Full Documentation
---
product: Amazon Secrets Manager Properties Provider
version: 1.0
---
# Amazon Secrets Manager Properties Provider 1.0
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
For information about compatibility and fixed issues, refer to the Amazon Secrets Manager Properties
Provider Release Notes.
## Before You Begin
To use this properties provider, you must be familiar with:
- AWS Secrets Manager
- Anypoint Connectors
- Mule runtime engine (Mule)
- Elements and global elements in a Mule flow
- How to create a Mule app using Anypoint Studio
Before creating an app, you must have:
- Mule Enterprise Edition
- Credentials to access the AWS Secrets
- Anypoint Platform
- Anypoint Studio or Anypoint Code Builder
## Common Use Cases for the Properties Provider
With AWS Secrets Manager Properties Provider, you can:
- Configure values from AWS Secrets Manager for Mule applications.
- Retrieve secrets for SaaS applications as part of the source or operation.
- Specify the name of the secret to retrieve.
- Authenticate to AWS using the available options from the AWS SDK IAM, default provider chain, or
Basic Authentication.
- Specify the AWS server or region to connect to the appropriate server for your business unit.
- Be notified about errors while connecting to AWS.
- Be notified about errors while retrieving secrets from AWS.
## See Also
- [Amazon Secrets Manager Properties Provider Examples](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.0/amazon-secrets-manager-examples)
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange)
- [Amazon Secrets Manager Properties Provider Reference](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.0/amazon-secrets-manager-properties-provider-reference)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.0
---
# Amazon Secrets Manager Properties Provider 1.0 Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
## Configuration
Default Configuration for Amazon Secrets Manager Properties Provider.
| Name | Type | Description | Default Value | Required |
|---|
Name | | Name for this configuration. Connectors reference the configuration with this name. | | |
Expiration Policy | | Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the instance expires at the exact moment that it becomes eligible. Mule purges the instances as appropriate. | | |
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |
## Types
### Expiration Policy
| Field | Type | Description | Default Value | Required |
|---|
Max Idle Time | | Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. | | |
Time Unit | NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS
| Time unit for the Max Idle Time field. | | |
## Limitations
Amazon Secrets Manager Properties Provider doesn’t support the use of property files for the
configuration of the properties provider.
## Environment Variables
If you do not provide the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
values in the configuration, Amazon Secrets Manager Properties Provider uses the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html)
to resolve credentials and the region from the runtime environment. This capability enables you to
avoid hardcoding AWS credentials in the Mule app configuration.
Use the following environment variables to configure the behavior of Amazon Secrets Manager
Properties Provider from the environment instead of specifying parameters in the Mule app
configuration:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN` (required only when using temporary credentials)
- `AWS_REGION`
These variables are stored in secure configuration files with the values encrypted. During
execution, the runtime decrypts these values and they remain in memory in their decrypted state. For
more information, refer to [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).
Alternatively, you can set the equivalent Java system properties: `aws.accessKeyId`,
`aws.secretAccessKey`, `aws.sessionToken`, and `aws.region`. For the full list of credential sources
and the order in which they are evaluated, refer to the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
### Authenticate Through Environment Variables
To authenticate to Amazon Secrets Manager using environment variables, set the following environment
variables:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_REGION`
Refer to [Setting Environment Variables](https://docs.mulesoft.com/mule-runtime/latest/setting-environment-variables)
for details.
If you do not set the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
attributes in the configuration, the properties provider uses the values from the environment
variables.
In the XML configuration, you can omit the credential attributes when you rely on environment
variables:
```xml
```
If the properties provider cannot resolve credentials or the region from the configuration,
environment variables, or any other source in the default credentials provider chain, the Mule app
fails to start.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.1
---
# Amazon Secrets Manager Properties Provider 1.1
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
For information about compatibility and fixed issues, refer to the Amazon Secrets Manager Properties
Provider Release Notes.
## Before You Begin
To use this properties provider, you must be familiar with:
- AWS Secrets Manager
- Anypoint Connectors
- Mule runtime engine (Mule)
- Elements and global elements in a Mule flow
- How to create a Mule app using Anypoint Studio
Before creating an app, you must have:
- Mule Enterprise Edition
- Credentials to access the AWS Secrets
- Anypoint Platform
- Anypoint Studio or Anypoint Code Builder
## Common Use Cases for the Properties Provider
With AWS Secrets Manager Properties Provider, you can:
- Configure values from AWS Secrets Manager for Mule applications.
- Retrieve secrets for SaaS applications as part of the source or operation.
- Specify the name of the secret to retrieve.
- Authenticate to AWS using the available options from the AWS SDK IAM, default provider chain, or
Basic Authentication.
- Specify the AWS server or region to connect to the appropriate server for your business unit.
- Be notified about errors while connecting to AWS.
- Be notified about errors while retrieving secrets from AWS.
## See Also
- [Amazon Secrets Manager Properties Provider Examples](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.1/amazon-secrets-manager-examples)
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange)
- [Amazon Secrets Manager Properties Provider Reference](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.1/amazon-secrets-manager-properties-provider-reference)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.1
---
# Amazon Secrets Manager Properties Provider 1.1 Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
## Configuration
Default Configuration for Amazon Secrets Manager Properties Provider.
| Name | Type | Description | Default Value | Required |
|---|
Name | | Name for this configuration. Connectors reference the configuration with this name. | | |
Expiration Policy | | Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the instance expires at the exact moment that it becomes eligible. Mule purges the instances as appropriate. | | |
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |
External ID | | The External ID is used to prevent the confused deputy problem when assuming a role in another account. | | |
## Types
### Expiration Policy
| Field | Type | Description | Default Value | Required |
|---|
Max Idle Time | | Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. | | |
Time Unit | NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS
| Time unit for the Max Idle Time field. | | |
## Limitations
Amazon Secrets Manager Properties Provider doesn’t support the use of property files for the
configuration of the properties provider.
## Environment Variables
If you do not provide the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
values in the configuration, Amazon Secrets Manager Properties Provider uses the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html)
to resolve credentials and the region from the runtime environment. This capability enables you to
avoid hardcoding AWS credentials in the Mule app configuration.
Use the following environment variables to configure the behavior of Amazon Secrets Manager
Properties Provider from the environment instead of specifying parameters in the Mule app
configuration:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN` (required only when using temporary credentials)
- `AWS_REGION`
These variables are stored in secure configuration files with the values encrypted. During
execution, the runtime decrypts these values and they remain in memory in their decrypted state. For
more information, refer to [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).
Alternatively, you can set the equivalent Java system properties: `aws.accessKeyId`,
`aws.secretAccessKey`, `aws.sessionToken`, and `aws.region`. For the full list of credential sources
and the order in which they are evaluated, refer to the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
### Authenticate Through Environment Variables
To authenticate to Amazon Secrets Manager using environment variables, set the following environment
variables:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_REGION`
Refer to [Setting Environment Variables](https://docs.mulesoft.com/mule-runtime/latest/setting-environment-variables)
for details.
If you do not set the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
attributes in the configuration, the properties provider uses the values from the environment
variables.
In the XML configuration, you can omit the credential attributes when you rely on environment
variables:
```xml
```
If the properties provider cannot resolve credentials or the region from the configuration,
environment variables, or any other source in the default credentials provider chain, the Mule app
fails to start.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.2
is-latest-version: true
---
# Amazon Secrets Manager Properties Provider 1.2
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
For information about compatibility and fixed issues, refer to the Amazon Secrets Manager Properties
Provider Release Notes.
## Before You Begin
To use this properties provider, you must be familiar with:
- AWS Secrets Manager
- Anypoint Connectors
- Mule runtime engine (Mule)
- Elements and global elements in a Mule flow
- How to create a Mule app using Anypoint Studio
Before creating an app, you must have:
- Mule Enterprise Edition
- Credentials to access the AWS Secrets
- Anypoint Platform
- Anypoint Studio or Anypoint Code Builder
## Common Use Cases for the Properties Provider
With AWS Secrets Manager Properties Provider, you can:
- Configure values from AWS Secrets Manager for Mule applications.
- Retrieve secrets for SaaS applications as part of the source or operation.
- Specify the name of the secret to retrieve.
- Authenticate to AWS using the available options from the AWS SDK IAM, default provider chain, or
Basic Authentication.
- Specify the AWS server or region to connect to the appropriate server for your business unit.
- Route AWS Secrets Manager and AWS STS calls through custom endpoints, such as an AWS VPC interface
endpoint (AWS PrivateLink) or a local testing service such as LocalStack.
- Be notified about errors while connecting to AWS.
- Be notified about errors while retrieving secrets from AWS.
## See Also
- [Amazon Secrets Manager Properties Provider Examples](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/latest/amazon-secrets-manager-examples)
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange)
- [Amazon Secrets Manager Properties Provider Reference](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/latest/amazon-secrets-manager-properties-provider-reference)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.2
is-latest-version: true
---
# Amazon Secrets Manager Properties Provider 1.2 Reference
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
Amazon Secrets Manager Properties Provider is a configuration that enables you to retrieve your
secrets from Amazon Secrets Manager cloud service before your Mule app runs.
## Configuration
Default Configuration for Amazon Secrets Manager Properties Provider.
| Name | Type | Description | Default Value | Required |
|---|
Name | | Name for this configuration. Connectors reference the configuration with this name. | | |
Expiration Policy | | Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the instance expires at the exact moment that it becomes eligible. Mule purges the instances as appropriate. | | |
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Custom Endpoint URL | | Custom endpoint URL that overrides the default regional AWS Secrets Manager endpoint. Use this field to route Secrets Manager calls through an AWS VPC interface endpoint (AWS PrivateLink) or to a local testing service such as LocalStack, for example, http://localhost:4566. When unset, the connector uses the default regional AWS endpoint. | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |
External ID | | The External ID is used to prevent the confused deputy problem when assuming a role in another account. | | |
STS Endpoint URL | | Custom endpoint URL that overrides the default regional AWS STS endpoint used when assuming a role. Configure this field independently of Custom Endpoint URL to route AWS STS calls through a separate VPC interface endpoint. When unset, the connector uses the default regional AWS STS endpoint. | | |
## Types
### Expiration Policy
| Field | Type | Description | Default Value | Required |
|---|
Max Idle Time | | Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. | | |
Time Unit | NANOSECONDS MICROSECONDS MILLISECONDS SECONDS MINUTES HOURS DAYS
| Time unit for the Max Idle Time field. | | |
## Limitations
- Amazon Secrets Manager Properties Provider doesn’t support the use of property files for the
configuration of the properties provider.
- The **Custom Endpoint URL** value applies to all secrets retrieved by a given configuration. To
retrieve secrets from different endpoints, configure multiple `config` elements with distinct
names.
- Endpoint validation checks syntax only. Unreachable endpoints aren’t detected at deployment time
and instead fail when a secret is first resolved.
## Environment Variables
If you do not provide the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
values in the configuration, Amazon Secrets Manager Properties Provider uses the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html)
to resolve credentials and the region from the runtime environment. This capability enables you to
avoid hardcoding AWS credentials in the Mule app configuration.
Use the following environment variables to configure the behavior of Amazon Secrets Manager
Properties Provider from the environment instead of specifying parameters in the Mule app
configuration:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_SESSION_TOKEN` (required only when using temporary credentials)
- `AWS_REGION`
These variables are stored in secure configuration files with the values encrypted. During
execution, the runtime decrypts these values and they remain in memory in their decrypted state. For
more information, refer to [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).
Alternatively, you can set the equivalent Java system properties: `aws.accessKeyId`,
`aws.secretAccessKey`, `aws.sessionToken`, and `aws.region`. For the full list of credential sources
and the order in which they are evaluated, refer to the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
### Authenticate Through Environment Variables
To authenticate to Amazon Secrets Manager using environment variables, set the following environment
variables:
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_REGION`
Refer to [Setting Environment Variables](https://docs.mulesoft.com/mule-runtime/latest/setting-environment-variables)
for details.
If you do not set the **AWS Access Key**, **AWS Secret Key**, or **AWS Secrets Manager Region**
attributes in the configuration, the properties provider uses the values from the environment
variables.
In the XML configuration, you can omit the credential attributes when you rely on environment
variables:
```xml
```
If the properties provider cannot resolve credentials or the region from the configuration,
environment variables, or any other source in the default credentials provider chain, the Mule app
fails to start.
## See Also
- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.0
---
# Amazon Secrets Manager Properties Provider Examples
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The following examples enable you how to configure Amazon Secrets Manager Properties Provider to
retrieve your secrets from Amazon Secrets Manager cloud service
> [!NOTE] When using dynamic configurations (such as `#[]`), the configuration lifecycle differs
> significantly from static configurations (such as `${}`). For more information, see
> [Dynamic Configuration Lifecycle](https://docs.mulesoft.com/mule-sdk/latest/static-dynamic-configs#dynamic-configuration-lifecycle).
## Configure AWS Connection Types
Anypoint Connectors can use Amazon Secrets Manager Properties Provider in their configurations. The
following example illustrates how to configure the AWS connection type in the **AWS Secrets Manager
Properties Override Config** of Anypoint Studio:
1. In Studio, navigate to the **Global Elements** tab.
2. Click **Create**.
3. In the **Choose Global Type** window, type `AWS Secrets Manager`.
4. Select **AWS Secrets Manager Properties Override Config**.
5. Click **OK**.
6. In the **Global Element Properties** window, you can configure the following fields:
| Name | Type | Description | Default Value | Required |
|---|
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
If you do not provide credentials, the default AWS connection follows the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
This chain enables you to supply AWS credentials and the region through runtime environment
variables (for example, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION`) instead of
hardcoding them in the Mule app configuration. For the list of supported environment variables and a
configuration example, see
[Environment Variables](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.0/amazon-secrets-manager-properties-provider-reference#environment-variables).
## Configure AWS Secrets Manager Using a JSON String
The following example shows how to configure the Amazon Secrets Manager Properties Provider for
Amazon S3 Connector by using a JSON string where you create the secret manager keys.
Based on a JSON file that contains `accessKey` and `secretKey`:
aws secretsmanager create-secret --name aws-credentials --secret-string '{"accessKey":"ACCESSKEY",
"secretKey":"SECRET"}'
1. In the **Amazon S3 Configuration** global element properties window, select **fx** to set
expression values.
2. Set **Access Key** to `${aws-secrets::aws-credentials}.accessKey`.
3. Set **Secret Key** to `${aws-secrets::aws-credentials}.secretKey`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
### Handle JSON Keys with Dots
If your JSON secret contains keys with dots in their names, DataWeave treats the dots as subtrees in
JSON. Make sure that configuration fields are set to `Expression mode` (fx button enabled) when
using these syntaxes.
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.'myProject.demo.accessKey'`.
{ "myProject.demo.accessKey": "XXXXXXXX", "myProject.demo.secretKey": "XXXXXXXX",
"myProject.demo.region": "us-east-1", "myProject.demo.roleArn":
"arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole", "myProject.example.http.Port": "8081" }
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.myProject.demo.accessKey`.
{ "myProject": { "demo": { "accessKey": "XXXXXXXX", "secretKey": "XXXXXXXX", "region": "us-east-1",
"roleArn": "arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole" } } }
#### Example: Using JSON Keys with Dots With IBM Connector Configuration
This example shows how to configure IBM MQ Connector using JSON keys with dots in their names:
```xml
```
## Configure AWS Secrets Manager as a String
The following example shows how to configure the secret manager keys as a string for Amazon S3
Connector.
Based on the following string:
aws secretsmanager create-secret --name accessKey --secret-string "ACCESSKEY" aws secretsmanager
create-secret --name secretKey --secret-string "SECRET"
In the **Amazon S3 Configuration** global element properties window:
1. Set **Access Key** to `${aws-secrets::accessKey}`.
2. Set **Secret Key** to `${aws-secrets::secretKey}`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
Avoid using the `$` special character in values stored in the secret manager. If you must use the
`$` character, use the variable in literal mode, which treats it as a string. After that, you can
convert the entire value to JSON and extract the required information.
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.1
---
# Amazon Secrets Manager Properties Provider Examples
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The following examples enable you how to configure Amazon Secrets Manager Properties Provider to
retrieve your secrets from Amazon Secrets Manager cloud service
> [!NOTE] When using dynamic configurations (such as `#[]`), the configuration lifecycle differs
> significantly from static configurations (such as `${}`). For more information, see
> [Dynamic Configuration Lifecycle](https://docs.mulesoft.com/mule-sdk/latest/static-dynamic-configs#dynamic-configuration-lifecycle).
## Configure AWS Connection Types
Anypoint Connectors can use Amazon Secrets Manager Properties Provider in their configurations. The
following example illustrates how to configure the AWS connection type in the **AWS Secrets Manager
Properties Override Config** of Anypoint Studio:
1. In Studio, navigate to the **Global Elements** tab.
2. Click **Create**.
3. In the **Choose Global Type** window, type `AWS Secrets Manager`.
4. Select **AWS Secrets Manager Properties Override Config**.
5. Click **OK**.
6. In the **Global Element Properties** window, you can configure the following fields:
| Name | Type | Description | Default Value | Required |
|---|
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |
External ID | | The External ID is used to prevent the confused deputy problem when assuming a role in another account. | | |

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
If you do not provide credentials, the default AWS connection follows the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
This chain enables you to supply AWS credentials and the region through runtime environment
variables (for example, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION`) instead of
hardcoding them in the Mule app configuration. For the list of supported environment variables and a
configuration example, see
[Environment Variables](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/1.1/amazon-secrets-manager-properties-provider-reference#environment-variables).
## Configure AWS Secrets Manager Using a JSON String
The following example shows how to configure the Amazon Secrets Manager Properties Provider for
Amazon S3 Connector by using a JSON string where you create the secret manager keys.
Based on a JSON file that contains `accessKey` and `secretKey`:
aws secretsmanager create-secret --name aws-credentials --secret-string '{"accessKey":"ACCESSKEY",
"secretKey":"SECRET"}'
1. In the **Amazon S3 Configuration** global element properties window, select **fx** to set
expression values.
2. Set **Access Key** to `${aws-secrets::aws-credentials}.accessKey`.
3. Set **Secret Key** to `${aws-secrets::aws-credentials}.secretKey`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
### Handle JSON Keys with Dots
If your JSON secret contains keys with dots in their names, DataWeave treats the dots as subtrees in
JSON. Make sure that configuration fields are set to `Expression mode` (fx button enabled) when
using these syntaxes.
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.'myProject.demo.accessKey'`.
{ "myProject.demo.accessKey": "XXXXXXXX", "myProject.demo.secretKey": "XXXXXXXX",
"myProject.demo.region": "us-east-1", "myProject.demo.roleArn":
"arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole", "myProject.example.http.Port": "8081" }
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.myProject.demo.accessKey`.
{ "myProject": { "demo": { "accessKey": "XXXXXXXX", "secretKey": "XXXXXXXX", "region": "us-east-1",
"roleArn": "arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole" } } }
#### Example: Using JSON Keys with Dots With IBM Connector Configuration
This example shows how to configure IBM MQ Connector using JSON keys with dots in their names:
```xml
```
## Configure AWS Secrets Manager as a String
The following example shows how to configure the secret manager keys as a string for Amazon S3
Connector.
Based on the following string:
aws secretsmanager create-secret --name accessKey --secret-string "ACCESSKEY" aws secretsmanager
create-secret --name secretKey --secret-string "SECRET"
In the **Amazon S3 Configuration** global element properties window:
1. Set **Access Key** to `${aws-secrets::accessKey}`.
2. Set **Secret Key** to `${aws-secrets::secretKey}`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
Avoid using the `$` special character in values stored in the secret manager. If you must use the
`$` character, use the variable in literal mode, which treats it as a string. After that, you can
convert the entire value to JSON and extract the required information.
## See Also
[Salesforce Help](https://help.salesforce.com)
---
product: Amazon Secrets Manager Properties Provider
version: 1.2
is-latest-version: true
---
# Amazon Secrets Manager Properties Provider Examples
> For the full documentation index, see: https://docs.mulesoft.com/llms.txt
The following examples enable you how to configure Amazon Secrets Manager Properties Provider to
retrieve your secrets from Amazon Secrets Manager cloud service
> [!NOTE] When using dynamic configurations (such as `#[]`), the configuration lifecycle differs
> significantly from static configurations (such as `${}`). For more information, see
> [Dynamic Configuration Lifecycle](https://docs.mulesoft.com/mule-sdk/latest/static-dynamic-configs#dynamic-configuration-lifecycle).
## Configure AWS Connection Types
Anypoint Connectors can use Amazon Secrets Manager Properties Provider in their configurations. The
following example illustrates how to configure the AWS connection type in the **AWS Secrets Manager
Properties Override Config** of Anypoint Studio:
1. In Studio, navigate to the **Global Elements** tab.
2. Click **Create**.
3. In the **Choose Global Type** window, type `AWS Secrets Manager`.
4. Select **AWS Secrets Manager Properties Override Config**.
5. Click **OK**.
6. In the **Global Element Properties** window, you can configure the following fields:
| Name | Type | Description | Default Value | Required |
|---|
AWS Secrets Manager Region | | AWS Secrets Manager region, for example, us-east-2. | | |
AWS Access Key | | | | |
AWS Secret Key a | | | | |
Custom Endpoint URL | | Custom endpoint URL that overrides the default regional AWS Secrets Manager endpoint. Use this field to route Secrets Manager calls through an AWS VPC interface endpoint (AWS PrivateLink) or to a local testing service such as LocalStack, for example, http://localhost:4566. When unset, the connector uses the default regional AWS endpoint. | | |
Role ARN | | Uniquely identifies a role to gain cross-account access. | | |
External ID | | The External ID is used to prevent the confused deputy problem when assuming a role in another account. | | |
STS Endpoint URL | | Custom endpoint URL that overrides the default regional AWS STS endpoint used when assuming a role. Configure this field independently of Custom Endpoint URL to route AWS STS calls through a separate VPC interface endpoint. When unset, the connector uses the default regional AWS STS endpoint. | | |

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
If you do not provide credentials, the default AWS connection follows the
[default credentials provider chain - AWS SDK for Java 2.x](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html).
This chain enables you to supply AWS credentials and the region through runtime environment
variables (for example, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION`) instead of
hardcoding them in the Mule app configuration. For the list of supported environment variables and a
configuration example, see
[Environment Variables](https://docs.mulesoft.com/amazon-secrets-manager-properties-provider-connector/latest/amazon-secrets-manager-properties-provider-reference#environment-variables).
## Configure AWS Secrets Manager Using a JSON String
The following example shows how to configure the Amazon Secrets Manager Properties Provider for
Amazon S3 Connector by using a JSON string where you create the secret manager keys.
Based on a JSON file that contains `accessKey` and `secretKey`:
aws secretsmanager create-secret --name aws-credentials --secret-string '{"accessKey":"ACCESSKEY",
"secretKey":"SECRET"}'
1. In the **Amazon S3 Configuration** global element properties window, select **fx** to set
expression values.
2. Set **Access Key** to `${aws-secrets::aws-credentials}.accessKey`.
3. Set **Secret Key** to `${aws-secrets::aws-credentials}.secretKey`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
### Handle JSON Keys with Dots
If your JSON secret contains keys with dots in their names, DataWeave treats the dots as subtrees in
JSON. Make sure that configuration fields are set to `Expression mode` (fx button enabled) when
using these syntaxes.
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.'myProject.demo.accessKey'`.
{ "myProject.demo.accessKey": "XXXXXXXX", "myProject.demo.secretKey": "XXXXXXXX",
"myProject.demo.region": "us-east-1", "myProject.demo.roleArn":
"arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole", "myProject.example.http.Port": "8081" }
For example, with this JSON structure, access the value using
`${aws-secrets::mySecretName}.myProject.demo.accessKey`.
{ "myProject": { "demo": { "accessKey": "XXXXXXXX", "secretKey": "XXXXXXXX", "region": "us-east-1",
"roleArn": "arn:aws:iam::XXXXXXXXXXX:role/AmazonDemoTestRole" } } }
#### Example: Using JSON Keys with Dots With IBM Connector Configuration
This example shows how to configure IBM MQ Connector using JSON keys with dots in their names:
```xml
```
## Configure AWS Secrets Manager as a String
The following example shows how to configure the secret manager keys as a string for Amazon S3
Connector.
Based on the following string:
aws secretsmanager create-secret --name accessKey --secret-string "ACCESSKEY" aws secretsmanager
create-secret --name secretKey --secret-string "SECRET"
In the **Amazon S3 Configuration** global element properties window:
1. Set **Access Key** to `${aws-secrets::accessKey}`.
2. Set **Secret Key** to `${aws-secrets::secretKey}`.

In the **Configuration XML** editor, the configuration looks like this:
```xml
```
Avoid using the `$` special character in values stored in the secret manager. If you must use the
`$` character, use the variable in literal mode, which treats it as a string. After that, you can
convert the entire value to JSON and extract the required information.
## See Also
[Salesforce Help](https://help.salesforce.com)