Skip to content

Remove prefix from environment variable name while fetching multiple secrets starting with prefix #115

@manpreet-compro

Description

@manpreet-compro

Hi, I have following setup currently in my applications.

I name the secrets in a particular faishon to identify across environment
e.g.
/APP/DEV/SECRET_1
/APP/DEV/SECRET_2
/APP/QA/SECRET_1
/APP/QA/SECRET_2

Then in the build script, based on the environment, I fetch the keys by prefix i.e. /APP/DEV for Dev environment. If we assume above example, it setup 2 environment variables SECRET_1 and SECRET_2. By this strategy, I can keep my code independent of environment in which it is running.

I checked the documentation, there is an example to fetch all the secrets starting with a prefix, However the environment variable also includes the prefix part.

- name: Get Secret Names by Prefix
  uses: aws-actions/aws-secretsmanager-get-secrets@v2
  with:
    secret-ids: |
      beta*    # Retrieves all secrets that start with 'beta'

I am trying to find out if such a support exists currently or if can be planned in future

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions