AWS Secrets Manager
Detailed information on the decret store component
Create an AWS Secrets Manager instance
Setup AWS Secrets Manager using the AWS documentation: https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html.
Create the Dapr component
See Authenticating to AWS for information about authentication-related attributes
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: awssecretmanager
namespace: default
spec:
type: secretstores.aws.secretmanager
version: v1
metadata:
- name: region
value: "[aws_region]"
- name: accessKey
value: "[aws_access_key]"
- name: secretKey
value: "[aws_secret_key]"
- name: sessionToken
value: "[aws_session_token]"
Apply the configuration
Read this guide to learn how to apply a Dapr component.
Example
This example shows you how to set the Redis password from the AWS Secret Manager secret store. Here, you created a secret named redisPassword
in AWS Secret Manager. Note its important to set it both as the name
and key
properties.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
namespace: default
spec:
type: state.redis
version: v1
metadata:
- name: redisHost
value: "[redis]:6379"
- name: redisPassword
secretKeyRef:
name: redisPassword
key: redisPassword
auth:
secretStore: awssecretmanager
Warning
The above example uses secrets as plain strings. It is recommended to use a local secret store such as Kubernetes secret store or a local file to bootstrap secure key storage.
Related links
- Secrets building block
- How-To: Retreive a secret
- How-To: Reference secrets in Dapr components
- Secrets API reference
- Authenticating to AWS
Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)