aws-samples / container-patterns

Apache License 2.0
36 stars 9 forks source link

CloudFormation does not allow _ in the key only alphanumeric values #66

Open Numel2020 opened 10 months ago

Numel2020 commented 10 months ago

Good evening

Let me first say thank you for providing this tutorial

nginx-reverse-proxy-sidecar-ecs-fargate-task

I have followed the tutorial and when it came to deploying using the command below:

sam deploy \
  --template-file parent.yml \
  --stack-name nginx-reverse-proxy \
  --resolve-s3 \
  --capabilities CAPABILITY_IAM \
  --parameter-overrides AppImageUrl=$APP_URI NginxImageUrl=$NGINX_URI

I came across the following error Error: Invalid value for '--parameter-overrides': AppImageUrl= is not in valid format. It must look something like 'ParameterKey=KeyPairName,ParameterValue=MyKey ParameterKey=InstanceType,ParameterValue=t1.micro' or 'KeyPairName=MyKey InstanceType=t1.micro'

This article explains why:

invalid-value-for-parameter-overrides

Therefore I replaced the variables withAppImageUrl=APP1 and NginxImageUrl=NGINX1 and was able to deploy.

If this was what one is supposed to do, then the article does not state this or maybe things have change since the article was published. I thought I would mention in case anyone who is new to AWS might encounter this issue.

many thanks.

Numel

nathanpeck commented 10 months ago

Hi Numel, what operating system and command line are you using to run the command? The sample commands in the pattern are designed to be run in a Bash shell on a Linux system. In those systems the $APP_URI symbol is a variable reference, from earlier in the commands, where you ran these commands:

APP_URI=$(aws ecr create-repository --repository-name app --query 'repository.repositoryUri' --output text)
docker build -t $APP_URI .
docker push $APP_URI

This assigned the ECR repository URI to a variable named $APP_URI, and then that variable is being reused in all the other commands. If you are using a different shell, it may have a different way of denoting variable references.

Please let me know what command line shell you use, and then I can make a PR to add alternate commands for your particular operating system / command line shell.

Numel2020 commented 10 months ago

Hi Nathan

So the operating system that I am using is macOs Monterey. The shell/CLI that I am using is Zsh

Thanks again :)