amazon-web-services - 尝试使用 cloudformation 在 AWS greengrass 版本 2 中创建物联网组件时出错

标签 amazon-web-services aws-cloudformation aws-iot-greengrass

我最近做了一个配置,其中我使用 aws 控制台从配方中创建了 greengrass 组件,另一个配置是从 lambda 文件导入配置。当我使用 aws 控制台执行此操作时,它们都运行良好。但是,我希望能够使用 cloudformation 生成相同的配置。我已阅读此处的文档 component version它说我可以添加内联配方文件或使用 LambdaFunctionRecipeSource 向其发送 lambda 函数。然而我所有的尝试都失败并出现错误


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)

但是,我已向用户 harisu 授予管理员访问权限,并确保他拥有对 greengrass 服务的完全访问权限。 我的示例 cfn 文件是


  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
     "

我将不胜感激任何帮助

最佳答案

对于在故障排除时遇到此问题的其他人,请参阅 https://greengrassv2.workshop.aws/en/chapter4_createfirstcomp/30_step3.html 。它指出这通常是由于配方定义不是有效的 json 或 yaml 造成的。就我而言,这是真的,我有一个 yaml 语法错误。我无法立即看出这里是否是这种情况或您的错误在哪里。

关于amazon-web-services - 尝试使用 cloudformation 在 AWS greengrass 版本 2 中创建物联网组件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67626744/

相关文章:

amazon-web-services - AWS Cloudformation 输出 ElastiCacheCluster

amazon-web-services - CloudFormation - 在禁用状态下创建 SNS 订阅

amazon-web-services - 如何在 Windows 10 上安装 aws iot greengrass

cloud - 如何将 EC2 实例自动添加到现有安全组、弹性 IP 和 VPC 中?

python - 使用 greengrass 在本地设备上执行 lambda 函数

python - "decoder jpeg not available"在 AWS Elastic Beanstalk 上使用 Pillow

Java 以编程方式绕过代理 apache

amazon-web-services - 为什么我的 AWS cloudfront 可以工作,但不安全?

amazon-web-services - 如何在 Cloudformation 中按用户名隔离事件