#terraform - July 2019

C
Cloud Posseover 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions on terraform and get to know others in the community on a more personal level. Next one is Jul 10, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
Callum Robertson
Callum Robertsonover 7 years ago
Looking forward to this upcoming Office Hours!
Vasco Pinho
Vasco Pinhoover 7 years ago
Does anyone know if default block reuse through "locals" still works in 0.12? I'm getting consistent errors in 0.12 that I didn't get in 0.11 like "An argument named "health_check" is not expected here. Did you mean to define a block of type "health_check"?"
Vasco Pinho
Vasco Pinhoover 7 years ago
Specifically I was using similar syntax to this but for health_checks instead of tags https://www.terraform.io/docs/configuration/locals.html
loren
lorenover 7 years ago
that sounds like the error where tf 0.12 differentiates strongly between attrs (assigned using =) and blocks (no assignment), i.e.

attr = { foo = "bar" }
block {
  foo = "bar"
}
loren
lorenover 7 years ago
tf 0.11 let you do either in many/most places, tf 0.12 forces you to use the syntax that matches the implementation
Vasco Pinho
Vasco Pinhoover 7 years ago
Vasco Pinho
Vasco Pinhoover 7 years ago
So this works
Vasco Pinho
Vasco Pinhoover 7 years ago
but if you use the same syntax for healthcheck's, since you want to keep it DRY, it fails with the error above
Vasco Pinho
Vasco Pinhoover 7 years ago
Did TF 0.12 do some special grant for "tags" blocks?
loren
lorenover 7 years ago
yes, tags are no longer blocks, they are attrs
loren
lorenover 7 years ago
to make blocks DRY, you probably want to investigate dynamic blocks, https://www.terraform.io/docs/configuration/expressions.html#dynamic-blocks
Vasco Pinho
Vasco Pinhoover 7 years ago
Mmm I'll take a look at those, thanks for the pointers @loren
Vasco Pinho
Vasco Pinhoover 7 years ago
The syntax is now expecting a for-loop as a base for it, instead of simple substitution using a "local" block. Even if I faked the for-loop it seems like I'd still need to repeat myself for all keys in the "content" section in all resources vs just referencing the local. Still trying to figure out if there's any good way of doing this or if I just have to go back to repeating it in all resource blocks
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
@Vasco Pinho you will also get the same (or similar) error message when using dynamic block with for loop on a list variable without updating the type of the variable to list(object) and specifying the types of items in the list. For example:
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
var.custom_error_response was type = "list" and a similar error was shown
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
Vasco Pinho
Vasco Pinhoover 7 years ago
Yeah the point here was to have a short concise file, which we did in 0.11 because the healthcheck block (which was the same for most resources) got interpolated. I just undid all of that for 0.12 and now it works. Oh well.
cabrinha
cabrinhaover 7 years ago
is there a module for an ASG with a mixed instances policy?
cabrinha
cabrinhaover 7 years ago
Anyone know of the best way to check for the existance of a variable and if not found, fall back on defaults?
cabrinha
cabrinhaover 7 years ago(edited)
"${var.ami-id == "" ? data.aws_ami.default.image_id : var.ami-id}"
[Gamifly] Vincent
[Gamifly] Vincentover 7 years ago
Hi guys, what is the best way to have an S3 bucket in website mode backed by a CDN ?
It seems like <https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn> does not support website mode
and <https://github.com/cloudposse/terraform-aws-cloudfront-cdn> does not handle S3 origins 😄
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
we use it to deploy https://docs.cloudposse.com/
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Public Office Hours starting now! Join me here: https://zoom.us/meeting/register/dd2072a53834b30a7c24e00bf0acd2b8

Have any questions? This is your chance to ask us anything.
Anton
Antonover 7 years ago(edited)
What is better way to setup condition for run or not provisioner?
joshmyers
joshmyersover 7 years ago
better than?
vishnu.shukla
vishnu.shuklaover 7 years ago
Hi All, I am setting up a pipeline by using Terraform, getting below error tried changing the name fo S# bucket but still get the same error, please help me to get it resolved
vishnu.shukla
vishnu.shuklaover 7 years ago
Error creating S3 bucket: BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
status code: 409, request id: 415EB74A26A388CF, host id: /YawK/bKVKRTufDZHJi35WZuzkDlF0Fg0qY+rEN2rVZgH0oFwQPRC4YwXOvUFOYb2lCpHADtlQ4=

