Adding the Secrets Manager extension to a profile in AWS Systems Manager Cloud Extensions
Add the Secrets Manager extension to a profile on the console or with the AWS CLI, and approve its capabilities.
Viewing the extension on the Systems Manager console
To view the settings, capabilities, and versions of the extension
-
Open the Systems Manager console at https://console.aws.amazon.com/systems-manager/
. -
In the navigation pane, choose Cloud Extensions.
-
On the Extension catalog tab, choose AWS Secrets Manager.
The page shows an overview of the extension, a usage guide, and tabs for the settings, the capabilities, and the versions of the extension.
Adding the extension to a profile
Adding the extension on the console
To add the extension to a profile
-
Open the Systems Manager console at https://console.aws.amazon.com/systems-manager/
. -
In the navigation pane, choose Cloud Extensions.
-
On the Extension catalog tab, select AWS Secrets Manager, and then choose Add to profile.
-
On the Choose a profile page, choose Existing profile and then choose the profile in Profile, or choose New profile. Choose Next.
-
On the Configure extension page, under Update method, choose Latest (recommended) or Specific version.
-
Under Settings, review the general settings and the Security, Cache, and Prefetch groups. Change the values that you need. The extension requires the Security group.
-
To load secrets when the extension starts, add secrets or tag filters under Prefetch. For the steps, see Prefetching secrets with the Secrets Manager extension in AWS Systems Manager Cloud Extensions.
-
Review the Capabilities summary. The summary lists the capabilities that the extension requires and the capabilities that your settings add. The console approves these capabilities when you add the extension. Choose Next.
-
On the Review and add page, choose Add to profile.
For more information about the Configure extension page, see Configuring an extension on the console.
Adding the extension with the AWS CLI
To add the extension to your Cloud Extensions profile with the AWS CLI
-
Install the runtime. In Lambda, set the
AWS_CLOUDEXTENSIONS_PROFILEenvironment variable of the function to the profile name or ID. Lambda pauses the runtime between invocations, so a change to the profile applies on a later invocation. -
Create an execution role with the permissions in Required IAM permissions, and set the role as the default role of the profile:
aws cloudextensions update-profile \ --identifier my-application \ --extension-defaults executionRole=arn:aws:iam::111122223333:role/SecretsManagerExtensionRole -
Write your settings. The extension requires the
securitysetting. If every caller signs requests with SigV4, turn off the server-side request forgery (SSRF) token check:{ "security": { "ssrfHeadersEnabled": false } }If you have callers that send an SSRF token header instead of signing, keep the check on and set the token:
{ "security": { "ssrfToken": "YOUR_SSRF_TOKEN" } }For all options, see Configuration options for the Secrets Manager extension in AWS Systems Manager Cloud Extensions.
-
Create a profile entry. You must approve the
secretsmanagercapability:aws cloudextensions create-profile-entry \ --profile-identifier my-application \ --extension-identifier aws:secretsmanager \ --version-policy updateStrategy=AUTOMATIC,versionSelector=1.x.x \ --approve secretsmanager \ --settings file://settings.jsonThe version policy tracks new releases within major version 1. If you didn't set an execution role in the extension defaults of the profile, add the
--execution-roleoption. -
Configure caller authentication. Use signed requests for all callers where you can. The default,
runtimeCredentials, has callers sign requests with the credentials of the runtime. You can instead use an extension key, which has an access key ID and a secret key in the extension defaults of the profile. Use a Secrets Manager reference for the secret key of an extension key. For more information, see Authentication.The SSRF token check is for callers that send a token header instead of signing. If your callers can't sign, set caller authentication to
noneand keep the SSRF token check on.
The runtime picks up profile changes within its poll interval, which is 45 seconds by default.
Approving capabilities
An extension can use a capability only after you approve the capability. To list the capabilities that the extension declares, run the following command:
aws cloudextensions get-extension \ --identifier aws:secretsmanager \ --query 'configuration.capabilities'
The extension declares the following capability:
-
secretsmanager(required) - Calls the Secrets ManagerGetSecretValue,BatchGetSecretValue, andDescribeSecretoperations.
For more information, see Approving capabilities.