Greengrass V2 中具有 IPC 权限的 Lambda component

0

【以下的问题经过翻译处理】 我们已经将一个lambda从AWS Greengrass v1迁移至AWS Greengrass v2。这个lambda需要从Greengrass Core中提取和解密一个密码。

我们如何授权组件对lambda执行IPC权限呢?常规component recipe有个选项ComponentConfiguration/DefaultConfiguration/accessControl。然而,当我们使用AWS CLI从lambda构建组件create-component-version并选择--lambda-function选项时,没有选项来分配授权策略。

我们尝试使其正常工作的一种方法是使用部署中的merge update(如文档所示所述)。

    "accessControl": {
        "aws.greengrass.SecretManager": {
            "<my-component>:secrets:1": {
                "policyDescription": "Credentials for server running on edge.",
                "operations": [
                    "aws.greengrass#GetSecretValue"
                ],
                "resources": [
                    "arn:aws:secretsmanager:us-east-1:<account-id>:secret:xxxxxxxxxx"
                ]
            }
        }
    }

然而,组件的最终配方(在部署中)不显示accessControl(AWS Greengrass控制台),因此我们认为它没有被merge updated

...
  "ComponentConfiguration": {
    "DefaultConfiguration": {
      "lambdaExecutionParameters": {
        "EnvironmentVariables": {
          "LOG_LEVEL": "DEBUG"
        }
      },
      "containerParams": {
        "memorySize": 16384,
        "mountROSysfs": false,
        "volumes": {},
        "devices": {}
      },
      "containerMode": "NoContainer",
      "timeoutInSeconds": 30,
      "maxInstancesCount": 10,
      "inputPayloadEncodingType": "json",
      "maxQueueSize": 200,
      "pinned": false,
      "maxIdleTimeInSeconds": 30,
      "statusTimeoutInSeconds": 30,
      "pubsubTopics": {
        "0": {
          "topic": "dt/app/+/status/update",
          "type": "PUB_SUB"
        }
      }
    }
  },

欢迎指正,多谢!

profile picture
专家
已提问 5 个月前22 查看次数
1 回答
0

【以下的回答经过翻译处理】 合并更新(merge updates)是部署过程中的一种方式,它们不会更新组件的配方(recipe)。 合并是设置访问控制的正确方式。您可以使用本地Greengrass CLI查看在设备上实际应用的配置。 https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-cli-component.html#component-details

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则