AWS GDK: Could not find artifact

0

I am trying to deploy docker containers to IoT devices using Greengrass. The docker-compose.yml file is stored inside of an s3 bucket. The IAM policies and Greengrass policies that I am using allow me to retrieve from s3 buckets.

My recipe.yaml looks like this:

---
RecipeFormatVersion: '2020-01-25'
ComponentName: com.example.DockerTest
ComponentVersion: '1.0.0'
ComponentDescription: 'Uses Greengrass to deploy NodeRed and Mosquitto to docker containers on the IoT defices.'
ComponentPublisher: Amazon
ComponentDependencies:
  aws.greengrass.DockerApplicationManager:
    VersionRequirement: ~2.0.0
Manifests:
  - Platform:
      os: all
    Lifecycle:
        run: docker-compose -f {artifacts:path}/docker-compose.yaml up
    Artifacts:
      - URI: "docker:nodered/node-red:latest"
      - URI: "docker:eclipse-mosquitto:latest"
      - URI: "s3://<bucket name>/docker-compose.yml"

My gdk-config.json looks like this:

{
  "component": {
    "com.example.DockerTest": {
      "author": "<custom author name>",
      "version": "1.0.0",
      "build": {
        "build_system": "zip"
      },
      "publish": {
        "bucket": "<bucket name>",
        "region": "<region>"
      }
    }
  },
  "gdk_version": "1.0.0"
}

Everything in angle brackets is valid, by the way - just left out for privacy.

However, whenever i run gdk component build where the component is specified, I get this error:

Exception: Could not find artifact with URI 's3://<bucket name>/docker-compose.yml' on s3 or inside the build folders

I made sure to specify the URI correctly, after copy + pasting it from s3. Why is this happening?

已提問 10 個月前檢視次數 254 次
1 個回答
0

Hello! try passing in --bucket when running gdk commands, or adjust the artifact URI in the recipe to follow <bucket name>-<region>-<accountId> format instead of <bucket name>

https://docs.aws.amazon.com/greengrass/v2/developerguide/gdk-cli-configuration-file.html

If you use GDK CLI v1.1.0 or later, you can specify the --bucket argument to specify the S3 bucket where the GDK CLI uploads the component's artifacts. If you don't specify this argument, the GDK CLI uploads to the S3 bucket whose name is bucket-region-accountId, where bucket and region are the values that you specify in gdk-config.json, and accountId is your AWS account ID. The GDK CLI creates the bucket if it doesn't exist.
AWS
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南