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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则