

# AWS Secrets Manager extension in AWS Systems Manager Cloud Extensions

Retrieve secrets from AWS Secrets Manager through a local, in-memory cache in your Lambda functions and containers. The Secrets Manager extension is an extension for AWS Systems Manager Cloud Extensions. It retrieves secrets from AWS Secrets Manager and caches them in memory. Your application gets secrets from `localhost` instead of calling Secrets Manager each time. The extension runs inside the Cloud Extensions runtime, which you can use with the following:
+ AWS Lambda, as a Lambda extension
+ Containers, as a base image or a sidecar

In the Extension catalog of Cloud Extensions on the Systems Manager console, this extension appears as **AWS Secrets Manager**. The identifier of the extension is `aws:secretsmanager`.

**Topics**
+ [Overview](#cloud-extensions-ext-secrets-manager-overview)
+ [Use cases](#cloud-extensions-ext-secrets-manager-use-cases)
+ [Next steps](#cloud-extensions-ext-secrets-manager-next-steps)
+ [How the Secrets Manager extension in AWS Systems Manager Cloud Extensions works](cloud-extensions-ext-secrets-manager-how-it-works.md)
+ [Prerequisites and required IAM permissions for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-prerequisites.md)
+ [Adding the Secrets Manager extension to a profile in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-add-to-profile.md)
+ [Configuration options for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-configuration.md)
+ [Prefetching secrets with the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-prefetch.md)
+ [Using the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-using.md)
+ [Forcing a refresh with refreshNow in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-refresh-now.md)
+ [Retrieving secrets across accounts with role chaining in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-role-chaining.md)
+ [Errors that the Secrets Manager extension in AWS Systems Manager Cloud Extensions returns](cloud-extensions-ext-secrets-manager-errors.md)
+ [Monitoring the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-monitoring.md)
+ [Troubleshooting the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-troubleshooting.md)
+ [Best practices for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-best-practices.md)
+ [Security considerations for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-security.md)
+ [Differences between the Secrets Manager extension in AWS Systems Manager Cloud Extensions and the AWS Secrets Manager Agent](cloud-extensions-ext-secrets-manager-differences.md)
+ [Comparison of the Secrets Manager extension in AWS Systems Manager Cloud Extensions with the Parameter Store extension](cloud-extensions-ext-secrets-manager-comparison.md)
+ [Lambda function example for the Secrets Manager extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-secrets-manager-lambda-example.md)

## Overview
<a name="cloud-extensions-ext-secrets-manager-overview"></a>

The Secrets Manager extension provides the following features:
+ **Caching** – The extension holds secrets in a local cache and serves them until the cache time to live (TTL) expires.
+ **Two read routes** – You read a secret with a query request or a path request. Both routes use the same cache.
+ **Request protection** – By default, the runtime requires callers to sign requests with Signature Version 4 (SigV4). The extension can also require a server-side request forgery (SSRF) token on query and path requests. The extension refuses requests that carry an `X-Forwarded-For` header.
+ **Forced refresh** – You add `refreshNow=true` to a request to bypass the cache.
+ **Role chaining** – You add `roleArn` to a request to read a secret as another IAM role. For example, you can read a secret in another account.
+ **Prefetch** – The extension can load secrets into the cache when it starts. You choose the secrets by ID or by tag key.
+ **Resilience** – The extension can keep serving a cached secret when a refresh fails for a moment.

The extension reads secrets but can't modify them. It supports most of the local HTTP API of the AWS Secrets Manager Agent, including `refreshNow`, `roleArn`, prefetching, and the SSRF token header. In most cases, you change only the endpoint and the path that your application calls. For more information, see [Differences between the Secrets Manager extension in AWS Systems Manager Cloud Extensions and the AWS Secrets Manager Agent](cloud-extensions-ext-secrets-manager-differences.md).

The extension never holds AWS credentials. The runtime signs every call to Secrets Manager, with the execution role of the extension or the credentials of the runtime.

## Use cases
<a name="cloud-extensions-ext-secrets-manager-use-cases"></a>

The Secrets Manager extension suits the following cases:
+ **Database credentials** – Retrieve database passwords
+ **API keys and tokens** – Access third-party service credentials
+ **Encryption keys** – Retrieve application encryption keys
+ **OAuth credentials** – Retrieve client secrets and refresh tokens

## Next steps
<a name="cloud-extensions-ext-secrets-manager-next-steps"></a>
+ [AWS Systems Manager Parameter Store extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-parameter-store.md)
+ [AWS AppConfig extension in AWS Systems Manager Cloud Extensions](cloud-extensions-ext-appconfig.md)
+ [Monitoring AWS Systems Manager Cloud Extensions](cloud-extensions-monitoring.md)
+ [AWS Secrets Manager User Guide](https://docs.aws.amazon.com/secretsmanager/latest/userguide/)