Browse the Repo

file-type-icon.circleci
file-type-icon.github
file-type-iconexamples
file-type-iconkinesis
file-type-iconmsk-with-iam-auth
file-type-iconsns-sqs-connection
file-type-iconsns
file-type-iconsqs-lambda-connection
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconsqs
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...

Browse the Repo

file-type-icon.circleci
file-type-icon.github
file-type-iconexamples
file-type-iconkinesis
file-type-iconmsk-with-iam-auth
file-type-iconsns-sqs-connection
file-type-iconsns
file-type-iconsqs-lambda-connection
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
file-type-iconsqs
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconterraform-cloud-enterprise-private-module-...
Kinesis

Kinesis

Create Kinesis streams with configurable or auto-calculated shard and retention settings.

Code Preview

Preview the Code

mobile file icon

README.md

down

Simple Queuing Service (SQS) to Lambda Trigger Connector

This folder shows an example of how to use the sqs-lambda-connection module to have a Lambda process Queue messages

Quick start

To try these templates out you must have Terraform installed:

  1. Open variables.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default.
  2. Run terraform init.
  3. Run terraform get.
  4. Run terraform plan.
  5. If the plan looks good, run terraform apply.

Here is an example of how you might use a SQS to trigger a Lambda to process the queue:

terraform {
  source = "git::git@github.com:gruntwork-io/terraform-aws-messaging.git//modules/sns-lambda-connection?ref=v0.0.1"
}

dependency "lambda" {
  config_path = "${get_terragrunt_dir()}/../../lambdas/myLambda"
}

dependency "sqs-queue" {
  config_path = "${get_terragrunt_dir()}/../../sqs/srcQueue"
}

# ---------------------------------------------------------------------------------------------------------------------
# MODULE PARAMETERS
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
# ---------------------------------------------------------------------------------------------------------------------
inputs = {
  lambda_arn = dependency.lambda.outputs.function_arn
  sqs_arn    = dependency.sqs-queue.outputs.queue_arn
}

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?