Skip to content

Using Terraform to create AWS resources to run a Django application

Notifications You must be signed in to change notification settings

MartinCastroAlvarez/terraform-aws-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-django

Using Terraform to create AWS resources to run a Django application

wallpaper.avif

Terraform

Terraform is an open-source infrastructure-as-code (IaC) tool developed by HashiCorp. It allows you to define and manage your infrastructure as code, making it easier to provision and manage resources in cloud providers like AWS, Azure, and Google Cloud Platform.

References

Installation

brew tap hashicorp/tap
brew install hashicorp/tap/terraform
export AWS_ACCESS_KEY_ID="AKIA335HOYDC4CPV7XQL"
export AWS_SECRET_ACCESS_KEY="GAu44UYZXwbAM0Jf5kM8qVL0eMqMLleGv+q9didf"

Deployment

Run the following command to initialize your Terraform project:

terraform init

Run the following command to see a summary of the changes Terraform will make to your infrastructure:

terraform plan

Apply the changes and create the resources, run the following command:

terraform apply

When you applied your configuration, Terraform wrote data into a file called terraform.tfstate. Terraform stores the IDs and properties of the resources it manages in this file, so that it can update or destroy those resources going forward.

The Terraform state file is the only way Terraform can track which resources it manages, and often contains sensitive information, so you must store your state file securely and restrict access to only trusted team members who need to manage your infrastructure.

Inspect the current state using the following command:

 terraform show

Termination

If you want to tear down the resources created by Terraform, you can run the following command:

terraform destroy

Development

Automaticaly format your configuration:

terraform fmt

Validate your configuration:

terraform validate

About

Using Terraform to create AWS resources to run a Django application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages