Skip to content
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

Add aliases for resources #75

Merged
merged 1 commit into from
Feb 5, 2021
Merged

Conversation

Serneum
Copy link
Contributor

@Serneum Serneum commented Feb 4, 2021

This adds aliases for cert, key, and secret resources. If an alias is specified, it is added to the appropriate map with the same value as the resource's name

Tested with the following config:

workers:
  -
    resources:
      - kind: secret
        name: secret-key-base
        alias: skb
        vaultBaseURL: https://vault-tst.vault.azure.net/
        credential: request-keys

    sinks:
      - path: secrets.json
        template: "{{ index .Secrets.skb.Value }}"
    frequency: 60s

Closes #56

Copy link
Contributor

@chrisjohnson chrisjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary for this PR but it could make sense to add an aliases key for all-AllSecretsKind so a map of name => alias could be supplied. Maybe toss an issue to circle back to this work later.

Just to confirm, if you omit the alias key, it doesn't cause any errors right?

@Serneum
Copy link
Contributor Author

Serneum commented Feb 4, 2021

@chrisjohnson correct

workers:
  -
    resources:
      - kind: all-secrets
        vaultBaseURL: https://vault1-tst.vault.azure.net/
        credential: cred1
      - kind: secret
        name: secret-key-base
        vaultBaseURL: https://vault2-tst.vault.azure.net/
        credential: cred2

    sinks:
      - path: secrets.json
        template: '{{ (index .Secrets "secret-key-base").Value }}'

works fine

@drewby08 drewby08 merged commit b1cd286 into covermymeds:master Feb 5, 2021
@Serneum Serneum deleted the add-aliases branch February 5, 2021 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource Aliases
3 participants