Skip to content

Simple deployment of AWS EventBridge Rule to execute a AWS Lambda Function when a Tag is changed on a VPC.

License

Notifications You must be signed in to change notification settings

salsop/aws-tag-change-eventbridge-execute-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running a Lambda Function after a VPC is tagged with a specific Key, Value Pair

A simple example of an EventBridge Rule to invoke a very simple Lambda Function when a specific Tag is Created, Updated, or Deleted on a VPC.

AWS Flow Chart

Deploying the Resources

This deployment is based on a simple terraform plan. The terraform produces the following items:

  • IAM Role for the Lambda Function to use.
  • Lambda Function
  • EventBridge Rule with Lambda as Target
  • VPC (with the RunLambda tag)

To deploy this terraform just initiate the normal terraform steps:

  1. Run terraform init

  2. Run terrafrom apply, and type Yes when prompted to complete the deployment.

Testing the Deployment

Once completed just Edit or Delete the the RunLambda tag on the VPC, and change in the value will result in the Lambda Function executing.

You can review the results of the Lambda execution in the CloudWatch Logs.

Removing the Resources

Once you've completed your testing you can remove the resources in the normal way by running terraform destroy and entering Yes.

About

Simple deployment of AWS EventBridge Rule to execute a AWS Lambda Function when a Tag is changed on a VPC.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published