【发布时间】:2020-06-06 10:02:39
【问题描述】:
【问题讨论】:
-
您想将它作为硬编码的环境变量传递还是使用 cdk 获取它?
-
@AmitBaranes 请使用 cdk
标签: amazon-web-services aws-lambda amazon-cloudformation aws-cdk
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-cloudformation aws-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')
【讨论】:
AFAIK 恢复的唯一方法是使用自定义资源 (Lambda),例如 (IoTThing):https://aws.amazon.com/blogs/iot/automating-aws-iot-greengrass-setup-with-aws-cloudformation/
【讨论】: