gpt4 book ai didi

amazon-web-services - 如何在CDK中获取AWS IoT自定义终端节点?

转载 作者:行者123 更新时间:2023-12-04 16:41:17 25 4
gpt4 key购买 nike

我想将 IoT 自定义端点作为环境变量传递给 CDK 中声明的 lambda .

我正在谈论位于此处的 IoT 自定义端点: enter image description here

如何在 CDK 上下文中获取它?

最佳答案

您可以引用AWS示例代码: https://github.com/aws-samples/aws-iot-cqrs-example/blob/master/lib/querycommandcontainers.ts

const getIoTEndpoint = new customResource.AwsCustomResource(this, 'IoTEndpoint', {
onCreate: {
service: 'Iot',
action: 'describeEndpoint',
physicalResourceId: customResource.PhysicalResourceId.fromResponse('endpointAddress'),
parameters: {
"endpointType": "iot:Data-ATS"
}
},
policy: customResource.AwsCustomResourcePolicy.fromSdkCalls({resources: customResource.AwsCustomResourcePolicy.ANY_RESOURCE})
});

const IOT_ENDPOINT = getIoTEndpoint.getResponseField('endpointAddress')

关于amazon-web-services - 如何在CDK中获取AWS IoT自定义终端节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60347716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com