From a1b1a6d928074c59677c6ee2882c4bf344fc0bd9 Mon Sep 17 00:00:00 2001 From: Hugo Lewenhaupt Date: Wed, 15 Jan 2025 10:00:39 +0100 Subject: [PATCH] The IoT custom resource should return the endpoint even on updates When bumping from 2.1.* to 2.2.* in one of our repos the cr suddenly started updating which caused the deploys to fail. The reason is that when it's updating it's not returning the endpoint as it's not making any call. --- src/ServerlessSpy.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ServerlessSpy.ts b/src/ServerlessSpy.ts index 3e92a46..6cc9a1c 100644 --- a/src/ServerlessSpy.ts +++ b/src/ServerlessSpy.ts @@ -88,6 +88,15 @@ export class ServerlessSpy extends Construct { endpointType: 'iot:Data-ATS', }, }, + onUpdate: { + service: 'Iot', + action: 'describeEndpoint', + physicalResourceId: + custom_resources.PhysicalResourceId.fromResponse('endpointAddress'), + parameters: { + endpointType: 'iot:Data-ATS', + }, + }, installLatestAwsSdk: false, policy: custom_resources.AwsCustomResourcePolicy.fromSdkCalls({ resources: custom_resources.AwsCustomResourcePolicy.ANY_RESOURCE,