From 5000cdc98103a51313b7f7f931ce7338030215f2 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Mon, 30 Sep 2024 23:08:35 +0500 Subject: [PATCH] updated template for unauth geofences --- .../default-unauth-resources-template.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/extra/cloudformation/default-unauth-resources-template.yaml b/extra/cloudformation/default-unauth-resources-template.yaml index f6a9c7c7..c7e8ea30 100644 --- a/extra/cloudformation/default-unauth-resources-template.yaml +++ b/extra/cloudformation/default-unauth-resources-template.yaml @@ -904,6 +904,36 @@ Resources: Properties: ServiceToken: !GetAtt AmazonLocationGeoFenceLambda.Arn + GeofenceLambdaTrigger: + Type: AWS::Events::Rule + DependsOn: AmazonLocationGeoFenceLambda + Properties: + Name: GeofenceLambdaTrigger + EventPattern: + Fn::Sub: >- + {"source":["aws.cloudformation"],"region":["${AWS::Region}"],"detail-type":["CloudFormation + Stack Status + Change"],"detail":{"stack-id":["${AWS::StackId}"],"status-details":{"status":["UPDATE_IN_PROGRESS"]}}} + State: ENABLED + Targets: + - Id: Id1acddeab-175e-495f-8b56-8d8de684f610 + Arn: + Fn::Sub: >- + arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:AmazonLocationDemoGeofenceCreator + Input: |- + { + "RequestType": "Update" + } + + GeofenceTriggerInvokePermission: + Type: AWS::Lambda::Permission + DependsOn: [AmazonLocationGeoFenceLambda, GeofenceLambdaTrigger] + Properties: + Action: lambda:InvokeFunction + FunctionName: AmazonLocationDemoGeofenceCreator + Principal: events.amazonaws.com + SourceArn: !GetAtt [GeofenceLambdaTrigger, Arn] + AmazonLocationGeoFenceLambda: DependsOn: AmazonLocationGeoFenceLambdaExecutionPolicy Type: AWS::Lambda::Function