Skip to content

Commit

Permalink
Add a sample python component to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rawalexe committed Dec 14, 2024
1 parent c7c6910 commit 09dcfc8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import boto3


def fetch_s3_bucket_list():
# Create an S3 client
s3 = boto3.client('s3')
# List S3 buckets
response = s3.list_buckets()
# Print the names of all buckets
print("S3 Bucket Names:")
for bucket in response['Buckets']:
print(bucket['Name'])


def main():
print("HELLO WORLD")
fetch_s3_bucket_list()


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
RecipeFormatVersion: "2020-01-25"
ComponentName: sample-ggLitePython
ComponentVersion: 1.0.0
ComponentType: "aws.greengrass.generic"
ComponentDescription:
This example Python component for GGLite that lists all your s3 bucket names
ComponentPublisher: AWS
ComponentDependencies:
aws.greengrass.TokenExchangeService:
VersionRequirement: ">=0.0.0"
DependencyType: "HARD"
Manifests:
- Platform:
os: linux
runtime: "*"
Lifecycle:
install:
RequiresPrivilege: false
Script: "python3 -m venv ./venv && . ./venv/bin/activate && python3 -m
pip install\
\ boto3"
run:
RequiresPrivilege: false
Script:
". ./venv/bin/activate && python3 {artifacts:path}/ggLitePython.py"
# Artifacts:
# - Uri: "---"

0 comments on commit 09dcfc8

Please sign in to comment.