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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