Skip to content

Add example for aws-secrets to show kv pairs. #14769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion content/docs/esc/integrations/dynamic-secrets/aws-secrets.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@ aliases:

The `aws-secrets` provider enables you to dynamically import Secrets from AWS Secrets Manager into your Environment. The provider will return a map of names to Secrets.

## Example
## Example: Plain-Text Secrets

The following example demonstrates how to retrieve plain-text (i.e., scalar value) secrets from AWS Secrets Manager:

```yaml
values:
@@ -37,6 +39,33 @@ values:
secretId: app-secret
```

## Example: Key/Value Pair Secrets

The following example demonstrates how to retrieve key/value pair (i.e. JSON) secrets from AWS Secrets Manager and map them to Pulumi IaC configuration values:

```yaml
values:
aws:
login:
fn::open::aws-login:
oidc:
roleArn: arn:aws:iam::123456789:role/esc-oidc
sessionName: pulumi-environments-session
secrets:
fn::open::aws-secrets:
region: us-west-1
login: ${aws.login}
get:
db-creds:
secretId: prod-db
secrets-unpacked:
db-creds:
fn::fromJSON: ${aws.secrets.my-secret}
pulumiConfig:
dbUserName: ${aws.secrets-unpacked.db-creds.userName}
dbPassword: ${aws.secrets-unpacked.db-creds.password}
```

## Configuring OIDC

To learn how to configure OpenID Connect (OIDC) between Pulumi Cloud and AWS, see [Configuring OpenID Connect for AWS](/docs/pulumi-cloud/oidc/provider/aws/). Once you have completed these steps, you can validate that your configuration is working by running either of the following:
Loading