on code_pipeline.tf line 1, in resource "aws_s3_bucket" "codepipeline":
1: resource "aws_s3_bucket" "codepipeline" {
Nikola Velkovski
Nikola Velkovskiover 7 years ago
Hi @vishnu.shukla that means that someone out there has already taken the name of the bucket and you need to change it.
Nikola Velkovski
Nikola Velkovskiover 7 years ago

Error creating S3 bucket: BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
vishnu.shukla
vishnu.shuklaover 7 years ago
I tried changing the name many times but no luck
vishnu.shukla
vishnu.shuklaover 7 years ago
Error: Error creating S3 bucket: BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
status code: 409, request id: 331EC24BF2D990D5, host id: 43fnC5EwsbQ2TC9QF5OWNLomL6qHRe2YB6WEi0bVXUhyLG8ZflD7yROP+wPAjzY9G1PafUWh0fY=

on code_pipeline.tf line 1, in resource "aws_s3_bucket" "codepipelinesrttwegdye5w26wfdbg452":
1: resource "aws_s3_bucket" "codepipelinesrttwegdye5w26wfdbg452" {
vishnu.shukla
vishnu.shuklaover 7 years ago
see this even weird name
Nikola Velkovski
Nikola Velkovskiover 7 years ago
hmm try that with aws cli and see if it will work
Nikola Velkovski
Nikola Velkovskiover 7 years ago
that is really weird
vishnu.shukla
vishnu.shuklaover 7 years ago
anyone has aws code deploy teraaform script?
marc
marcover 7 years ago
@Nikola Velkovski sounds like you're changing the resource name, and not the actual bucket name.
marc
marcover 7 years ago
Look one line below, and there should be a bucket = "something"
Nikola Velkovski
Nikola Velkovskiover 7 years ago
ah yeah I somehow failed to see that
Nikola Velkovski
Nikola Velkovskiover 7 years ago
thanks @marc! 🙂
Nikola Velkovski
Nikola Velkovskiover 7 years ago
Too many context switches
marc
marcover 7 years ago
no problem!
cabrinha
cabrinhaover 7 years ago
cabrinha
cabrinhaover 7 years ago
am i supposed to create my own key first?
cabrinha
cabrinhaover 7 years ago
I'd like the module to generate the key and push it to AWS
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
@cabrinha if you set this var to true, a new key will be generated and pushed to AWS https://github.com/cloudposse/terraform-aws-key-pair/blob/master/variables.tf#L41
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
otherwise, an existing key gets imported
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
cabrinha
cabrinhaover 7 years ago
k thanks
chrism
chrismover 7 years ago
Anyone had issues with TF12/Geodesic and provider aliasing in the aws provider?

genericish example
https://gist.github.com/ChrisMcKee/675d4b954fffc08046a7712efe9497db

in geodesic I get

Error: fork/exec /conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4: no such file or directory

running out of geodesic it works
joshmyers
joshmyersover 7 years ago
Does that file exist?
chrism
chrismover 7 years ago
yeah, tried it one that i've been using a while (setup guard duty in all the regions)

2019/07/05 16:53:27 [DEBUG] [aws-sdk-go] {}
2019/07/05 16:53:27 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-07-05T16:53:27.934Z [DEBUG] plugin.terraform-provider-aws_v2.18.0_x4: 2019/07/05 16:53:27 [ERR] plugin: plugin server: accept unix /tmp/plugin915308162: use of closed network connection
2019-07-05T16:53:27.945Z [DEBUG] plugin: plugin process exited: path=/conf/guardduty/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.18.0_x4

same error in debug
chrism
chrismover 7 years ago

2019/07/05 17:08:44 [TRACE] BuiltinEvalContext: Initialized "aws" provider for provider.aws.replicaregion
2019/07/05 17:08:44 [TRACE] <root>: eval: terraform.EvalNoop
2019/07/05 17:08:44 [TRACE] <root>: eval: *terraform.EvalOpFilter
2019/07/05 17:08:44 [TRACE] <root>: eval: *terraform.EvalSequence
2019/07/05 17:08:44 [TRACE] <root>: eval: *terraform.EvalGetProvider
2019/07/05 17:08:44 [TRACE] <root>: eval: *terraform.EvalValidateProvider
2019/07/05 17:08:44 [TRACE] buildProviderConfig for provider.aws.replicaregion: using explicit config only
2019/07/05 17:08:44 [TRACE] GRPCProvider: GetSchema
2019-07-05T17:08:44.916Z [INFO]  plugin: configuring client automatic mTLS
2019-07-05T17:08:44.954Z [DEBUG] plugin: starting plugin: path=/conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4 args=[/conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4]
2019/07/05 17:08:44 [ERROR] <root>: eval: *terraform.EvalInitProvider, err: fork/exec /conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4: no such file or directory
2019/07/05 17:08:44 [ERROR] <root>: eval: *terraform.EvalSequence, err: fork/exec /conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4: no such file or directory
2019-07-05T17:08:45.081Z [DEBUG] plugin: plugin process exited: path=/conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4 pid=1730
2019-07-05T17:08:45.081Z [DEBUG] plugin: plugin exited
2019/07/05 17:08:45 [TRACE] [walkValidate] Exiting eval tree: provider.aws.replicaregion (close)

Error: fork/exec /conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4: no such file or directory
chrism
chrismover 7 years ago
I tried shifting the aws provider back from 18 to 17^ as 18 came out today and I hate coincidences 😄
loren
lorenover 7 years ago
race condition with multiple providers? init stepping on itself? try pre-staging the binary in the same directory as your terraform binary...?
loren
lorenover 7 years ago(edited)
we've also seen such errors due to the bash PATH cache (though in that case the file in the msg really does not exist)... https://medium.com/faun/no-such-file-or-directory-seriously-ee14e51a1cf2
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago

terraform-provider-aws_v2.17.0_x4: no such file or directory
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I've had these sorts of things happen on alpine
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
fixed by doing apk add libc6-compat
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
check if the binary exists. if it does, then run ldd /conf/temp/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.17.0_x4
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that will show the dynamic linking
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
then ensure everything it dynamically links to exists.
PePe Amengual
PePe Amengualover 7 years ago
Question: can I have a data resource that might not exist on the first run but will exist in subsequent runs ?
PePe Amengual
PePe Amengualover 7 years ago
I remember having issues with data lookups that did not exist
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
no, data source must exist, this is a big limitation
PePe Amengual
PePe Amengualover 7 years ago
bummer
Maarten van der Hoef
Maarten van der Hoefover 7 years ago
@PePe Amengual you can use a self made lambda datasource as workaround
PePe Amengual
PePe Amengualover 7 years ago
how ?
Maarten van der Hoef
Maarten van der Hoefover 7 years ago
so in your terraform run you apply the lambda and subsequently use aws_lambda_invocation for a lookup of a value.
PePe Amengual
PePe Amengualover 7 years ago
so you are using the lambda as some sort of key:value store
Maarten van der Hoef
Maarten van der Hoefover 7 years ago
no the lambda is used as a datasource. It's doing the same kind of lookup a regular datasource would normally do but it won't fail the moment the actual resource is not existing yet.
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
@Andriy Knysh (Cloud Posse) added local variables completion 😃
cabrinha
cabrinhaover 7 years ago
what vim plugin is this?
cabrinha
cabrinhaover 7 years ago
I mainly use spacemacs and vscode, hope they add completion for 0.12 soon enough
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
Is terraform-lsp so it work in all editors
chrism
chrismover 7 years ago
^ that looks awesome
Mike Nock
Mike Nockover 7 years ago
Is anyone familiar with queueing apply's on all workspaces in TFE through an API call? Trying to figure out how to dynamically integrate the CI/CD pipeline that's generating ECR images and lambda packages, into ECS task definitions and lambda functions. The trouble I've run into though is you can only queue up an apply call on an individual workspace, which means you need a list of them, which defeats dynamic-ism and the self-service nature of terraform
C
Cloud Posseover 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions on terraform and get to know others in the community on a more personal level. Next one is Jul 17, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
drexler
drexlerover 7 years ago
hi. anyone here know how to get an old version of the terraform docs? over a year ago, we built our infrastructure using terraform v11 and the docs for IAM resources look completely different today.
Joe Presley
Joe Presleyover 7 years ago
According to this https://github.com/hashicorp/terraform/issues/15058#issuecomment-306099829 the only way is to view the versioned history of the website in git.
Maarten van der Hoef
Maarten van der Hoefover 7 years ago
@drexler difference is not so big from what I experienced, what issues are you facing ?
loren
lorenover 7 years ago
Trent Scholl
Trent Schollover 7 years ago
Does anyone know if there's a syntax to convert a tuple to a list(string)? (Using 0.12)
Trent Scholl
Trent Schollover 7 years ago
The docs say "if a module argument requires a value of type list(string) and a user provides the tuple ["a", 15, true], Terraform will internally transform the value to ["a", "15", "true"] by converting the elements to the required string element type." However, I'm getting this error:

The given value is not suitable for child module variable
"ingress_cidr_blocks" defined at
.terraform/modules/postgres_security_group/terraform-aws-modules-terraform-aws-security-group-a332a3b/modules/postgresql/variables.tf:71,1-31:
element 0: string required.
loren
lorenover 7 years ago
TIL count can reference data sources in tf 0.12!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
without any "count of" errors?
Ennio
Ennioover 7 years ago
Hi guys, I need a bit of help. I m setting up a bunch of aws codepipeline using terraform. I wanted today to add a step that integrates a Jenkins job ( Adding it from the console works great ) and I hit this issue: https://github.com/terraform-providers/terraform-provider-aws/issues/6931 Does anyone of you have a workaround for it?
Dimitris Moraitidis
Dimitris Moraitidisover 7 years ago
Hey there,

Has anybody had issues with terraboard after upgrading its db (psql 10.6 -- 11.4) ?
Doesn't show anything on the dashboard for me after the upgrade : / And in the logs, just an "automigrate" message.
PePe Amengual
PePe Amengualover 7 years ago
Question : Is it possible to have a filter on a data resource to find something with a tag like : ```name = “private: 1” like using regex or something ?
PePe Amengual
PePe Amengualover 7 years ago
the subsequent subnets are private:2, 3 4 etc
ciastek
ciastekover 7 years ago
TIL terraform state mv doesn't support nested modules. They need to be moved one by one. 😕
Igor
Igorover 7 years ago(edited)
I have a situation with Cognito where my user_pool_client is recreated, but an authenticate rule on the ALB is not being updated with the new client id for some reason. Any ideas why? (v 0.11 of terraform)
johncblandii
johncblandiiover 7 years ago
@Andriy Knysh (Cloud Posse) @Erik Osterman (Cloud Posse) PR for https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/pull/28
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
good news 😃
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
the azuredevops terraform provider will be released on next wednesday
C
Cloud Posseover 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions on terraform and get to know others in the community on a more personal level. Next one is Jul 24, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
joshmyers
joshmyersover 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yes!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
there are 2 ways
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
option B: use git credential helpers to rewrite ssh:// and <mailto:git@github.com|git@github.com> repos to https:// and use GITHUB_TOKEN
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
joshmyers
joshmyersover 7 years ago
hmm, thought so but I’m getting asked for username/password when terraform init using .envrc even though I have SSH agent loaded
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that's if you use ssh-agent mode
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
but if you use the git credential helper, then you can simply use an ENV
joshmyers
joshmyersover 7 years ago
ya
S
SweetOpsover 7 years ago
Are you using some of our terraform-modules in your projects? Maybe you could leave us a testimonial! It means a lot to us to hear from people like you.
joshmyers
joshmyersover 7 years ago
doesn’t output minimum_password_length
joshmyers
joshmyersover 7 years ago
Will open a PR shortly
joshmyers
joshmyersover 7 years ago
@chrism IIRC you were using geodesic on Windows? Any gotchas?
joshmyers
joshmyersover 7 years ago
Someone in my team is a Windows bod, there’s always one 🤦
chrism
chrismover 7 years ago(edited)
lol everyones either windows or mac here; WSL can be a colossal D at times.
I've had issues with the terraform plugin cache folder in recent weeks; but thats relocatable ENV TF_PLUGIN_CACHE_DIR=/tmp
I have to set ENV ASSUME_ROLE_INTERACTIVE=false as assume-role fails to work in the new format.

aws-vault works fine though and the rest seems ok. Obviously if you want to utilise the /localhost thing it isn't mapping to c:\users\user its mapping to c:\users\user\appdata\.... etc... wsl path (it kindly pumps that out when it boots so you can tell where its mapped)
chrism
chrismover 7 years ago
It's minimal stuff tbh; I'm finding that most stuff wont get used unless its automated though... people are lazy af
joshmyers
joshmyersover 7 years ago
Cool, cheers for that
niek
niekover 7 years ago
Does anyone has an idea how I can make this snippet Terraform 0.11 code (which is part of a module) compatible with Terraform 0.12 so the module can already be used in a Terraform 0.12 context


data "aws_ami" "instance" {
  most_recent = true

  filter = "${var.runner_ami_filter}"

  owners = "${var.runner_ami_owners}"
}


variable "ami_filter" {
  type        = "list"

  default = [{
    name   = "name"
    values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
  }]
}


The problem is the way I pass the block as list of a map is not supported by TF 0.12
loren
lorenover 7 years ago(edited)
IF it is still a block:

variable "ami_filter" {
  type        = "list"

  default {
    name   = "name"
    values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
  }
}


OR if they changed default to be a map:


variable "ami_filter" {
  type        = "list"

  default = {
    name   = "name"
    values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
  }
}
loren
lorenover 7 years ago
oh silly me, i see what you're doing, that's a variable def 🤦‍♂️
niek
niekover 7 years ago
Yepz, and a hack 🙂
niek
niekover 7 years ago
I would give the user the option to define the filter in a flexible way
loren
lorenover 7 years ago

variable "ami_filter" {
  type        = list(map())

  default = [{
    name   = "name"
    values = ["amzn-ami-hvm-2018.03*-x86_64-ebs"]
  }]
}
loren
lorenover 7 years ago
change the type
niek
niekover 7 years ago
that is not solving my issue the part above is the module code, I would like to keep the module for the moment .011
niek
niekover 7 years ago
but be able use as consumer of the module 0.12
loren
lorenover 7 years ago
you can't keep this stuff backwards compatible
niek
niekover 7 years ago
but the code snippet you provided is tf 0.12
loren
lorenover 7 years ago
the block/attr thing is a major blocker for us 😕
loren
lorenover 7 years ago
slowing down our whole 0.12 adoption
niek
niekover 7 years ago
Yepz, my plan was to make the module first .12 compatible
niek
niekover 7 years ago
but seems impossible
loren
lorenover 7 years ago
basically have to uplift everything to 0.12 somehow
loren
lorenover 7 years ago(edited)
either maintain multiple branches/versions, or just make a hard stop on 0.11 support
niek
niekover 7 years ago
yepz,
niek
niekover 7 years ago
Thanks, for the feedback. I had last week a chat with a few guys from Hashicorp they mentioned that it should be possible to use a tf 0.11 module in a tf 0.12 context. So I was just giving it a try
johncblandii
johncblandiiover 7 years ago(edited)
PR for allowing ssl policy changes: https://github.com/cloudposse/terraform-aws-alb/pull/23

(backwards compatible) @Andriy Knysh (Cloud Posse) @Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
@johncblandii - thanks for the enhancement. @Andriy Knysh (Cloud Posse) is on vacation so it may take a day or two before we get to it.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
looks harmless
johncblandii
johncblandiiover 7 years ago
tried to make sure it was backwards compat
johncblandii
johncblandiiover 7 years ago
thx for the quick merge
rohit
rohitover 7 years ago
I am using terraform-aws-modules/rds/aws module, when i tried to restore database from snapshot it timed out
rohit
rohitover 7 years ago
now when i try to terraform plan and terraform apply, i get the following error
 aws_db_instance.this: Error modifying DB Instance aartdb-eakf: InvalidDBInstanceState: Database instance is not in available state
rohit
rohitover 7 years ago
Is anyone aware of this issue ?
johncblandii
johncblandiiover 7 years ago
@Erik Osterman (Cloud Posse) quick patch to the deployment controller work: https://github.com/cloudposse/terraform-aws-ecs-alb-service-task/pull/29.

It doesn’t work unless you have ignore changes on since the resources is duplicated. I completely missed that.
giphy
giphyover 7 years ago
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
🙇
PePe Amengual
PePe Amengualover 7 years ago
is it possible to add a service task on that module that is arbitrary ? like for a blue green ?
johncblandii
johncblandiiover 7 years ago
I’m doing blue/green right now
johncblandii
johncblandiiover 7 years ago
i can show you my approach after this
PePe Amengual
PePe Amengualover 7 years ago
if blue_green = “enabled” and blue_green_port = “something” do x
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I also know that @LeoGmad is doing it
johncblandii
johncblandiiover 7 years ago
yeah
johncblandii
johncblandiiover 7 years ago
we wrap this module so we just attached our stuff in our own module
PePe Amengual
PePe Amengualover 7 years ago
I forked the module because of that
PePe Amengual
PePe Amengualover 7 years ago
mmm I see
PePe Amengual
PePe Amengualover 7 years ago
show me when you can , I’m very interested
johncblandii
johncblandiiover 7 years ago
gimme a sec. i’ll add bits here
PePe Amengual
PePe Amengualover 7 years ago
my problem is that I can’t use the standard port
PePe Amengual
PePe Amengualover 7 years ago
same problem with the alb module
johncblandii
johncblandiiover 7 years ago
yeah. i just added a new lb listener with port 8443 (vs 443)
PePe Amengual
PePe Amengualover 7 years ago
since only creates http and https target groups
johncblandii
johncblandiiover 7 years ago
yeah, i just added new ones
PePe Amengual
PePe Amengualover 7 years ago
what I was thinking to do is to create a Target group module
PePe Amengual
PePe Amengualover 7 years ago
that is added to the alb module and where you can define arbitrary target group or defaults in no custom ones are defined
johncblandii
johncblandiiover 7 years ago
(leaving parts out for brevity)


module "alb_service_task" {
  source = "git::<https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.13.0>"
}

module "alb_ingress" {
  source = "git::<https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=tags/0.7.0>"
}

module "alb_ingress_green" {
  source = "git::<https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=tags/0.7.0>"
}

resource "aws_lb_listener" "green" {
  load_balancer_arn = "${var.alb_arn}"

  port            = "${var.alb_ingress_port_green}"
  protocol        = "${coalesce(var.alb_ingress_protocol_green, var.alb_ingress_protocol)}"
  ssl_policy      = "${var.ssl_policy}"
  certificate_arn = "${var.certificate_arn}"

  default_action {
    target_group_arn = "${module.alb_ingress_green.target_group_arn}"
    type             = "forward"
  }
}
PePe Amengual
PePe Amengualover 7 years ago
and the same thing with the task
PePe Amengual
PePe Amengualover 7 years ago
default_action {
    target_group_arn = "${module.alb_ingress_green.target_group_arn}"
    type             = "forward"
  }
is that TF 0.11 compatible ?
johncblandii
johncblandiiover 7 years ago
yup
johncblandii
johncblandiiover 7 years ago
this is all 0.11; we’re migrating to .12 now, but none of that is active
johncblandii
johncblandiiover 7 years ago
do you have your code deploy bits worked out?
johncblandii
johncblandiiover 7 years ago
0.13.1 works, @Erik Osterman (Cloud Posse):


      deployment_controller.0.type:                                                                                     "ECS" => "CODE_DEPLOY" (forces new resource)
PePe Amengual
PePe Amengualover 7 years ago
yes code deploy is all good
PePe Amengual
PePe Amengualover 7 years ago
I used it for Fargate but is almost the same
PePe Amengual
PePe Amengualover 7 years ago
what do you need ?
johncblandii
johncblandiiover 7 years ago
same
PePe Amengual
PePe Amengualover 7 years ago
I can send you a gist if you want
johncblandii
johncblandiiover 7 years ago
nah, i have it worked out. was going to share if you were still piecing it together
johncblandii
johncblandiiover 7 years ago
just finalizing the TF at this point
PePe Amengual
PePe Amengualover 7 years ago
how are you going to do the route traffic thing in Code deploy
johncblandii
johncblandiiover 7 years ago
manual
PePe Amengual
PePe Amengualover 7 years ago
did you do a script to do the API call ?
PePe Amengual
PePe Amengualover 7 years ago
ohh I see
johncblandii
johncblandiiover 7 years ago
but it is configurable w/ timeouts
PePe Amengual
PePe Amengualover 7 years ago
we have not decided on that
johncblandii
johncblandiiover 7 years ago
we technically haven’t either so using manual for now.
johncblandii
johncblandiiover 7 years ago
it demo’s better. 🙂
PePe Amengual
PePe Amengualover 7 years ago
I will like it automatic
PePe Amengual
PePe Amengualover 7 years ago
run some test and then do it
johncblandii
johncblandiiover 7 years ago
nice
johncblandii
johncblandiiover 7 years ago
how’d you do your aws_codedeploy_deployment_group, @PePe Amengual? specifically the lb section:


  load_balancer_info {
    target_group_pair_info {
      prod_traffic_route {
        listener_arns = ["${module.alb.https_listener_arn}"]
      }

      target_group {
        name = "${module.main_container.alb_target_group_name}"
      }

      test_traffic_route {
        listener_arns = ["${module.main_container.alb_green_listener_arn}"]
      }
    }
  }
PePe Amengual
PePe Amengualover 7 years ago(edited)
on sec
johncblandii
johncblandiiover 7 years ago

* aws_codedeploy_deployment_group.this: InvalidTargetGroupPairException: Target group pair must have exactly two target groups
PePe Amengual
PePe Amengualover 7 years ago
resource "aws_codedeploy_deployment_group" "ecs_deployment_group" {
  app_name               = "${aws_codedeploy_app.bluegreen_ecs.name}"
  deployment_config_name = "CodeDeployDefault.ECSAllAtOnce"
  deployment_group_name  = "${module.codedeploy_label.id}-DeploymentGroup"
  service_role_arn       = "${aws_iam_role.code_deploy_ecs_role.arn}"

  auto_rollback_configuration {
    enabled = true
    events  = ["DEPLOYMENT_FAILURE"]
  }

  blue_green_deployment_config {
    deployment_ready_option {
      action_on_timeout = "STOP_DEPLOYMENT"
      wait_time_in_minutes = "${var.wait_time}"
    }

    terminate_blue_instances_on_deployment_success {
      action                           = "TERMINATE"
      termination_wait_time_in_minutes = "${var.wait_time}"
    }
  }

  deployment_style {
    deployment_option = "WITH_TRAFFIC_CONTROL"
    deployment_type   = "BLUE_GREEN"
  }

  ecs_service {
    cluster_name = "${var.cluster_name}"
    service_name = "${var.service_name}"
  }

  load_balancer_info {
    target_group_pair_info {
      prod_traffic_route {
        listener_arns = ["${var.alb_listener_arn}"]
      }

      target_group {
        name = "${var.alb_target_group_default_name}"
      }

      target_group {
        name = "${var.alb_target_group_green_name}"
      }

      test_traffic_route {
        listener_arns = ["${var.alb_green_listener_arn}"]
      }
    }
  }
}
johncblandii
johncblandiiover 7 years ago
what i thought. cool. i’ll add the second target_group
dalekurt
dalekurtover 7 years ago
I’m planning to use terraform-aws-route53-cluster-zoneto create Route53 hosted zones, and I have a question regarding the creation of the parent zone. Can I use this module to create a parent zone resource in Route53?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
I don't think this module handles that use-case.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Actually, we don't have a module for the TLD; I guess since we mostly register the zone via Route53 which creates them for us.
dalekurt
dalekurtover 7 years ago
Ah, thanks.
dalekurt
dalekurtover 7 years ago
I will write the modules for that then.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
=( the azuredevops terraform provider postpone to next week to finalize the license on the repo
Brandon Wilson
Brandon Wilsonover 7 years ago
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
the user you are running under does not have permissions to folder /secrets
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
try to change the folder to ./secrets
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
or change the user
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
or give it the required permissions
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
/secrets is not under project, it’s in root folder
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
./secrets is local folder
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago(edited)
yes, you can write it to S3 or SSM param store or Secret Manager, for example, using terraform
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
We have a module for SSM
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Bertie
Bertieover 7 years ago
how do people normally deal with security groups here? the ec2 modules only wants a list of them... do you create flat definitions for each purpose, do you make modules for it?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
we usually create a security group per module with all the required configurations (especially for backing services like RDS, Elasticsearch, Redis, etc.)
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
then we specify a list of other security groups and CIDR blocks as ingresses to allow to access the service
PePe Amengual
PePe Amengualover 7 years ago
I was looking at this : https://github.com/cloudposse/terraform-aws-ssm-parameter-store/blob/master/example/main.tf and is mention in the doc that this works great with Chamber but if a parameter is on terraform and then I use chamber to create a new one then the state file will be out of sync so what will be the recommended way to do it ? just use chamber from the beginning and not declare anything in terraform ?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
we use that in a few ways. For example, when creating an RDS cluster, we can generate a database username and password and write them to SSM using the module
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
then from a CI/CD pipeline, when we build and start the app, we use chamber to read the username and password from SSM and provide it as ENVs to the app
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
we can manually write some secrets to SSM using chamber, but it’s not related to TF state
PePe Amengual
PePe Amengualover 7 years ago
I c ok
PePe Amengual
PePe Amengualover 7 years ago
I have some configs for apps that are going to be running now on ECS so we were thinking to use chamber in a script to write the config keys to parameter store
PePe Amengual
PePe Amengualover 7 years ago
but I was confused about some examples were segments of config parameter were created using terraform
PePe Amengual
PePe Amengualover 7 years ago
I don’t want dev to have to run terraform for config changes
PePe Amengual
PePe Amengualover 7 years ago
and just to make this more confusing , please correct me if I’m wrong : SSM parameter Store uses KMS to encrypt the Secrets and store them in AWS secrets ?
PePe Amengual
PePe Amengualover 7 years ago
or a parameter store secure string = aws secret encrypted string ?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
yes, you can specify SecureString and kms_key_id to encrypt
PePe Amengual
PePe Amengualover 7 years ago
it is soooo confusing
PePe Amengual
PePe Amengualover 7 years ago
I seeee ok…
PePe Amengual
PePe Amengualover 7 years ago
and have you guys played around with credential rotation for RDS ?
PePe Amengual
PePe Amengualover 7 years ago
I was wondering how that will play out with terraform
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
example on how to use type=SecureString and KMS Key ID https://github.com/cloudposse/terraform-aws-ecs-atlantis/blob/master/main.tf#L245
PePe Amengual
PePe Amengualover 7 years ago
I seee ok, make sense
PePe Amengual
PePe Amengualover 7 years ago
How do you guys deploy ECS tasks/images ? using terraform and push new task def ?
PePe Amengual
PePe Amengualover 7 years ago(edited)
PePe Amengual
PePe Amengualover 7 years ago
but I’m worry about the TF state getting out of sync
PePe Amengual
PePe Amengualover 7 years ago
and then an apply breaking things
Vikas Aggarwal
Vikas Aggarwalover 7 years ago(edited)
I was looking for elastic-beanstalk module for terraform version >~ 0.12
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
planning to develop a GCP DeploymentManager to Terraform tool
Julio Tain Sueiras
Julio Tain Sueirasover 7 years ago
and after that a Cloudformation to Terraform tool
C
Cloud Posseover 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions on terraform and get to know others in the community on a more personal level. Next one is Jul 31, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
Maarten van der Hoef
Maarten van der Hoefover 7 years ago
Hi everyone, I'm looking for a good example to set defaults for complex variable types.


variable dynamic_ordered_cache_behavior {
  description = "Ordered Cache Behaviors to be used in dynamic block"
  type = list(object({
    path_pattern            = string
    allowed_methods         = list(string)
    cached_methods          = list(string)
    target_origin_id        = string
    compress                = bool
    query_string            = bool
    cookies_forward         = string
    headers                 = list(string)
    query_string_cache_keys = list(string)
    whitelisted_names       = list(string)
    viewer_protocol_policy  = string
    min_ttl                 = number
    default_ttl             = number
    max_ttl                 = number
    lambda_function_associations = list(object({
      event_type   = string
      include_body = bool
      lambda_arn   = string
    }))
  }))
  default = []
}


For example I'd like to set headers to [] by default, has anyone done this before?
chrism
chrismover 7 years ago

variable "apply_config_map_aws_auth" {
  type        = "string"
  default     = "false"
  description = "Whether to generate local files from `kubeconfig` and `config_map_aws_auth` and perform `kubectl apply` to apply the ConfigMap to allow the worker nodes to join the EKS cluster"
}

When wouldn't you want to do this (as in whats the use case for it being a setting)?
yegorski
yegorskiover 7 years ago
👋
Bertie
Bertieover 7 years ago
hi, can i extract data into a locals?
Bertie
Bertieover 7 years ago(edited)
actually having issues with this:
* module.security_group.aws_security_group_rule.egress_with_cidr_blocks: lookup: lookup() may only be used with flat maps, this map contains elements of type list in:

${split(",", lookup(var.egress_with_cidr_blocks[count.index], "cidr_blocks", join(",", var.egress_cidr_blocks)))}
Bertie
Bertieover 7 years ago
fixed it 🙂
Adrian
Adrianover 7 years ago
variable "groups" {
  description = "Map of groups with members"
  type       ┆= "map"
  default     = {
    "00_disabled"   = ["user1", "user2"]
    "01_group1"     = ["user2", "user3", "user4", "user5"]
    "02_group2"     = ["user3", "user4"]
    "03_group3      = ["user3", "user6"]
    "04_group4"     = ["user5", "user6", "user7"]
    "05_group5"     = ["user5", "user2"]
  }
}

resource "aws_iam_group" "groups" {
  count = "${length((keys(var.groups))}"
  name  = "${element(keys(var.groups), count.index)}"
}

resource "aws_iam_user" "users" {
  count = "${length(distinct(flatten(values(var.groups))))}"
  name  = "${element(distinct(flatten(values(var.groups))), count.index)}"

  depends_on = [aws_iam_group.groups]
}

any workaround for IDX change when adding or removing users? How you manage users with terraform? Seperated module per user and group?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
use list, [aws_security_group.gitlab_alb.id]
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
same for subnets subnets = [var.public_subnet_id]
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
if the input vars are lists, then you don’t need to wrap them in []
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
aws_security_group.gitlab_alb.id is not a list, it’s a string, so you need []
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
if var.public_subnet_id is a list (which by its name looks like just a string), then you don’t need []
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
Public #office-hours with cloud posse starting now! https://zoom.us/s/508587304 join if you have any questions or want to listen in.
rohit
rohitover 7 years ago
Does anyone know how to avoid triggering replacement of launch template when making a change on tags ?
Sergey
Sergeyover 7 years ago
What a tag do you change?
Name?
rohit
rohitover 7 years ago
@Sergey no, not name tag
rohit
rohitover 7 years ago
custom tags used for various purposes
rohit
rohitover 7 years ago
i removed some redundant tags from default map and it now forces a new launch template creation
loren
lorenover 7 years ago
don't the tags pass thru to the instances, not really the template? and you can't modify a template just replace it, right? so i don't think the ask is possible
rohit
rohitover 7 years ago
but it is also possible that it can create a new version of the launch template
Sergey
Sergeyover 7 years ago
have you tried to set the option

  lifecycle {
    ignore_changes = ["tag_specifications"]
rohit
rohitover 7 years ago
i did not try that
nutellinoit
nutellinoitover 7 years ago
Does anyone know a good repository/tutorial to create a php lambda layer with terraform?
PePe Amengual
PePe Amengualover 7 years ago(edited)
hello I’m using : https://github.com/cloudposse/terraform-aws-ecs-alb-service-task and I was trying to do this :
volumes = [
    {
      name      = "pepe"
      host_path = "/mnt/pepe.ramdisk"
    },
    {
      name      = "pepe-incrementals"
      docker_volume_configuration {
        scope         = "task"
        driver = "local"
      }
    }
  ]
}
but I get
 module.ecs_alb_service_task.aws_ecs_task_definition.default: volume.1.docker_volume_configuration: should be a list
PePe Amengual
PePe Amengualover 7 years ago
I thought that was going to work….
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago(edited)
in TF 0.11 (with its loose/weak typing), mostly all blocks are lists, although it’s not clear from the docs
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago(edited)
try
docker_volume_configuration = [
{
        scope         = "task"
        driver = "local"
 }]
PePe Amengual
PePe Amengualover 7 years ago
ohhhhhh
PePe Amengual
PePe Amengualover 7 years ago
that worked
PePe Amengual
PePe Amengualover 7 years ago
thanks
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yes, you can definitely use the same bucket for multiple projects.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago

terraform {
  backend "s3" {
    bucket = "mybucket"
    key    = "path/to/my/project"
    region = "us-east-1"
  }
}
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
just make sure you vary the key
sarkis
sarkisover 7 years ago
Looks like that is just the s3 object path
sarkis
sarkisover 7 years ago
Been a while since I've used this 😭
PePe Amengual
PePe Amengualover 7 years ago(edited)
Hi, I.m using: https://github.com/cloudposse/terraform-aws-ec2-autoscale-group but I need my instances to have a 500GB root volume and I’m guessing that can’t be specify ? but in this modeule : https://github.com/cloudposse/terraform-aws-ec2-instance it can, can somehow use both ?
sarkis
sarkisover 7 years ago
@PePe Amengual you can attach extra drives with block device mapping, however I don't think the launch template gives you the option for root disk size: https://www.terraform.io/docs/providers/aws/r/launch_template.html

Unsure off top of my head if that is a TF limitation or AWS one. So your only option if you want autoscaling may be to modify the AMI.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
block_device_mappings var
PePe Amengual
PePe Amengualover 7 years ago
Specify volumes to attach to the instance besides the volumes specified by the AMI
PePe Amengual
PePe Amengualover 7 years ago
that that will anything but the root
PePe Amengual
PePe Amengualover 7 years ago
this is a ECS instance
PePe Amengual
PePe Amengualover 7 years ago
I will have to change the ECS agent config so docker images are store in a different volume
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)over 7 years ago
root is specified by the AMI
PePe Amengual
PePe Amengualover 7 years ago
I was hoping I will have the option like when you do it in the console when it gives you the option for a bigger root volume
sarkis
sarkisover 7 years ago
@PePe Amengual do you have that option when creating an EC2 instance or launch template?
PePe Amengual
PePe Amengualover 7 years ago(edited)
when creating an Instance
sarkis
sarkisover 7 years ago
Yea this is why it's available in aws-ec2-instance module and not in launch template/asg one. Only option if using latter is to modify your AMI to the 500gb volume
PePe Amengual
PePe Amengualover 7 years ago
I was using a ECS optimized instance
PePe Amengual
PePe Amengualover 7 years ago
I thought I could just define the size of the root volume
PePe Amengual
PePe Amengualover 7 years ago
I guess when you use the wizard and change the root volume size it creates a new AMI ID
PePe Amengual
PePe Amengualover 7 years ago
since the original AMI can’t be modified
C
Cloud Posseover 7 years ago
:zoom: Join us for "Office Hours" every Wednesday 11:30AM (PST, GMT-7) via Zoom.

This is an opportunity to ask us questions on terraform and get to know others in the community on a more personal level. Next one is Aug 07, 2019 11:30AM.

👉️ Register for Webinar

:slack: #office-hours (our channel)
Sharanya
Sharanyaover 7 years ago
Hey Folks, Trying to find some Terraform Modules related to AWS - app stream service ( for creating fleets and stacks) any help appreciated
Brandon Wilson
Brandon Wilsonover 7 years ago(edited)
Has anyone here referenced remote state output in 0.12 using Terraform Cloud remote state storage? I'm following their reference example at https://www.terraform.io/docs/backends/types/remote.html but it's bailing with Expected an equals sign ("=") to mark the beginning of the attribute value. on the workspaces {} block.
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
@Brandon Wilson how are you liking terraform cloud for state storage? easy?
Brandon Wilson
Brandon Wilsonover 7 years ago
well, the initial configuration was super easy. But referencing remote state data/output using the docs, appears to be broken.
mrwacky
mrwackyover 7 years ago
Is there a separate channel for tf 0.11 -> 0.12 upgrade woes?
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
haha, just teh #terraform-0_12
mrwacky
mrwackyover 7 years ago
We have many interlinked modules that use lots of shared state. We aren't even sure how to get there from here.
mrwacky
mrwackyover 7 years ago
s/shared state/remote state lookups/
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
i would move the shared state look ups to to values instead stored in SSM
mrwacky
mrwackyover 7 years ago
icky
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
that would better decouple them from current/future compatibility issues
mrwacky
mrwackyover 7 years ago

$ git grep  '{data.terraform_remote' |wc -l
    1102
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
yikes
mrwacky
mrwackyover 7 years ago
That's a spicy meatball!
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago(edited)
and that's not the result of code generation?
mrwacky
mrwackyover 7 years ago
This is a beautiful large organic code base
Erik Osterman (Cloud Posse)
Erik Osterman (Cloud Posse)over 7 years ago
you've been very busy 🐝
mrwacky
mrwackyover 7 years ago
Yeah.
mrwacky
mrwackyover 7 years ago
I feel like Hashicorp let us down by not having remote state compatibility
mrwacky
mrwackyover 7 years ago

To provide flexibility when upgrading decomposed environments that use terraform_remote_state, Terraform v0.11.14 introduced support for reading outputs from the Terraform v0.12 state format, so if you upgrade all of your configurations to Terraform v0.11.14 first you can then perform v0.12 upgrades of individual configurations in any order, without breaking terraform_remote_state usage.

Oh, hmm
mrwacky
mrwackyover 7 years ago
Maybe we had issues because we didn't yet have 0.11.14 remote state
mrwacky
mrwackyover 7 years ago
maybe a terraform refresh everywhere will save us