Skip to content

Enforce JSON output format for aws secrets manager command#1476

Merged
djmb merged 1 commit intobasecamp:mainfrom
aliismayilov:aws-secrets-json
Apr 15, 2025
Merged

Enforce JSON output format for aws secrets manager command#1476
djmb merged 1 commit intobasecamp:mainfrom
aliismayilov:aws-secrets-json

Conversation

@aliismayilov
Copy link
Contributor

@aliismayilov aliismayilov commented Apr 2, 2025

Currently, kamal's aws secretsmanager integration expects all output to be in JSON format. Though the default output format is JSON, aws cli can be configured differently depending on developer preference.1

The easiest way to see this failing in a project that uses aws secretsmanager:

AWS_DEFAULT_OUTPUT=text kamal secrets print
  ERROR (JSON::ParserError): unexpected character: 'SECRETVALUES	arn:aws:secretsmana'

This PR enforces the JSON format when running aws secretsmanager commands. Command line option takes precedence over the config file and env variables.2

Footnotes

  1. https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-output-format.html

  2. https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html

@djmb djmb merged commit ec28caa into basecamp:main Apr 15, 2025
8 checks passed
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.

2 participants