I'm new to bash, trying to create invalidation in the bash script by simply calling
aws cloudfront create-invalidation --distribution-id XXX --profile XXX --path /planning/index.html
Works fine in cmd but not in git bash. Must be some escape characters problem but Im not quite getting how it shoud be.
Update: Error message Im getting in bash when calling the CreateInvalidation operation: Your request contains one or more invalid invalidation paths
Solved: Solved by providing cli-input-json
aws cloudfront create-invalidation --profile $PROFILE --cli-input-json "{\"DistributionId\":\"MY_DISTRIBUTION_ID\",\"InvalidationBatch\":{\"Paths\":{\"Quantity\":1,\"Items\":[\"/planning/index.html\"]},\"CallerReference\":\"$(date +%s)\"}}"```
--paths "/\planning/\index.html"but it is getting parsed to"//planning/index.html"pandithough, not the slashes. If the code in the comment is the one you are actually having trouble with, why isn't it in the question?)