I recently did a configuration where I created a component in using the aws console for greengrass from a recipe and another where I imported the config from a lambda file. They both work well when I do it using the aws console. However, I want to be able to produce this same configuration using cloudformation. I have read the documentation here component version and it says I can be able to add a recipe file inline or send it a lambda function using the LambdaFunctionRecipeSource
. However all my attempt fail with the error
Resource handler returned message: "User: arn:aws:iam::accountIDHere:user/harisu is not
authorized to perform: null (Service: GreengrassV2, Status Code: 403, Request ID: f517f1ff-a387-
4380-8a47-bd6d41fd628e, Extended Request ID: null)"
(RequestToken: d6f8042d-687e-0afa-e75d-d80f27a7f177, HandlerErrorCode: AccessDenied)
I have however granted administrator access to the user harisu
and I ensured he has the full access to the greengrass service.
My example cfn file is
TestComponentVersion:
Type: AWS::GreengrassV2::ComponentVersion
Properties:
InlineRecipe: "---
RecipeFormatVersion: '2020-01-25'
ComponentName: com.example.HelloWorld
ComponentVersion: 1.0.0
ComponentDescription: My first AWS IoT Greengrass component.
ComponentPublisher: Amazon
ComponentConfiguration:
DefaultConfiguration:
Message: world
Manifests:
- Name: Linux
Platform:
os: linux
Lifecycle:
Run: |
python3 {artifacts:path}/hello_world.py '{configuration:/Message}'
Artifacts:
- URI: s3://DOC-EXAMPLE-BUCKET/artifacts/com.example.HelloWorld/1.0.0/hello_world.py
"
I will appreciate any help