Skip to content

Instantly share code, notes, and snippets.

@fbidu
Last active April 26, 2023 19:04
Show Gist options
  • Save fbidu/bcc94f8626abd0784acf1964cd306b4d to your computer and use it in GitHub Desktop.
Save fbidu/bcc94f8626abd0784acf1964cd306b4d to your computer and use it in GitHub Desktop.
Exports an AWS ECS Task Definition environment variables to a docker run command
  1. Install jq
  2. Run:
aws ecs describe-task-definition \
	--task-definition <task_arn> \
	--query "taskDefinition.containerDefinitions[0].environment[]" |
	jq -r '.[] | "-e \(.name)=\"\(.value)\" \\"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment