briancaffey / terraform-aws-django Goto Github PK
View Code? Open in Web Editor NEWTerraform modules for deploying Django applications on AWS using ECS Fargate
Home Page: https://registry.terraform.io/modules/briancaffey/django/aws/latest
Terraform modules for deploying Django applications on AWS using ECS Fargate
Home Page: https://registry.terraform.io/modules/briancaffey/django/aws/latest
In Terraform, when I have a list of 2 items (e.g. A, B) it doesn’t always preserve the order and sometimes thinks there is a change (e.g. B, A).
I’m trying to remember where exactly I saw it in this project, but I’ve been occasionally running into this for years and finally dug around for a potential solution.
In Terraform, when using lists, the order of the elements is not guaranteed to be preserved. To make Terraform aware of the order of the elements in the list and avoid changes, we can use the tuple data type instead of a list. A tuple is an ordered collection of elements that can be of different types, and Terraform will treat each element of the tuple as a separate resource. This way, Terraform will be aware of the order of the elements and will not consider changes when the order is changed.
Alternatively, we might be able use the jsonencode function in some cases to convert the list to a json string and use that as input. This will preserve the order of the elements in the list and Terraform will not consider changes when the order is changed.
locals {
ordered_list = jsonencode([ "A", "B"])
}
and use the ordered_list variable in your resource configuration.
Add a module that can be used to do autoscaling on a service. Here are some references:
When an RDS instance is created, it will automatically upgrade the minor version which causes state file issues. This happens because AWS automatically upgrades the RDS engine version to the latest version for security and performance reasons.
For example, this repo currently has engine_version set to “13.4”, and a new deployment will work as expected (at 13.4). However, AWS will eventually upgrade this to “13.7” (I think during a maintenance window, likely hours after you were last looking at the base deployment).
This can cause upleasant surprises when you go to update your base stack and it thinks you want to downgrade (which ultimately fails):
# module.main.module.rds.aws_db_instance.this will be updated in-place
~ resource "aws_db_instance" "this" {
~ engine_version = "13.7" -> "13.4"
id = "ocpython-rds"
name = "postgres"
tags = {}
# (49 unchanged attributes hidden)
}
To prevent this issue, we should be able to set the auto_minor_version_upgrade
parameter to false
when creating the RDS instance, which will prevent automatic minor version upgrades.
Implement the ideas from this article: https://nathanpeck.com/speeding-up-amazon-ecs-container-deployments/ in order to speed up the update of services
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.