1. Resources
  2. /
  3. Plugins
  4. /
  5. vault-aws-creds-buildkite-plugin

Vault AWS Credentials Buildkite Plugin

Retrieve time-limited AWS credentials from a Hashicorp Vault AWS Secrets Backend.

The plugin expects a VAULT_TOKEN is already set in the environment. The vault-oidc-auth plugin is an ideal companion to use with this plugin.

Example

Add the following to your pipeline.yml:

steps:
  - command: ./run_build.sh
    plugins:
      - planetscale/vault-aws-creds#v1.0.0:
          vault_addr: "https://my-vault-server"   # required
          path: "aws"                             # optional. default "aws"
          role: "my-pipeline"                     # optional. default "$BUILDKITE_PIPELINE_SLUG"
          ttl: "3600s"                            # optional. default "3600s" (NOTE: Vault and AWS have maximum ttl settings that can limit this)
          role_arn: "arn:aws:foo:bar:role/baz"    # optional. default "" (NOTE: Optional if the Vault role only allows a single AWS role ARN; required otherwise.)
          session_name: "my-session"              # optional. default "" (Limited to 64 chars. Vault will dynamically generate a session name if not set.)
          env_prefix: "BUILDKITE_"                # optional. default "" (prefix to add to AWS_ env vars)

If authentication is successful the environment variables will be added to the environment:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_SESSION_TOKEN

Setting the env_prefix property will add a prefix to each environment variable name, eg: BUILDKITE_AWS_ACCESS_KEY_ID

Ephemeral Credentials with vault-oidc-auth

This plugin works best when combined with the vault-oidc-auth plugin to provide short-lived credentials for accessing Vault and AWS. Example:

steps:
  - command: ./run_build.sh
    plugins:
      - planetscale/vault-oidc-auth#v1.0.0:
          vault_addr: "https://my-vault-server"
      - planetscale/vault-aws-creds#v1.0.0:
          vault_addr: "https://my-vault-server"

First, the vault-oidc-auth plugin uses a short-lived Buildkite OIDC token to authenticate to Vault and fetch a VAULT_TOKEN.

Next, vault-aws-creds uses the VAULT_TOKEN to fetch time-limited AWS IAM credentials from Vault.

Vault Configuration

First, enable the AWS Secrets Backend. A minimal configuration using environmental AWS credentials might look like the following. See the docs for full details on configuring the root IAM credentials.

vault secrets enable -path=aws aws
vault write aws/config/root region=us-east-1

Then, create an AWS IAM role for your pipeline through your favorite method and make it available from Vault by creating and assigning it to role “my-pipeline”:

vault write aws/roles/my-pipeline credential_type="assumed_role" role_arns="arn:aws:iam::123456789012/my-pipeline"

NOTE: This plugin has only been tested with the assumed_role mode. Other modes may work. Please submit PRs if other modes do not work.

Developing

To run the linters:

docker-compose run --rm lint-shellcheck
docker-compose run --rm lint-plugin

To run the tests:

docker-compose run --rm tests

Contributing

  1. Fork the repo
  2. Make the changes
  3. Run the tests
  4. Commit and push your changes
  5. Send a pull request

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events
  8. Migration Services
  9. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025