aws:aws-cli
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
aws:aws-cli [10/02/2025 11:32] – [Get repos] andrew | aws:aws-cli [17/04/2025 11:26] (current) – [Explanation of "StandardsArn": "'"${STANDARD}"'"] andrew | ||
---|---|---|---|
Line 551: | Line 551: | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Embedding a BASH variable in JSON ===== | ||
+ | |||
+ | <code bash> | ||
+ | STANDARD=' | ||
+ | |||
+ | aws securityhub | ||
+ | --standards-control-association-updates \ | ||
+ | --profile OrgDeployRole \ | ||
+ | '[ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ]' | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Explanation of " | ||
+ | |||
+ | JSON keys and values need to be quoted, so that's the outside double quotes, STANDARD cannot be expnded by the aws command so it is single quoted, but lastly as BASH sees it, it is double quoted so BASH can expand the variable " | ||
+ | |||
+ | I think.... Not 100% sure on the single quotes usage | ||
+ | |||
+ | |||
+ | |||
aws/aws-cli.1739187147.txt.gz · Last modified: by andrew