3-Tier Architecture With Terraform and AWS Part 3(Setting up Backend S3 and DynamoDb)

3-Tier Architecture With Terraform and AWS Part 3(Setting up Backend S3 and DynamoDb)

Quick Reminder, the objective of this guide is to design a secure infrastructure for a 3tier architecture and use terraform (infrastructure as code) to spin it all up on AWS. Check through the first part and second part of this tutorial to get a better background of what I am trying to achieve.

Quick Reminder, the objective of this guide is to design a secure infrastructure for a 3tier architecture and use terraform (infrastructure as code) to spin it all up on AWS. Check through the first _[**_part](https://medium.com/faun/3-tier-architecture-with-terraform-and-aws-part-1-d1193124e3e)and [second part **](https://medium.com/faun/3-tier-architecture-with-terraform-and-aws-part-2-project-structure-59d1c1b7875a)of this tutorial to get a better background of what I am trying to achieve.

Also, feel free to check out the source code via Github Repo at the end of every part of the tutorial

Objective/The Plan

The objective of this part 3 is to set up a terraform backend.

There is a good explanation of what it is here in the documentation https://www.terraform.io/docs/backends/index.html

What we want to be doing-especially in a team is to store our state file remotely, sensitive information is kept off disk. We will use S3 for state storage. You can use other services in fact Hashicorp has its own backend. Some people store state in git repos. However, I prefer to use S3.

We will use dynamodb for state lock. so dynamodb creates a lockID for each operation initiated on your terraform meaning when you make changes or do any work on your tf, it gets locked so no one else would be able to access it until you are done.

Solution

Navigate into the env-staging folder like the image below(this is assuming you are following my folder structure from part 2)

Image for post

terraform-provider devops terraform automation

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

DevOps Automation: How to Apply Automation Into Your Software Delivery Process

DevOps automation tools help increase your application development agility and speed up delivery for software changes.

How to Extend your DevOps Strategy For Success in the Cloud?

DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.

What Is DevOps and Is Enterprise DevOps Any Good?

What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!

Implementing DevOps for Enterprise | Roadmap to getting it done

DevOps for Enterprise means cultivating agile and CI/CD for your development teams. All of it in an enterprise environment. Implementing DevOps for Enterprise isn't what you believe.

DevOps Basics: What You Should Know

What is DevOps? What are the goals it helps achieves? What are its benefits? This article has answers!