MCPcopy Create free account
hub / github.com/aws-samples/aws-cdk-examples / on_delete

Function on_delete

python/iotcore/lambda/cert_handler.py:35–55  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

33 }
34
35def on_delete(event):
36 try:
37 secrets_manager.delete_secret(
38 SecretId=SECRET_NAME,
39 ForceDeleteWithoutRecovery=True
40 )
41 except ClientError:
42 pass
43
44 certificate_id = event['PhysicalResourceId']
45
46 iot.update_certificate(
47 certificateId=certificate_id,
48 newStatus='INACTIVE'
49 )
50
51 time.sleep(2)
52
53 iot.delete_certificate(
54 certificateId=certificate_id
55 )
56
57def lambda_handler(event, context):
58 print('Received event:', event)

Callers 1

lambda_handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected