skyscrapers / terraform-state Goto Github PK
View Code? Open in Web Editor NEWEverything for state related terraform
License: MIT License
Everything for state related terraform
License: MIT License
Terraform v0.12.2
Error: Unsupported block type
on .terraform/modules/s3-state/s3/main.tf line 17, in resource "aws_s3_bucket" "state":
17: tags {
Blocks of type "tags" are not expected here. Did you mean to define argument
"tags"? If so, use the equals sign to assign it a value.
I have a couple of questions about how you all intended this module to be used. I have an existing Terraform definition with an existing state for two workspaces: default
and development
.
terraform {
backend "s3" {
encrypt = true
bucket = "app-terraform-remote-state-storage-s3"
dynamodb_table = "app-terraform-remote-state-lock-dynamo"
region = "us-west-2"
key = "terraform.tfstate"
}
}
Is the expectation that I'd add this as a module, change the bucket
and dynamodb_table
values to match module.s3.bucket_id
and module.s3.locktable_id
and all would be fine? Or is there some other expected workflow? e.g.
diff --git a/main.tf b/main.tf
index 93526f6..57bf1b8 100644
--- a/terraform.tf
+++ b/terraform.tf
@@ -17,14 +17,21 @@ provider "template" {
version = "~> 1.0"
}
+module "s3" {
+ source = "github.com/skyscrapers/terraform-state//s3?ref=3.0.0"
+ project = "app"
+}
+
terraform {
required_version = "~> 0.11"
backend "s3" {
encrypt = true
- bucket = "app-terraform-remote-state-storage-s3"
- dynamodb_table = "app-terraform-remote-state-lock-dynamo"
+ bucket = "terraform-remote-state-app"
+ dynamodb_table = "terraform-remote-state-lock-app"
region = "us-west-2"
key = "terraform.tfstate"
}
}
The reason I ask is that it seems to be a bit of a chicken and egg scenario. I need these resources before I can provision my environment so I can store state and yet it is will be part of the environment too.
Also, what is the expected way to handle multiple workspaces? It seems like switching workspaces will cause the environment to try and reprovision the state storage resources.
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.