A minimal example of deploying a lambda funtion and an eventbridge scheduler with terraform IaC.
terraform ">= 0.14.9"
aws cli
Lambda-function: Module directory containing the lambda function and all its required resources
lambda-scheduler: Module directory containing aws eventbridge scheduler and all its required resources
main.tf: Entrypoint to the terraform module
providers.tf: aws provider configuration
root.tf: Defines terraform provider and terraform version constraint
variables.tf: Defines variables to be used by the root module
locals.tf: Defines local variables to be used by the terraform modules
The individual terraform scripts have been explained via comments within the scripts.
-
Initialize
terraform init
-
To plan deployment
terraform plan
-
To deploy resources
terraform apply
-
To destroy resources
terraform destroy