# MIT No Attribution # # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of # the Software, and to permit persons to whom the Software is furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- RecipeFormatVersion: 2020-01-25 ComponentName: com.aws.secretsManagerPythonExample ComponentVersion: '0.1.0' ComponentDescription: | Demonstrates how to use AWS Secrets Manager with Greengrass v2 in Python, and publish to AWS IoT Core. ComponentPublisher: Amazon Web Services, Inc. ComponentDependencies: aws.greengrass.SecretManager: VersionRequirement: 2.0.5 DependencyType: SOFT ComponentConfiguration: DefaultConfiguration: accessControl: aws.greengrass.ipc.mqttproxy: "com.aws.secretsManagerPythonExample:pub:1": policyDescription: Allows access to publish to IoT Core topic(s). operations: - "aws.greengrass#PublishToIoTCore" resources: - "ggv2/secrets/demo" aws.greengrass.SecretManager: "com.aws.secretsManagerPythonExample:secrets:1": policyDescription: Allows access to Secret Manager value(s) operations: - "aws.greengrass#GetSecretValue" resources: - "*" Manifests: - Platform: os: all Artifacts: - URI: s3://YOUR_BUCKET_NAME/artifacts/com.aws.secretsManagerPythonExample/0.1.0/secrets_manager_demo.py Lifecycle: Install: | pip3 install awsiotsdk Run: | python3 {artifacts:path}/secrets_manager_demo.py