aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.52k stars 417 forks source link

Deploying a request driven service fails when manifest contains 'command' #3373

Closed pchaganti closed 2 years ago

pchaganti commented 2 years ago

Using a manifest file where we over-ride command. Trying to deploy a service results in the following error. I am running the latest release.

✘ unmarshal service testapp manifest: unmarshal manifest for Request-Driven Web Service: yaml: unmarshal errors:
  line 3: cannot unmarshal !!seq into string

Here is the manifest i tried to use. Removing 'command' from the manifest results in a successful deploy.

name: testapp
type: Request-Driven Web Service
command: ["app"]

http:
  path: '/'

image:
  build: Dockerfile
  port: 80

cpu: 2048
memory: 4096

network:
  vpc:
    placement: private
huanjani commented 2 years ago

Hello, @pchaganti! I was able to reproduce this bug; thank you for bringing it to our attention. I am digging into it further now.

huanjani commented 2 years ago

Hi again, @pchaganti!

As it turns out, the "command" field of RDWS/App Runner services is different than that of the ECS services. Because for App Runner this value is for StartCommand, we can take only strings, not arrays of strings.

See Copilot RDWS documentation here: https://aws.github.io/copilot-cli/docs/manifest/rd-web-service/#command based on https://docs.aws.amazon.com/apprunner/latest/api/API_CodeConfigurationValues.html.

For our other workload types, see "command" under "Environment" here.

Hope that helps!

pchaganti commented 2 years ago

Got it. Thanks!