Skip to main content

GETTING STARTED WITH AWS SECRETS MANAGER

In this tutorial, we will create a Swamp repository and pull the extension that provides the AWS Secrets Manager behavior types into it. Then we will look at the types the repository now has.

What we will build

We will build a Swamp repository with the @swamp/aws/secretsmanager extension installed. Nothing in this tutorial calls AWS, so we do not need AWS credentials.

Prerequisites

Create the repository

First, we create a fresh Swamp repository in the empty directory:

swamp repo init

Swamp initializes the repository in the current directory. It also creates a local encrypted vault named default.

Pull the Secrets Manager extension

Now we pull the extension that provides the Secrets Manager behavior types:

swamp extension pull @swamp/aws/secretsmanager

You will see output like:

INF extension·pull: Pulling "@swamp/aws/secretsmanager"@"2026.10.13.1"
INF extension·pull: Identity verified: "@swamp/aws/secretsmanager"@"2026.10.13.1"
INF extension·pull: Pulled "@swamp/aws/secretsmanager"@"2026.10.13.1"
INF extension·pull: Extracted 12 files:

The extension is now installed in our repository.

Look at what we installed

The extension adds four behavior types to the repository:

  • @swamp/aws/secretsmanager/secret
  • @swamp/aws/secretsmanager/rotation-schedule
  • @swamp/aws/secretsmanager/resource-policy
  • @swamp/aws/secretsmanager/secret-target-attachment

All four types have the same six methods: create, get, update, delete, sync and list. Each type also requires a name global argument, which identifies the behavior instance.

The secret type takes a GenerateSecretString argument. This lets AWS generate a password, so the value never appears in our repository. The page Understanding AWS Secrets Manager in Swamp explains how this fits with vaults.

What we built

We created a Swamp repository and pulled @swamp/aws/secretsmanager into it. The repository now has behavior types for Secrets Manager secrets, rotation schedules, resource policies and secret target attachments.