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
EXPERTE
gefragt vor 5 Monaten26 Aufrufe
1 Antwort
0

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

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen