Simple lambda function with API gateway.
-
Create a new
terraform.tfvars
file and provide variable values according tovariables.tf
file.# sample terraform.tfvars file aws_region = "ap-southeast-2" env = "prod" environment = "production" aws_access_key = "XXXX" aws_secret_key = "xxxx"
-
Run terraform cmd to build the lambda function aand api gateway.
terraform init terraform plan terraform apply
-
Example curl cmd.
curl -v -X GET https://<api-gateway-url>/prod/hello
terraform destroy