# Secrets Manager

This AWS integration allows you to configure CloudTruth External Parameters from your AWS Secrets Manager.

## Adding Integrations <a href="#adding-integrations" id="adding-integrations"></a>

{% hint style="info" %}
If you already have a CloudTruth AWS integration you can add AWS Secrets Manager by editing the existing account, selecting this integration and adding the [Secrets Manager Inline Policy](#ssm-parameter-store-inline-role). The [Terraform](/configuration-management/integrations/aws/setup-aws-role.md#use-terraform-to-give-cloudtruth-access) and [CloudFormation](/configuration-management/integrations/aws/setup-aws-role.md#use-cloudformation-to-give-cloudtruth-access) role setup methods automatically create the Secrets Manager inline policy.
{% endhint %}

To create a new or additional AWS account click `Add AWS Account` from the Integrations AWS page to bring up the add account pane. Add a name for the AWS account, your specific AWS account ID and the AWS account role name.‌ CloudTruth allows you to select regions where your resources exist, all US regions are enabled by default.

The Secrets Manager integration supports [CloudTruth push actions](/configuration-management/actions/push-actions.md#push-action). To enable Push Actions select `Write Access` for the integration and apply the [write access inline policy for Secrets Manager](#ssm-parameter-store-inline-role).

Check the AWS Secret Manager integration and click `Save`.​‌

![](/files/NBGKGx6AKL6akWSzpIrB)

The AWS account will enter an Integration Error state until the AWS role is configured. An auto generated **External Id** will be created to use in the [AWS Role Creation](/configuration-management/integrations/aws/setup-aws-role.md).

![](/files/iXrdrpkyilFtAejGwW3Z)

#### Configuring the AWS Role

With the provided **External ID** create your AWS Role.

{% content-ref url="/pages/-MWATLnEfo1hmkQ4RC3m" %}
[AWS Role](/configuration-management/integrations/aws/setup-aws-role.md)
{% endcontent-ref %}

## AWS Secret Store Inline Policy <a href="#ssm-parameter-store-inline-role" id="ssm-parameter-store-inline-role"></a>

‌Adding an Inline Policy to the AWS Role allows CloudTruth secure access to the selected integration service. The inline policy is automatically created if you used [CloudFormation](/configuration-management/integrations/aws/setup-aws-role.md#use-cloudformation-to-give-cloudtruth-access) or [Terraform](/configuration-management/integrations/aws/setup-aws-role.md#use-terraform-to-give-cloudtruth-access) to create the role.

From the [AWS IAM Console](https://console.aws.amazon.com/iam/home) select the role that you created for CloudTruth access.

![](/files/TChDNuu5pdcxOc86AejG)

Click `Add Inline Policy`.​

![](/files/-Mk8iGDDmz8qnPYMCBlA)

Click the `JSON` Tab.​‌

![](https://gblobscdn.gitbook.com/assets%2F-MV-6u23cOGf1BMdpRn4%2F-MVwf4ns5UC4IuxFJ1rz%2F-MVwhrTEZ933AuVaoOa4%2FPrtScr%20capture_5.jpg?alt=media\&token=853b9d90-de61-4947-9d33-5b28a22c38c1)

Paste in the following JSON for the AWS Secret Store integration policy and click `Review Policy`.

#### External Parameter Policy

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListSecrets",
            "Effect": "Allow",
            "Action": "secretsmanager:ListSecrets",
            "Resource": "*"
        },
        {
            "Sid": "SecretAccess",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret"
            ],
            "Resource": "*"
        }
    ]
}
```

#### Write Access Parameter Policy for [Push actions](/configuration-management/actions/push-actions.md#push-action)

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListSecrets",
            "Effect": "Allow",
            "Action": "secretsmanager:ListSecrets",
            "Resource": "*"
        },
        {
            "Sid": "SecretAccess",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:CreateSecret",
                "secretsmanager:DeleteSecret",
                "secretsmanager:GetSecretValue",
                "secretsmanager:DescribeSecret",
                "secretsmanager:TagResource",
                "secretsmanager:UpdateSecret"
            ],
            "Resource": "*"
        }
    ]
}
```

Type in a name for the policy and click `Create Policy`.​‌​

{% hint style="success" %}
:clap:Setup is now complete for both the AWS Role and Policy. After refreshing by clicking "Check Integration Status" the CloudTruth integration will now show as "Connected", and you can begin creating [External Parameter values](https://app.gitbook.com/@cloudtruth/s/staging/~/drafts/-MVXd5xAL1NKUBwPEBhY/configuration-management/parameters/using-dynamic-values/@drafts) that reference your AWS resources.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudtruth.com/configuration-management/integrations/aws/secrets-manager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
