[{"data":1,"prerenderedAt":210},["ShallowReactive",2],{"content-guides-building-serverless-applications-with-terraform-06-async-processing":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":22,"contributorPaths":23,"menuType":28,"contentName":29,"slug":30,"readingTime":31,"menu":32,"nextDocItem":123,"previousDocItem":102},"\u003Cp>The previous chapter described how to directly integrate API Gateway with a Lambda function. With this approach, the Lambda function will be invoked synchronously each time API Gateway receives an incoming \u003Ccode>\u002Fgreet\u003C\u002Fcode> request. \u003C\u002Fp>\n\u003Cp>This chapter describes a more resilient and scalable approach, where Amazon SQS queue is used as an intermediary to decouple request intake from processing, ensuring better scalability and error-handling. This asynchronous pattern is recommended when you want to control the processing flow, and protect your downstream dependencies from overflow. For example, during the holiday season there might be tens of thousands of requests to generate greeting cards, but one of the downstream 3rd party dependencies is unable to process requests at this rate. Decoupling the workflow using an SQS queue allows the application to receive large volumes of incoming requests, buffer them in the message queue, and process at a controlled rate. \u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002Fassets\u002Fmodule6.png\" alt=\"\">\u003C\u002Fp>\n\u003Ch2>Creating an Amazon SQS queue\u003C\u002Fh2>\n\u003Cp>The following snippet creates an SQS queue. Note that data encryption is enabled for this queue for extra security. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\">resource &quot;aws_sqs_queue&quot; &quot;greeting_queue&quot; {\n  name                    = &quot;greetings_queue&quot;\n  sqs_managed_sse_enabled = true\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Configuring API Gateway\u003C\u002Fh2>\n\u003Cp>The following snippet configures the API Gateway to send requests as messages to an SQS queue, instead of sending directly to a Lambda function. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\"># Create an IAM Role for API Gateway\nresource &quot;aws_iam_role&quot; &quot;api_gateway_greeting_queue_role&quot; {\n  name = &quot;api_gateway_greeting_queue_role&quot;\n\n  assume_role_policy = jsonencode({\n    Version = &quot;2012-10-17&quot;,\n    Statement = [\n      {\n        Action = &quot;sts:AssumeRole&quot;,\n        Principal = {\n          Service = &quot;apigateway.amazonaws.com&quot;\n        },\n        Effect = &quot;Allow&quot;\n        Sid    = &quot;&quot;\n      }\n    ]\n  })\n}\n\n# Create a policy allowing API Gateway to send messages to the SQS queue\nresource &quot;aws_iam_role_policy&quot; &quot;api_gateway_greeting_queue_role_policy&quot; {\n  name = &quot;api_gateway_greeting_queue_role_policy&quot;\n  role = aws_iam_role.api_gateway_greeting_queue_role.name\n\n  policy = jsonencode({\n    Version = &quot;2012-10-17&quot;,\n    Statement = [\n      {\n        Action   = &quot;sqs:SendMessage&quot;,\n        Effect   = &quot;Allow&quot;,\n        Resource = aws_sqs_queue.greeting_queue.arn\n      }\n    ]\n  })\n}\n\ndata &quot;aws_region&quot; &quot;current&quot; {}\ndata &quot;aws_caller_identity&quot; &quot;current&quot; {}\n\n# Create an integration that sends incoming request body as a message to SQS\nresource &quot;aws_api_gateway_integration&quot; &quot;greet_method_integration&quot; {\n  rest_api_id             = aws_api_gateway_rest_api.greeting_api.id\n  resource_id             = aws_api_gateway_resource.greet_resource.id\n  http_method             = aws_api_gateway_method.greet_method.http_method\n  type                    = &quot;AWS&quot;\n  integration_http_method = &quot;POST&quot;\n  uri                     = &quot;arn:aws:apigateway:${data.aws_region.current.name}:sqs:path\u002F${data.aws_caller_identity.current.account_id}\u002F${aws_sqs_queue.greeting_queue.name}&quot;\n  request_parameters = {\n    &quot;integration.request.header.Content-Type&quot; = &quot;&#39;application\u002Fx-www-form-urlencoded&#39;&quot;\n  }\n  request_templates = {\n    &quot;application\u002Fjson&quot; = &quot;Action=SendMessage&amp;MessageBody=$input.body&quot;\n  }\n  credentials = aws_iam_role.api_gateway_greeting_queue_role.arn\n}\n\nresource &quot;aws_api_gateway_integration_response&quot; &quot;integration_response_200&quot; {\n  rest_api_id = aws_api_gateway_rest_api.greeting_api.id\n  resource_id = aws_api_gateway_resource.greet_resource.id\n  http_method = aws_api_gateway_method.greet_method.http_method\n  status_code = 200\n  selection_pattern = &quot;^2[0-9][0-9]&quot; # Any 2xx response\n\n  response_templates = {\n    &quot;application\u002Fjson&quot; = &quot;{\\&quot;status\\&quot;: \\&quot;success\\&quot;}&quot;\n  }\n\n  depends_on = [aws_api_gateway_integration.greet_method_integration]\n}\n\nresource &quot;aws_api_gateway_method_response&quot; &quot;method_response_200&quot; {\n  rest_api_id = aws_api_gateway_rest_api.greeting_api.id\n  resource_id = aws_api_gateway_resource.greet_resource.id\n  http_method = aws_api_gateway_method.greet_method.http_method\n  status_code = 200\n\n  response_models = {\n    &quot;application\u002Fjson&quot; = &quot;Empty&quot;\n  }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Configuring Lambda event source mapping\u003C\u002Fh2>\n\u003Cp>The following snippet configures the Lambda function to poll messages from the queue for processing. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\"># Create a policy with permissions required to poll messages from an SQS queue\nresource &quot;aws_iam_policy&quot; &quot;greeting_lambda_sqs_policy&quot; {\n  name        = &quot;greeting_lambda_ssqs_policy&quot;\n  description = &quot;Grants access to read messages from SQS&quot;\n\n  policy = jsonencode({\n    Version = &quot;2012-10-17&quot;,\n    Statement = [\n      {\n        Action = [&quot;sqs:ReceiveMessage&quot;, &quot;sqs:DeleteMEssage&quot;, &quot;sqs:GetQueueAttributes&quot;],\n        Effect = &quot;Allow&quot;,\n        Resource = [aws_sqs_queue.greeting_queue.arn]\n      }\n    ]\n  })\n}\n\n# Attach the policy to Lambda execution role created previously\nresource &quot;aws_iam_role_policy_attachment&quot; &quot;greeting_lambda_sqs_policy_attachment&quot; {\n  policy_arn = aws_iam_policy.greeting_lambda_sqs_policy.arn\n  role       = aws_iam_role.greeting_lambda_execution_role.name\n}\n\n# Create a Lambda event-source mapping to enable Lambda to poll from the queue\nresource &quot;aws_lambda_event_source_mapping&quot; &quot;greeting_sqs_mapping&quot; {\n  event_source_arn = aws_sqs_queue.greeting_queue.arn\n  function_name    = aws_lambda_function.greeting_lambda.function_name\n  batch_size       = 1\n\n  depends_on = [aws_iam_role_policy_attachment.greeting_lambda_sqs_policy_attachment ]\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Deploying and testing the application in cloud\u003C\u002Fh2>\n\u003Cp>After running \u003Ccode>terraform apply\u003C\u002Fcode> to apply the changes to the cloud environment, you will see an output containing the API Gateway invocation endpoint\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">Outputs:\n\ngreeting_api_endpoint = &quot;https:\u002F\u002F{api-id}.execute-api.{region}.amazonaws.com\u002Fprod\u002Fgreet&quot;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Use curl, Postman, or similar tools to send requests to the API Gateway endpoint. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">curl -X POST \\\n     -H &#39;Content-Type: application\u002Fjson&#39; \\\n     -d &#39;{&quot;employeeId&quot;:&quot;johnsmith&quot;}&#39; \\\n     https:\u002F\u002F&lt;api-id&gt;.execute-api.&lt;region&gt;.amazonaws.com\u002Fprod\u002Fgreet\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Replace \u003Ccode>&lt;api-id&gt;\u003C\u002Fcode> and \u003Ccode>&lt;region&gt;\u003C\u002Fcode> with the values you got in the previous step.\u003C\u002Fp>\n\u003Cp>You will see a newly generated greeting card named \u003Ccode>greeting-card-johnsmith.html\u003C\u002Fcode> in the destination S3 bucket.  \u003C\u002Fp>\n\u003Chr>\n\u003Ch2>Recap\u003C\u002Fh2>\n\u003Cp>In this chapter you&#39;ve learned how to:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Create an SQS queue and set IAM permissions \u003C\u002Fli>\n\u003Cli>Create an API Gateway integration to send messages to the SQS queue\u003C\u002Fli>\n\u003Cli>Create Lambda policy to allow polling messages from the SQS queue\u003C\u002Fli>\n\u003Cli>Create Lambda integration to process messages from the SQS queue\u003C\u002Fli>\n\u003Cli>Deploy and test the API in cloud\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>By introducing SQS, you&#39;ve enhanced our system&#39;s scalability, as well as improved its resilience and error-handling capacity.\u003C\u002Fp>\n\u003Chr>\n\u003Ch2>Next Step\u003C\u002Fh2>\n\u003Cp>The next chapter will illustrate enabling observability capabilities with Terraform. \u003C\u002Fp>\n",{"title":6,"order":7,"authors":8,"resources":11},"6. Asynchronous processing",6,[9,10],"Anton Aleksandrov","Debasis Rath",[12,16,19],{"link":13,"text":14,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs","AWS Terraform Provider","Documentation",{"link":17,"text":18,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fsqs_queue","aws_sqs_queue",{"link":20,"text":21,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Flambda_event_source_mapping","aws_lambda_event_source_mapping","The previous chapter described how to directly integrate API Gateway with a Lambda function. With this approach, the Lambda function will be invoked synchronously each time API Gateway receives an incoming `\u002Fgreet` request. \n\nThis chapter describes a more resilient and scalable approach, where Amazon SQS queue is used as an intermediary to decouple request intake from processing, ensuring better scalability and error-handling. This asynchronous pattern is recommended when you want to control the processing flow, and protect your downstream dependencies from overflow. For example, during the holiday season there might be tens of thousands of requests to generate greeting cards, but one of the downstream 3rd party dependencies is unable to process requests at this rate. Decoupling the workflow using an SQS queue allows the application to receive large volumes of incoming requests, buffer them in the message queue, and process at a controlled rate. \n\n![](\u002Fassets\u002Fexternal\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002Fassets\u002Fmodule6.png)\n\n## Creating an Amazon SQS queue\n\nThe following snippet creates an SQS queue. Note that data encryption is enabled for this queue for extra security. \n\n```hcl\nresource \"aws_sqs_queue\" \"greeting_queue\" {\n  name                    = \"greetings_queue\"\n  sqs_managed_sse_enabled = true\n}\n```\n\n## Configuring API Gateway \n\nThe following snippet configures the API Gateway to send requests as messages to an SQS queue, instead of sending directly to a Lambda function. \n\n```hcl\n# Create an IAM Role for API Gateway\nresource \"aws_iam_role\" \"api_gateway_greeting_queue_role\" {\n  name = \"api_gateway_greeting_queue_role\"\n\n  assume_role_policy = jsonencode({\n    Version = \"2012-10-17\",\n    Statement = [\n      {\n        Action = \"sts:AssumeRole\",\n        Principal = {\n          Service = \"apigateway.amazonaws.com\"\n        },\n        Effect = \"Allow\"\n        Sid    = \"\"\n      }\n    ]\n  })\n}\n\n# Create a policy allowing API Gateway to send messages to the SQS queue\nresource \"aws_iam_role_policy\" \"api_gateway_greeting_queue_role_policy\" {\n  name = \"api_gateway_greeting_queue_role_policy\"\n  role = aws_iam_role.api_gateway_greeting_queue_role.name\n\n  policy = jsonencode({\n    Version = \"2012-10-17\",\n    Statement = [\n      {\n        Action   = \"sqs:SendMessage\",\n        Effect   = \"Allow\",\n        Resource = aws_sqs_queue.greeting_queue.arn\n      }\n    ]\n  })\n}\n\ndata \"aws_region\" \"current\" {}\ndata \"aws_caller_identity\" \"current\" {}\n\n# Create an integration that sends incoming request body as a message to SQS\nresource \"aws_api_gateway_integration\" \"greet_method_integration\" {\n  rest_api_id             = aws_api_gateway_rest_api.greeting_api.id\n  resource_id             = aws_api_gateway_resource.greet_resource.id\n  http_method             = aws_api_gateway_method.greet_method.http_method\n  type                    = \"AWS\"\n  integration_http_method = \"POST\"\n  uri                     = \"arn:aws:apigateway:${data.aws_region.current.name}:sqs:path\u002F${data.aws_caller_identity.current.account_id}\u002F${aws_sqs_queue.greeting_queue.name}\"\n  request_parameters = {\n    \"integration.request.header.Content-Type\" = \"'application\u002Fx-www-form-urlencoded'\"\n  }\n  request_templates = {\n    \"application\u002Fjson\" = \"Action=SendMessage&MessageBody=$input.body\"\n  }\n  credentials = aws_iam_role.api_gateway_greeting_queue_role.arn\n}\n\nresource \"aws_api_gateway_integration_response\" \"integration_response_200\" {\n  rest_api_id = aws_api_gateway_rest_api.greeting_api.id\n  resource_id = aws_api_gateway_resource.greet_resource.id\n  http_method = aws_api_gateway_method.greet_method.http_method\n  status_code = 200\n  selection_pattern = \"^2[0-9][0-9]\" # Any 2xx response\n\n  response_templates = {\n    \"application\u002Fjson\" = \"{\\\"status\\\": \\\"success\\\"}\"\n  }\n\n  depends_on = [aws_api_gateway_integration.greet_method_integration]\n}\n\nresource \"aws_api_gateway_method_response\" \"method_response_200\" {\n  rest_api_id = aws_api_gateway_rest_api.greeting_api.id\n  resource_id = aws_api_gateway_resource.greet_resource.id\n  http_method = aws_api_gateway_method.greet_method.http_method\n  status_code = 200\n\n  response_models = {\n    \"application\u002Fjson\" = \"Empty\"\n  }\n}\n```\n## Configuring Lambda event source mapping\n\nThe following snippet configures the Lambda function to poll messages from the queue for processing. \n\n```hcl\n# Create a policy with permissions required to poll messages from an SQS queue\nresource \"aws_iam_policy\" \"greeting_lambda_sqs_policy\" {\n  name        = \"greeting_lambda_ssqs_policy\"\n  description = \"Grants access to read messages from SQS\"\n\n  policy = jsonencode({\n    Version = \"2012-10-17\",\n    Statement = [\n      {\n        Action = [\"sqs:ReceiveMessage\", \"sqs:DeleteMEssage\", \"sqs:GetQueueAttributes\"],\n        Effect = \"Allow\",\n        Resource = [aws_sqs_queue.greeting_queue.arn]\n      }\n    ]\n  })\n}\n\n# Attach the policy to Lambda execution role created previously\nresource \"aws_iam_role_policy_attachment\" \"greeting_lambda_sqs_policy_attachment\" {\n  policy_arn = aws_iam_policy.greeting_lambda_sqs_policy.arn\n  role       = aws_iam_role.greeting_lambda_execution_role.name\n}\n\n# Create a Lambda event-source mapping to enable Lambda to poll from the queue\nresource \"aws_lambda_event_source_mapping\" \"greeting_sqs_mapping\" {\n  event_source_arn = aws_sqs_queue.greeting_queue.arn\n  function_name    = aws_lambda_function.greeting_lambda.function_name\n  batch_size       = 1\n\n  depends_on = [aws_iam_role_policy_attachment.greeting_lambda_sqs_policy_attachment ]\n}\n```\n\n## Deploying and testing the application in cloud\n\nAfter running `terraform apply` to apply the changes to the cloud environment, you will see an output containing the API Gateway invocation endpoint\n\n```bash\nOutputs:\n\ngreeting_api_endpoint = \"https:\u002F\u002F{api-id}.execute-api.{region}.amazonaws.com\u002Fprod\u002Fgreet\"\n```\n\nUse curl, Postman, or similar tools to send requests to the API Gateway endpoint. \n\n```bash\ncurl -X POST \\\n     -H 'Content-Type: application\u002Fjson' \\\n     -d '{\"employeeId\":\"johnsmith\"}' \\\n     https:\u002F\u002F\u003Capi-id>.execute-api.\u003Cregion>.amazonaws.com\u002Fprod\u002Fgreet\n```\n\nReplace `\u003Capi-id>` and `\u003Cregion>` with the values you got in the previous step.\n\nYou will see a newly generated greeting card named `greeting-card-johnsmith.html` in the destination S3 bucket.  \n\n---\n\n## Recap\n\nIn this chapter you've learned how to:\n\n1. Create an SQS queue and set IAM permissions \n2. Create an API Gateway integration to send messages to the SQS queue\n3. Create Lambda policy to allow polling messages from the SQS queue\n4. Create Lambda integration to process messages from the SQS queue\n5. Deploy and test the API in cloud \n\nBy introducing SQS, you've enhanced our system's scalability, as well as improved its resilience and error-handling capacity.\n\n---\n\n## Next Step\n\nThe next chapter will illustrate enabling observability capabilities with Terraform. \n\n",[24,25,26,27],"content\u002Fcontributors\u002Fanton-aleksandrov.json","content\u002Fcontributors\u002Fdebasis-rath.json","content\u002Fcontributors\u002Fmatt-ridehalgh.json","content\u002Fcontributors\u002Fluis-cerezo.json","LIST","Building Serverless Applications with Terraform","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F06-async-processing","4 min",[33],{"title":34,"content":35},"Guide",[36,54,70,83,102,115,123,145,161,176,194],{"title":37,"order":38,"authors":39,"resources":40,"time":31,"path":51,"id":52,"link":53},"1. Introduction",1,[9,10],[41,45,48],{"link":42,"text":43,"type":44},"https:\u002F\u002Faws.amazon.com\u002Fserverless\u002Fsam\u002F","AWS Serverless Application Model (SAM)","link",{"link":46,"text":47,"type":44},"https:\u002F\u002Faws.amazon.com\u002Fcdk\u002F","AWS Cloud Development Kit (CDK)",{"link":49,"text":50,"type":44},"https:\u002F\u002Fwww.terraform.io\u002F","Hashicorp Terraform","01-introduction","01-introduction.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F01-introduction",{"title":55,"order":56,"authors":57,"resources":58,"time":66,"path":67,"id":68,"link":69},"2. Solution Overview",2,[9,10],[59,60,63],{"link":49,"text":50,"type":44},{"link":61,"text":62,"type":44},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Fuserguide\u002Fgetting-started-install.htm","AWS CLI",{"link":64,"text":65,"type":44},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fiam\u002F","AWS IAM","3 min","02-solution-overview","02-solution-overview.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F02-solution-overview",{"title":71,"order":72,"authors":73,"resources":75,"time":31,"path":80,"id":81,"link":82},"3. S3 buckets",3,[9,10,74],"Matt Ridehalgh",[76,77],{"link":13,"text":14,"type":15},{"link":78,"text":79,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fs3_bucket","aws_s3_bucket","03-s3-buckets","03-s3-buckets.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F03-s3-buckets",{"title":84,"order":85,"authors":86,"resources":87,"time":31,"path":99,"id":100,"link":101},"4. Lambda functions",4,[9,10],[88,89,92,95],{"link":13,"text":14,"type":15},{"link":90,"text":91,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Flambda_function","aws_lambda_function",{"link":93,"text":94,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fserverless-application-model\u002Flatest\u002Fdeveloperguide\u002Fterraform-support.html","AWS SAM Terraform support",{"link":96,"text":97,"type":98},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fbuilding-serverless-applications-with-terraform\u002Fblob\u002Fmain\u002Flambdas\u002Fgreetings_lambda\u002Findex.mjs","index.mjs","Sample","04-lambda-functions","04-lambda-functions.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F04-lambda-functions",{"title":103,"order":104,"authors":105,"resources":106,"time":31,"path":112,"id":113,"link":114},"5. API Gateway",5,[9,10],[107,108,111],{"link":13,"text":14,"type":15},{"link":109,"text":110,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fapi_gateway_rest_api","aws_api_gateway_rest_api",{"link":93,"text":94,"type":15},"05-api-gateway","05-api-gateway.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F05-api-gateway",{"title":6,"order":7,"authors":116,"resources":117,"time":31,"path":121,"id":122,"link":30},[9,10],[118,119,120],{"link":13,"text":14,"type":15},{"link":17,"text":18,"type":15},{"link":20,"text":21,"type":15},"06-async-processing","06-async-processing.md",{"title":124,"order":125,"authors":126,"resources":127,"time":141,"path":142,"id":143,"link":144},"7. Observability",7,[9,10],[128,129,132,135,138],{"link":13,"text":14,"type":15},{"link":130,"text":131,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Flambda-monitoring.html","Lambda function observability, monitoring, and troubleshooting",{"linke":133,"text":134,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Frest-api-monitor.html","Monitoring API Gateway REST API",{"link":136,"text":137,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fapi_gateway_account","aws_api_gateway_account",{"link":139,"text":140,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fapi_gateway_stage","aws_api_gateway_stage","5 min","07-observability","07-observability.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F07-observability",{"title":146,"order":147,"authors":148,"resources":149,"time":157,"path":158,"id":159,"link":160},"8. Modularizing your IaC projects",8,[9,10],[150,151,154],{"link":13,"text":14,"type":15},{"link":152,"text":153,"type":15},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Flanguage\u002Fmodules","Terraform Modules",{"link":155,"text":156,"type":98},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fbuilding-serverless-applications-with-terraform","Sample project source code","8 min","08-modularizing-your-iac-projects","08-modularizing-your-iac-projects.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F08-modularizing-your-iac-projects",{"title":162,"order":163,"authors":164,"resources":165,"time":172,"path":173,"id":174,"link":175},"9. Summary and next steps",9,[9,10],[166,167,169,171],{"link":13,"text":14,"type":15},{"link":168,"text":50,"type":15},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform",{"link":42,"text":170,"type":15},"AWS SAM",{"link":155,"text":156,"type":98},"2 min","09-summary","09-summary.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F09-summary",{"title":177,"order":178,"authors":179,"resources":181,"time":141,"path":191,"id":192,"link":193},"10. Appendix A - Amazon EventBridge",10,[9,10,180],"Luis Cerezo",[182,185,188],{"link":183,"text":184,"type":15},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fcloudwatch_event_bus","aws_cloudwatch_event_bus Terraform resource",{"link":186,"text":187,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fhealth\u002Flatest\u002Fug\u002Fcloudwatch-events-health.html","Monitoring AWS Health events with Amazon EventBridge",{"link":189,"text":190,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fhealth\u002Flatest\u002Fug\u002Faws-health-planned-lifecycle-events.html#planned-lifecycle-event-notifications","Planned lifecycle events for AWS Health - What should I expect when I receive a planned lifecycle event notification?","10-appendix-A-EventBridge","10-appendix-A-EventBridge.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F10-appendix-A-EventBridge",{"title":195,"order":196,"authors":197,"resources":198,"time":31,"path":207,"id":208,"link":209},"10. Appendix B - AWS Step Functions",11,[9,10,180],[199,202,204],{"link":200,"text":201,"type":15},"https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fdevops\u002Fbest-practices-for-writing-step-functions-terraform-projects\u002F","Best Practices for Writing Step Functions Terraform Projects",{"link":183,"text":203,"type":15},"cloudwatch_event_bus terraform resource",{"link":205,"text":206,"type":15},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconcepts-amazon-states-language.html","Amazon States Language","10-appendix-B-SFN","10-appendix-B-SFN.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F10-appendix-B-SFN",1792578865624]