I am using amazon/aws-cli:2.2.40 in a gitlab pipeline to publish a static site on a S3.
deploy_front:
image: amazon/aws-cli:2.2.40
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
stage: publish
script:
- s3 sync ./front/build s3://some-bucket-name
ends up in
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument command: Invalid choice, valid choices are:
accessanalyzer | acm
acm-pca | alexaforbusiness
amp | amplify
amplifybackend | apigateway
....... ..........
I managed to replicate this error by running docker run -it amazon/aws-cli:2.2.40 aws s3 locally. However docker run -it amazon/aws-cli:2.2.40 s3 works so I do not understand why I get the same error no matter what I use in script. Is it a some escaping issue?