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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

secret type aws_secrets_manager not working with a sequence of numbers as string value #20489

Closed
sdomme opened this issue May 13, 2024 · 3 comments
Labels
type: bug A code related bug.

Comments

@sdomme
Copy link

sdomme commented May 13, 2024

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

Hi. I'm using the new secret type aws_secrets_manager. It seems not to cast string secret values correctly. Especially if the value is a sequence of numbers set as string.

For example having the following AWS secret as JSON:

{
  "username":"12345",
  "password":"abc"
}

With the following configuration

secret:
  loki:
    secret_id: "arn:aws:secretsmanager:....."
    type: "aws_secrets_manager"
sink:
  loki:
    auth:
      password: "SECRET[loki.password]"
      user: "SECRET[loki.username]"
      strategy: "basic"
    type: "loki"

I get the following error at vector startup:

2024-05-13T15:32:54.549469Z ERROR vector::cli: Configuration error. error=invalid type: integer `12345`, expected a string

Configuration

No response

Version

0.38.0

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@sdomme sdomme added the type: bug A code related bug. label May 13, 2024
@junaidk
Copy link

junaidk commented May 17, 2024

I had similar issue when using Helm to deploy.
Double quotes are removed from created configmap for vector config.
This results in config values without quotes like this .

      auth:
        strategy: basic
        password: SECRET[loki.password]
        user: SECRET[loki.username]

If value is numeric and without quote it will be parsed as number.

You can define your username like this to render double quotes so that it is parsed as string by vector.

      auth:
        strategy: basic
        password: "SECRET[loki.password]"
        user: '{{ print "SECRET[loki.username]" }}'

@jszwedko
Copy link
Member

I believe @junaidk is correct so I'll close this out, but let me know if you have any additional questions!

@jszwedko jszwedko closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
@sdomme
Copy link
Author

sdomme commented May 21, 2024

@junaidk Thanks for this very valuable hint. I hadn't thought about this. Works now. 馃憤馃徎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

3 participants