[{"data":1,"prerenderedAt":211},["ShallowReactive",2],{"content-guides-building-serverless-applications-with-terraform-10-appendix-B-SFN":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":23,"contributorPaths":24,"menuType":29,"contentName":30,"slug":31,"readingTime":32,"menu":33,"nextDocItem":210,"previousDocItem":186},"\u003Ch2>Appendix B - AWS Step Functions in Terraform\u003C\u002Fh2>\n\u003Cp>This appendix shows how to use Terraform to provision AWS Step Functions. Step Functions are defined in \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconcepts-amazon-states-language.html\">Amazon States Language\u003C\u002Fa>, (ASL). The ASL file is templitized and stored it in a directory called \u003Ccode>statemachines\u002F\u003C\u002Fcode>. \u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"\u002Fassets\u002Fexternal\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002Fassets\u002Fappendix-B-stepFunction.png\" alt=\"&#39;stepfunction&#39;\">\u003C\u002Fp>\n\u003Cp>The Terraform directory structure looks like this:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-bash\">├── lambda\n├── main.tf\n├── modules\n│   └── my-function-get-external-data_id\n│       ├── eb.tf\n│       ├── function\n│       │   ├── lambda_my-function-get-external-data.py\n│       │   └── lambda_my-function-get-external-data.py.zip\n│       ├── lambda.tf\n│       ├── main.tf\n│       ├── statemachine\n│       │   └── my-sfn-pattern.asl\n│       ├── statemachine.tf\n│       └── versions.tf\n├── outputs.tf\n├── providers.tf\n├── samples\n│   ├── sample-event.json\n│   └── stepfunctions_graph.png\n├── variables.tf\n└── versions.tf\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>To create the Amazon EventBridge custom event bus resource, use the \u003Ccode>cloudwatch_event_bus\u003C\u002Fcode> Terraform resource.\u003C\u002Fp>\n\u003Cp>In the \u003Ccode>eb.tf\u003C\u002Fcode> example file you can see custom event bus created with a source of \u003Ccode>my.events\u003C\u002Fcode>\nIAM required policies are covered in Appendix A.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\">resource &quot;aws_cloudwatch_event_bus&quot; &quot;my_events&quot; {\n  name = &quot;my_events&quot;\n}\n# eb rule with target and role for source &quot;my.events&quot;\nresource &quot;aws_cloudwatch_event_rule&quot; &quot;my-event-rule&quot; {\n  name           = &quot;eb-rule-${random_string.random.id}&quot; \n  event_bus_name = aws_cloudwatch_event_bus.txn_events.name\n  event_pattern  = &lt;&lt;EOT\n{\n    &quot;source&quot;: [&quot;my.events&quot;]\n}\nEOT\n  role_arn       = aws_iam_role.eb_rule_role.arn\n}\n\nresource &quot;aws_cloudwatch_event_target&quot; &quot;txn-sfn-target&quot; {\n    rule           = aws_cloudwatch_event_rule.txn-event-rule.name\n    arn            = aws_sfn_state_machine.GetCorrelationId.arn\n    role_arn       = aws_iam_role.eb_rule_role.arn\n    event_bus_name = aws_cloudwatch_event_bus.txn_events.name\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>As EventBridge is covered in previous chapters, this appendix focussed on ASL. It uses Terraform&#39;s built-in \u003Ccode>templatefile\u003C\u002Fcode> to build the resource. \u003C\u002Fp>\n\u003Cp>You can define the Step Functions workflow using the resource \u003Ccode>aws_sfn_state_machine\u003C\u002Fcode>. This appendix does not cover creating the SNS Topic or the Lambda function. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\">resource &quot;aws_sfn_state_machine&quot; &quot;my-sfn-pattern&quot; {\n  name       = &quot;my-sfn-pattern-${random_string.random.id}&quot;\n  definition = templatefile(&quot;${path.module}\u002Fstatemachine\u002Fmy-sfn-pattern.asl&quot;,\n  {\n    aws_lambda_arn = aws_lambda_function.my_lambda_function.arn\n    aws_sns_arn     = aws_sns_topic.notify_secops.id\n  })\n  role_arn   = aws_iam_role.iam_for_state_machine.arn\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>To build the ASL file you can use \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fworkflow-studio.html\">AWS Step Functions Workflow Studio\u003C\u002Fa> in the AWS Console, or in your IDE, such as VS Code, using the \u003Ca href=\"https:\u002F\u002Fdocs.aws.amazon.com\u002Ftoolkit-for-vscode\u002Flatest\u002Fuserguide\u002Fbuilding-stepfunctions.html#starting-stepfunctions\">AWS Toolkit for Visual Studio Code\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>The following snippet is an example state machine definition. \u003Ccode>statemachine\u002Fmy-sfn-pattern.asl\u003C\u002Fcode> The State Machine receives an event from EventBridge, sends the event to Lambda. The Lambda retrieves external data and sends the data to SNS. \u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-asl\">{\n  &quot;Comment&quot;: &quot;An example of the Amazon States Language for getting external data using a Lambda function.&quot;,\n  &quot;StartAt&quot;: &quot;my-sfn-pattern&quot;,\n  &quot;States&quot;: {\n    &quot;my-sfn-pattern&quot;: {\n      &quot;Type&quot;: &quot;Task&quot;,\n      &quot;Resource&quot;: &quot;${aws_lambda_arn}:$LATEST&quot;,\n      &quot;Retry&quot;: [\n        {\n          &quot;ErrorEquals&quot;: [\n            &quot;States.ALL&quot;\n          ],\n          &quot;IntervalSeconds&quot;: 1,\n          &quot;MaxAttempts&quot;: 3,\n          &quot;BackoffRate&quot;: 2\n        }\n      ],\n      &quot;InputPath&quot;: &quot;$.detail&quot;,\n      &quot;Next&quot;: &quot;SNS Publish&quot;\n    },\n    &quot;SNS Publish&quot;: {\n      &quot;Type&quot;: &quot;Task&quot;,\n      &quot;Resource&quot;: &quot;arn:aws:states:::sns:publish&quot;,\n      &quot;Parameters&quot;: {\n        &quot;Message.$&quot;: &quot;$&quot;,\n        &quot;TopicArn&quot;: &quot;${aws_sns_arn}&quot;\n      },\n      &quot;End&quot;: true\n    }\n  },\n  &quot;TimeoutSeconds&quot;: 600\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>You need to grant the Step Functions state machine IAM permission to act on the resources defined in the state machine. In this example you can see policies and a role to allow the state machine to invoke the Lambda function, and send a message to SNS.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-hcl\">## IAM policies to attach to role for StateMachine\n\ndata &quot;aws_iam_policy_document&quot; &quot;states_assume_role&quot; {\n  statement {\n    effect = &quot;Allow&quot;\n\n    principals {\n      type        = &quot;Service&quot;\n      identifiers = [&quot;states.amazonaws.com&quot;]\n    }\n\n    actions = [&quot;sts:AssumeRole&quot;]\n  }\n}\n\ndata &quot;aws_iam_policy_document&quot; &quot;invoke-lambda&quot; {\n  statement {\n            effect = &quot;Allow&quot;\n            actions = [\n                &quot;lambda:InvokeFunction&quot;\n            ]\n            resources = [\n                &quot;${aws_lambda_function.my_lambda_function.arn}:*&quot;,\n                &quot;${aws_lambda_function.my_lambda_function.arn}&quot; ]\n            }\n}\n\ndata &quot;aws_iam_policy_document&quot; &quot;publish-sns&quot; {\n  statement {\n            effect = &quot;Allow&quot;\n            actions = [\n                &quot;sns:Publish&quot;\n            ]\n            resources = [aws_sns_topic.notify_secops.arn]\n            }\n}\n\nresource &quot;aws_iam_policy&quot; &quot;invoke-lambda&quot; {\n    name = &quot;InvokeLambda-${random_string.random.id}&quot;\n    policy = data.aws_iam_policy_document.invoke-lambda.json\n}\n\nresource &quot;aws_iam_policy&quot; &quot;publish-sns&quot; {\n    name = &quot;PublishSns-${random_string.random.id}&quot;\n    policy = data.aws_iam_policy_document.publish-sns.json\n}\n\nresource &quot;aws_iam_role&quot; &quot;iam_for_state_machine&quot; {\n  name               = &quot;my-sfn-pattern-${random_string.random.id}&quot;\n  assume_role_policy = data.aws_iam_policy_document.states_assume_role.json\n}\n\nresource &quot;aws_iam_role_policy_attachment&quot; &quot;state-machine-lambda&quot; {\n    role = aws_iam_role.iam_for_state_machine.name\n    policy_arn = aws_iam_policy.invoke-lambda.arn\n}\n\nresource &quot;aws_iam_role_policy_attachment&quot; &quot;state-machine-sns&quot; {\n    role = aws_iam_role.iam_for_state_machine.name\n    policy_arn = aws_iam_policy.publish-sns.arn\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>Recap\u003C\u002Fh2>\n\u003Cp>In this Appendix you learned how to:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Create a AWS Step Functions state machine using ASL.\u003C\u002Fli>\n\u003Cli>Create a template file of the state machine.\u003C\u002Fli>\n\u003Cli>Create IAM policies to allow the state machine to interact with resources such as SNS and Lambda.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2>Next Steps\u003C\u002Fh2>\n\u003Cp>Learn more about using AWS Step Functions with the following workshops\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fcatalog.us-east-1.prod.workshops.aws\u002Fworkshops\u002F9e0368c0-8c49-4bec-a210-8480b51a34ac\u002Fen-US\">The AWS Step Functions Workshop\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"https:\u002F\u002Fcatalog.us-east-1.prod.workshops.aws\u002Fworkshops\u002F2a22e604-2f2e-4d7b-85a8-33b38c999234\u002Fen-US\">Large-scale Data Processing with Step Functions\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n",{"title":6,"order":7,"authors":8,"resources":12},"10. Appendix B - AWS Step Functions",11,[9,10,11],"Anton Aleksandrov","Debasis Rath","Luis Cerezo",[13,17,20],{"link":14,"text":15,"type":16},"https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fdevops\u002Fbest-practices-for-writing-step-functions-terraform-projects\u002F","Best Practices for Writing Step Functions Terraform Projects","Documentation",{"link":18,"text":19,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fcloudwatch_event_bus","cloudwatch_event_bus terraform resource",{"link":21,"text":22,"type":16},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconcepts-amazon-states-language.html","Amazon States Language","## Appendix B - AWS Step Functions in Terraform\n\nThis appendix shows how to use Terraform to provision AWS Step Functions. Step Functions are defined in [Amazon States Language](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconcepts-amazon-states-language.html), (ASL). The ASL file is templitized and stored it in a directory called `statemachines\u002F`. \n\n\n!['stepfunction'](\u002Fassets\u002Fexternal\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002Fassets\u002Fappendix-B-stepFunction.png)\n\nThe Terraform directory structure looks like this:\n\n```bash\n├── lambda\n├── main.tf\n├── modules\n│   └── my-function-get-external-data_id\n│       ├── eb.tf\n│       ├── function\n│       │   ├── lambda_my-function-get-external-data.py\n│       │   └── lambda_my-function-get-external-data.py.zip\n│       ├── lambda.tf\n│       ├── main.tf\n│       ├── statemachine\n│       │   └── my-sfn-pattern.asl\n│       ├── statemachine.tf\n│       └── versions.tf\n├── outputs.tf\n├── providers.tf\n├── samples\n│   ├── sample-event.json\n│   └── stepfunctions_graph.png\n├── variables.tf\n└── versions.tf\n```\nTo create the Amazon EventBridge custom event bus resource, use the `cloudwatch_event_bus` Terraform resource.\n\nIn the `eb.tf` example file you can see custom event bus created with a source of `my.events`\nIAM required policies are covered in Appendix A.\n\n```hcl\nresource \"aws_cloudwatch_event_bus\" \"my_events\" {\n  name = \"my_events\"\n}\n# eb rule with target and role for source \"my.events\"\nresource \"aws_cloudwatch_event_rule\" \"my-event-rule\" {\n  name           = \"eb-rule-${random_string.random.id}\" \n  event_bus_name = aws_cloudwatch_event_bus.txn_events.name\n  event_pattern  = \u003C\u003CEOT\n{\n    \"source\": [\"my.events\"]\n}\nEOT\n  role_arn       = aws_iam_role.eb_rule_role.arn\n}\n\nresource \"aws_cloudwatch_event_target\" \"txn-sfn-target\" {\n    rule           = aws_cloudwatch_event_rule.txn-event-rule.name\n    arn            = aws_sfn_state_machine.GetCorrelationId.arn\n    role_arn       = aws_iam_role.eb_rule_role.arn\n    event_bus_name = aws_cloudwatch_event_bus.txn_events.name\n}\n```\nAs EventBridge is covered in previous chapters, this appendix focussed on ASL. It uses Terraform's built-in `templatefile` to build the resource. \n\nYou can define the Step Functions workflow using the resource `aws_sfn_state_machine`. This appendix does not cover creating the SNS Topic or the Lambda function. \n\n```hcl\nresource \"aws_sfn_state_machine\" \"my-sfn-pattern\" {\n  name       = \"my-sfn-pattern-${random_string.random.id}\"\n  definition = templatefile(\"${path.module}\u002Fstatemachine\u002Fmy-sfn-pattern.asl\",\n  {\n    aws_lambda_arn = aws_lambda_function.my_lambda_function.arn\n    aws_sns_arn     = aws_sns_topic.notify_secops.id\n  })\n  role_arn   = aws_iam_role.iam_for_state_machine.arn\n}\n```\nTo build the ASL file you can use [AWS Step Functions Workflow Studio](https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fworkflow-studio.html) in the AWS Console, or in your IDE, such as VS Code, using the [AWS Toolkit for Visual Studio Code](https:\u002F\u002Fdocs.aws.amazon.com\u002Ftoolkit-for-vscode\u002Flatest\u002Fuserguide\u002Fbuilding-stepfunctions.html#starting-stepfunctions)\n\nThe following snippet is an example state machine definition. `statemachine\u002Fmy-sfn-pattern.asl` The State Machine receives an event from EventBridge, sends the event to Lambda. The Lambda retrieves external data and sends the data to SNS. \n\n```asl\n{\n  \"Comment\": \"An example of the Amazon States Language for getting external data using a Lambda function.\",\n  \"StartAt\": \"my-sfn-pattern\",\n  \"States\": {\n    \"my-sfn-pattern\": {\n      \"Type\": \"Task\",\n      \"Resource\": \"${aws_lambda_arn}:$LATEST\",\n      \"Retry\": [\n        {\n          \"ErrorEquals\": [\n            \"States.ALL\"\n          ],\n          \"IntervalSeconds\": 1,\n          \"MaxAttempts\": 3,\n          \"BackoffRate\": 2\n        }\n      ],\n      \"InputPath\": \"$.detail\",\n      \"Next\": \"SNS Publish\"\n    },\n    \"SNS Publish\": {\n      \"Type\": \"Task\",\n      \"Resource\": \"arn:aws:states:::sns:publish\",\n      \"Parameters\": {\n        \"Message.$\": \"$\",\n        \"TopicArn\": \"${aws_sns_arn}\"\n      },\n      \"End\": true\n    }\n  },\n  \"TimeoutSeconds\": 600\n}\n```\n\nYou need to grant the Step Functions state machine IAM permission to act on the resources defined in the state machine. In this example you can see policies and a role to allow the state machine to invoke the Lambda function, and send a message to SNS.\n\n```hcl\n## IAM policies to attach to role for StateMachine\n\ndata \"aws_iam_policy_document\" \"states_assume_role\" {\n  statement {\n    effect = \"Allow\"\n\n    principals {\n      type        = \"Service\"\n      identifiers = [\"states.amazonaws.com\"]\n    }\n\n    actions = [\"sts:AssumeRole\"]\n  }\n}\n\ndata \"aws_iam_policy_document\" \"invoke-lambda\" {\n  statement {\n            effect = \"Allow\"\n            actions = [\n                \"lambda:InvokeFunction\"\n            ]\n            resources = [\n                \"${aws_lambda_function.my_lambda_function.arn}:*\",\n                \"${aws_lambda_function.my_lambda_function.arn}\" ]\n            }\n}\n\ndata \"aws_iam_policy_document\" \"publish-sns\" {\n  statement {\n            effect = \"Allow\"\n            actions = [\n                \"sns:Publish\"\n            ]\n            resources = [aws_sns_topic.notify_secops.arn]\n            }\n}\n\nresource \"aws_iam_policy\" \"invoke-lambda\" {\n    name = \"InvokeLambda-${random_string.random.id}\"\n    policy = data.aws_iam_policy_document.invoke-lambda.json\n}\n\nresource \"aws_iam_policy\" \"publish-sns\" {\n    name = \"PublishSns-${random_string.random.id}\"\n    policy = data.aws_iam_policy_document.publish-sns.json\n}\n\nresource \"aws_iam_role\" \"iam_for_state_machine\" {\n  name               = \"my-sfn-pattern-${random_string.random.id}\"\n  assume_role_policy = data.aws_iam_policy_document.states_assume_role.json\n}\n\nresource \"aws_iam_role_policy_attachment\" \"state-machine-lambda\" {\n    role = aws_iam_role.iam_for_state_machine.name\n    policy_arn = aws_iam_policy.invoke-lambda.arn\n}\n\nresource \"aws_iam_role_policy_attachment\" \"state-machine-sns\" {\n    role = aws_iam_role.iam_for_state_machine.name\n    policy_arn = aws_iam_policy.publish-sns.arn\n}\n```\n\n## Recap\n\nIn this Appendix you learned how to:\n\n1. Create a AWS Step Functions state machine using ASL.\n2. Create a template file of the state machine.\n3. Create IAM policies to allow the state machine to interact with resources such as SNS and Lambda.\n\n## Next Steps \n\nLearn more about using AWS Step Functions with the following workshops\n* [The AWS Step Functions Workshop](https:\u002F\u002Fcatalog.us-east-1.prod.workshops.aws\u002Fworkshops\u002F9e0368c0-8c49-4bec-a210-8480b51a34ac\u002Fen-US)\n* [Large-scale Data Processing with Step Functions](https:\u002F\u002Fcatalog.us-east-1.prod.workshops.aws\u002Fworkshops\u002F2a22e604-2f2e-4d7b-85a8-33b38c999234\u002Fen-US)",[25,26,27,28],"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\u002F10-appendix-B-SFN","4 min",[34],{"title":35,"content":36},"Guide",[37,55,71,86,105,118,133,155,171,186,202],{"title":38,"order":39,"authors":40,"resources":41,"time":32,"path":52,"id":53,"link":54},"1. Introduction",1,[9,10],[42,46,49],{"link":43,"text":44,"type":45},"https:\u002F\u002Faws.amazon.com\u002Fserverless\u002Fsam\u002F","AWS Serverless Application Model (SAM)","link",{"link":47,"text":48,"type":45},"https:\u002F\u002Faws.amazon.com\u002Fcdk\u002F","AWS Cloud Development Kit (CDK)",{"link":50,"text":51,"type":45},"https:\u002F\u002Fwww.terraform.io\u002F","Hashicorp Terraform","01-introduction","01-introduction.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F01-introduction",{"title":56,"order":57,"authors":58,"resources":59,"time":67,"path":68,"id":69,"link":70},"2. Solution Overview",2,[9,10],[60,61,64],{"link":50,"text":51,"type":45},{"link":62,"text":63,"type":45},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Fuserguide\u002Fgetting-started-install.htm","AWS CLI",{"link":65,"text":66,"type":45},"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":72,"order":73,"authors":74,"resources":76,"time":32,"path":83,"id":84,"link":85},"3. S3 buckets",3,[9,10,75],"Matt Ridehalgh",[77,80],{"link":78,"text":79,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs","AWS Terraform Provider",{"link":81,"text":82,"type":16},"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":87,"order":88,"authors":89,"resources":90,"time":32,"path":102,"id":103,"link":104},"4. Lambda functions",4,[9,10],[91,92,95,98],{"link":78,"text":79,"type":16},{"link":93,"text":94,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Flambda_function","aws_lambda_function",{"link":96,"text":97,"type":16},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fserverless-application-model\u002Flatest\u002Fdeveloperguide\u002Fterraform-support.html","AWS SAM Terraform support",{"link":99,"text":100,"type":101},"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":106,"order":107,"authors":108,"resources":109,"time":32,"path":115,"id":116,"link":117},"5. API Gateway",5,[9,10],[110,111,114],{"link":78,"text":79,"type":16},{"link":112,"text":113,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fapi_gateway_rest_api","aws_api_gateway_rest_api",{"link":96,"text":97,"type":16},"05-api-gateway","05-api-gateway.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F05-api-gateway",{"title":119,"order":120,"authors":121,"resources":122,"time":32,"path":130,"id":131,"link":132},"6. Asynchronous processing",6,[9,10],[123,124,127],{"link":78,"text":79,"type":16},{"link":125,"text":126,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fsqs_queue","aws_sqs_queue",{"link":128,"text":129,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Flambda_event_source_mapping","aws_lambda_event_source_mapping","06-async-processing","06-async-processing.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F06-async-processing",{"title":134,"order":135,"authors":136,"resources":137,"time":151,"path":152,"id":153,"link":154},"7. Observability",7,[9,10],[138,139,142,145,148],{"link":78,"text":79,"type":16},{"link":140,"text":141,"type":16},"https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Flambda-monitoring.html","Lambda function observability, monitoring, and troubleshooting",{"linke":143,"text":144,"type":16},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fapigateway\u002Flatest\u002Fdeveloperguide\u002Frest-api-monitor.html","Monitoring API Gateway REST API",{"link":146,"text":147,"type":16},"https:\u002F\u002Fregistry.terraform.io\u002Fproviders\u002Fhashicorp\u002Faws\u002Flatest\u002Fdocs\u002Fresources\u002Fapi_gateway_account","aws_api_gateway_account",{"link":149,"text":150,"type":16},"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":156,"order":157,"authors":158,"resources":159,"time":167,"path":168,"id":169,"link":170},"8. Modularizing your IaC projects",8,[9,10],[160,161,164],{"link":78,"text":79,"type":16},{"link":162,"text":163,"type":16},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform\u002Flanguage\u002Fmodules","Terraform Modules",{"link":165,"text":166,"type":101},"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":172,"order":173,"authors":174,"resources":175,"time":182,"path":183,"id":184,"link":185},"9. Summary and next steps",9,[9,10],[176,177,179,181],{"link":78,"text":79,"type":16},{"link":178,"text":51,"type":16},"https:\u002F\u002Fdeveloper.hashicorp.com\u002Fterraform",{"link":43,"text":180,"type":16},"AWS SAM",{"link":165,"text":166,"type":101},"2 min","09-summary","09-summary.md","\u002Fcontent\u002Fguides\u002Fbuilding-serverless-applications-with-terraform\u002F09-summary",{"title":187,"order":188,"authors":189,"resources":190,"time":151,"path":199,"id":200,"link":201},"10. Appendix A - Amazon EventBridge",10,[9,10,11],[191,193,196],{"link":18,"text":192,"type":16},"aws_cloudwatch_event_bus Terraform resource",{"link":194,"text":195,"type":16},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fhealth\u002Flatest\u002Fug\u002Fcloudwatch-events-health.html","Monitoring AWS Health events with Amazon EventBridge",{"link":197,"text":198,"type":16},"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":6,"order":7,"authors":203,"resources":204,"time":32,"path":208,"id":209,"link":31},[9,10,11],[205,206,207],{"link":14,"text":15,"type":16},{"link":18,"text":19,"type":16},{"link":21,"text":22,"type":16},"10-appendix-B-SFN","10-appendix-B-SFN.md",null,1792578865776]