copilot fails with "templates/custom-resources/nlb-cert-validator.js: file does not exist" (on Macbook Pro M1)

0

I'm experimenting with AWS Copilot. I have an existing trivial nodejs project that has already been containerized with Docker. I'm trying to use it with AWS Copilot to get a feel for copilot. Note I am running this on a Macbook Pro M1, I wonder if this is an architecture issue or if that's a red herring...

The copilot init process fails (after doing a lot successfully) with:

 => [run 1/1] RUN yarn build 28.2s
 => exporting to image 5.1s
 => => exporting layers 5.1s
 => => writing image sha256:260f1aae6a9d11b023672a1f3753161d1d38afa118c483804f9ef79d0c4e52a1                                                               0.0s
 => => naming to xxx.dkr.ecr.us-east-2.amazonaws.com/em-sandbox/em-nodejs-service-template                                                        0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Login Succeeded
Using default tag: latest
The push refers to repository [xxx.dkr.ecr.us-east-2.amazonaws.com/em-sandbox/em-nodejs-service-template]
97b95ee3261b: Pushed
59618adc7d11: Pushed
4c3b5d9c5d94: Pushed
1c37a59f80eb: Pushed
099cd5535f68: Pushed
bb2ebe54bcf0: Pushed
cd2258b7ca68: Pushed
fbf63a621b59: Pushed
994393dc58e7: Pushed
latest: digest: sha256:2481df4d9803e63ddde3992a9224cda89e27365d859f627c962692436715e14a size: 2208
✘ upload deploy resources for service em-nodejs-service-template: read custom resources for a "Load Balanced Web Service": read custom resource NLBCertValidatorFunction at path custom-resources/nlb-cert-validator.js: read template custom-resources/nlb-cert-validator.js: open templates/custom-resources/nlb-cert-validator.js: file does not exist

For what it's worth, here's how I answered the initial questions in copilot init. I did also ask for a test environment to be set up.

Application name: em-sandbox
Workload type: Load Balanced Web Service
Service name: em-nodejs-service-template
Dockerfile: ./Dockerfile
Port: 4000
Ok great, we'll set up a Load Balanced Web Service named em-nodejs-service-template in application em-sandbox listening on port 4000.

✔ Proposing infrastructure changes for stack em-sandbox-infrastructure-roles
- Creating the infrastructure for stack em-sandbox-infrastructure-roles                         [create complete]  [40.8s]
  - A StackSet admin role assumed by CloudFormation to manage regional stacks                   [create complete]  [12.9s]
  - An IAM role assumed by the admin role to create ECR repositories, KMS keys, and S3 buckets  [create complete]  [14.3s]
✔ The directory copilot will hold service manifests for application em-sandbox.

Note: Architecture type arm64 has been detected. We will set platform 'linux/x86_64' instead. If you'd rather build and run as architecture type arm64, please change the 'platform' field in your workload manifest to 'linux/arm64'.
✔ Wrote the manifest for service em-nodejs-service-template at copilot/em-nodejs-service-template/manifest.yml
Your manifest contains configurations like your container size and port (:4000).

- Update regional resources with stack set "em-sandbox-infrastructure"  [succeeded]  [0.0s]
All right, you're all set for local development.
Deploy: Yes

✔ Wrote the manifest for environment test at copilot/environments/test/manifest.yml
...etc...
  • I should also maybe mention, the profile I was authenticated with is an SSO user, but I think that's unlikely to be an issue here. It's possible I was missing some permission, but AWS is usually better about indicating that kind of error.

gefragt vor 2 Jahren472 Aufrufe
1 Antwort
2
Akzeptierte Antwort

Looks like this was due to me installing copilot from wrong place; I had originally done brew install copilot; I uninstalled and did brew install aws/tap/copilot-cli (as the documentation says) and it seems to be working better. (Although when I checked copilot --version, they both reported the same version.)

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen