Skip to content

Instantly share code, notes, and snippets.

@t04glovern
Created May 1, 2022 16:37
Show Gist options
  • Save t04glovern/74d1658e84c0aa6878f3af160e42ee88 to your computer and use it in GitHub Desktop.
Save t04glovern/74d1658e84c0aa6878f3af160e42ee88 to your computer and use it in GitHub Desktop.
AWS Greengrass Development Kit Example
python3 -m pip install -U git+https://github.com/aws-greengrass/aws-greengrass-gdk-cli.git@v1.1.0
gdk component build
gdk component publish
{
"component": {
"com.devopstar.Test": {
"author": "Nathan Glover",
"version": "NEXT_PATCH",
"build": {
"build_system": "zip"
},
"publish": {
"bucket": "greengrass-component-artifacts",
"region": "ap-southeast-2"
}
}
},
"gdk_version": "1.1.0"
}
---
RecipeFormatVersion: "2020-01-25"
ComponentName: "{COMPONENT_NAME}"
ComponentVersion: "{COMPONENT_VERSION}"
ComponentDescription: AWS IoT Greengrass component Test
ComponentPublisher: "{COMPONENT_AUTHOR}"
ComponentConfiguration:
DefaultConfiguration:
accessControl:
aws.greengrass.ipc.pubsub:
com.devopstar.Test:pubsub:1:
policyDescription: Allows access to subscribe to all topics.
operations:
- aws.greengrass#SubscribeToTopic
resources:
- devopstar/Test/stats
Manifests:
- Name: Linux
Platform:
os: linux
Artifacts:
- URI: "s3://BUCKET_NAME/COMPONENT_NAME/COMPONENT_VERSION/Test.zip"
Unarchive: ZIP
Lifecycle:
Install:
Script: pip3 install -r {artifacts:decompressedPath}/Test/requirements.txt
RequiresPrivilege: False
Run: python3 {artifacts:decompressedPath}/Test/src/main.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment