#terraform-0_12

Discuss upgrading to terraform 0.12

Archive: https://archive.sweetops.com/terraform-0_12/

2019-10-18

loren

my gosh, i love love love for_each and for expressions

1

2019-10-17

Is there a good pattern for overriding input variables

For example, if I have a big map as a default variable on the module, and I want to provide an override to a part of that map, instead of giving the whole list in?

aknysh

you can make the var an object with specified item types. For those items that you don’t want to provide a specific type, you can use any. For default values that you don’t want to specify, you can use null

aknysh

in this case you could provide a part of object as input with only the necessary fields specified

2019-10-10

2019-10-09

Gocho

Hi @all

I’m wondering how to deal with terraform 0.12 update.

Say I have 3 terraform repositories, A, B and …tadam : C! Both B & C rely on A states (mututlizaton of some components) /——–B A ——/ -——— C

(Please note my graphical skills )

All repositories are in terraform 0.11. What would be the best way to achieve that (and avoid conflicts) ? Can I simply update B then A and C ? Or should I take care about a particular order ?

Is it possible to do it in multiple time ? like doing repo A first while still updating repos B and C (so a 0.11 repo references a 0.12 state), then deal with others repos few weeks/months later.

The main point is that I would avoid any compatibility issue

Any advice is welcome :)

IvanM

I’m not an expert, but I think the safest option is big bang - move everything at once. However I would be very happy if someone corrected me

@Gocho I think @Erik Osterman’s advice in #terraform was already correct, to first migrate to the latest minor of 0.11 then to 0.12

As long as you have backup of the state and you don’t make any actual changes as in adding or updating resources you should be safe.

I think terraform is a bit more flexible now and has build in backwards compatibility so the following is not applicable.. but when it really comes to remote state and order of applying new versions, I remember that with the upgrade of I think terraform 0.9 to first do A, and then B, C. This way the remote state A is updated, and when B and C are ran they understand the remote state of A. Good luck.

2019-10-08

Sharanya

Lookin for a terraform Module For - RDS- Instance Configuration : SQL Server Standard 2017, 2017 v14

2019-10-03

Sharanya

Create Jenkinsfile to deploy UI code to S3 bucket. Any help ?

you need to use something like withAws jenkins plugin and then the aws s3 sync command, there is many examples out there on how to do this

1

Is it possible in 0.12 to create resources in two regions without having to run TF twice passing the region as a var ?

like provider = [ aws.primary, aws.secondary]

aknysh

create two providers with two diff regions, then create two resources each using a diff provider

I have that already

I was hoping to do something more dynamic

like a for loop

but I think is cleaner to just run an create one region at a time

2019-10-02

Hi, does anybody know a Ruby hack/gem to load HCL2 files into a ruby objects?

Hi, I was trying to dynamically create some resources in 0.12 and I I do not know if this is possible :

resource "aws_vpc_endpoint_route_table_association" "main_us_east_2" {
  count           = length(local.private_subnet_ids_us_east_2)
  route_table_id  = HERE I need the route _table_id for the subnet_id[count.index]
  vpc_endpoint_id = aws_vpc_endpoint.s3_us_east_2.id
  provider        = aws.primary
}

is it possible to do something like that ? like an inline data resource lookup ?

aknysh
cloudposse/terraform-aws-dynamic-subnets

Terraform module for public and private subnets provisioning in existing VPC - cloudposse/terraform-aws-dynamic-subnets

Exactly what I need, thanks @aknysh

2019-10-01

AgustínGonzalezNicolini

That’s so awsome @aknysh Thanks!

aknysh

this is a very interesting article https://kubedex.com/90-days-of-aws-eks-in-production

90 days of AWS EKS in Production - kubedex.com

Come and read 90 days of AWS EKS in Production on http://Kubedex.com. The number one site to Discover, Compare and Share Kubernetes Applications.

aknysh

the additional settings it describes can be set here

aknysh
cloudposse/terraform-aws-eks-workers

Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers - cloudposse/terraform-aws-eks-workers

aknysh
cloudposse/terraform-aws-eks-workers

Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers - cloudposse/terraform-aws-eks-workers

aknysh
When you create an EKS cluster, the user that actually creates the cluster is the only one that can access the cluster by default.  Even IAM Administrator users can't login.  This seems to be due to the way AWS bootstraps the cluster behind the scenes in AWS-land.  Once the cluster is up, you can add users as per normal as you might in any Kubernetes setup.

My recommendation, in a production environment, to use an IAM role to create the cluster.
aknysh
cloudposse/terraform-aws-eks-cluster

Terraform module for provisioning an EKS cluster. Contribute to cloudposse/terraform-aws-eks-cluster development by creating an account on GitHub.

2019-09-30

ruan.arcega

hi guys i’m using cloudposse/terraform-aws-elasticsearch and i got this error

Error: Reference to undeclared resource

  on <http://main.tf> line 42, in module "elasticsearch":
  42:     rest.action.multi.allow_explicit_index = "true"

A managed resource "rest" "action" has not been declared in the root module.

[terragrunt] 2019/09/30 19<i class="em em-05"></i>13 Hit multiple errors:
exit status 1
ruan.arcega

my code

ruan.arcega

any advice ?

aknysh
cloudposse/terraform-aws-elasticsearch

Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash. - cloudposse/terraform-aws-elasticsearch

ruan.arcega

ohh, how i didnt see it it works now thnks @aknysh

aknysh
cloudposse/terraform-aws-ec2-autoscale-group

Terraform module to provision Auto Scaling Group and Launch Template on AWS - cloudposse/terraform-aws-ec2-autoscale-group

cloudposse/terraform-aws-eks-workers

Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers - cloudposse/terraform-aws-eks-workers

cloudposse/terraform-aws-eks-cluster

Terraform module for provisioning an EKS cluster. Contribute to cloudposse/terraform-aws-eks-cluster development by creating an account on GitHub.

aknysh

New features:

aknysh
  1. A complete working example https://github.com/cloudposse/terraform-aws-eks-cluster/tree/master/examples/complete

  2. Automatic tests (bats and terratest) to lint the code and provision the example on AWS https://github.com/cloudposse/terraform-aws-eks-cluster/tree/master/test

  3. Codefresh pipeline to run the tests (it provisions the cluster on AWS test account and then checks all the outputs for validity)

https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/codefresh/test.yml

  1. You can specify additional IAM Roles, Users and AWS accounts to be added to the Auth ConfigMap to allow authenticating to the EKS cluster

https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/configmap-auth.yaml.tpl#L9-L19 https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/variables.tf#L120-L148

  1. The Auth ConfigMap accepts a list of worker node ARNs to allow many different worker groups using diff EC2 instances to join the same EKS cluster

https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/configmap-auth.yaml.tpl#L8 https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/variables.tf#L75 https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/examples/complete/main.tf#L89

  1. To apply the Auth ConfigMap, the module does not construct kubeconfig anymore. Instead it reads kubeconfig from the cluster after it gets provisioned

https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/auth.tf#L87 (thanks to @oscar for the ideas)

  1. The automatic test now waits for all worker nodes to join the EKS cluster

https://github.com/cloudposse/terraform-aws-eks-cluster/blob/master/test/src/examples_complete_test.go#L81-L122

Waiting for worker nodes to join the EKS cluster                                                                                                                 
Worker Node ip-172-16-119-111.us-east-2.compute.internal has joined the EKS cluster at 2019-10-01 00<i class="em em-47"></i>51 +0000 UTC                                             
Worker Node ip-172-16-155-103.us-east-2.compute.internal has joined the EKS cluster at 2019-10-01 00<i class="em em-48"></i>01 +0000 UTC                                             
All worker nodes have joined the EKS cluster
1
Erik Osterman

amazing job as usual @aknysh

Erik Osterman

really like the outcome

oscar

2019-09-26

2019-09-25

Sharanya

Components for secure UI hosting in S3 • S3 — for storing the static site • CloudFront — for serving the static site over SSL • AWS Certificate Manager — for generating the SSL certificates Route53 — for routing the domain name to the correct location Did anyone come across any modules for this in terraform ?

Exequiel Barrirero
cloudposse/terraform-aws-cloudfront-s3-cdn

Terraform module to easily provision CloudFront CDN backed by an S3 origin - cloudposse/terraform-aws-cloudfront-s3-cdn

Sharanya

@Exequiel Barrirero Thnkq so much

AgustínGonzalezNicolini

Hi everyone, what module would you recomend I use to store a github access token?

My team is storing stuff like that in SSM using Chamber

segmentio/chamber

CLI for managing secrets. Contribute to segmentio/chamber development by creating an account on GitHub.

or rather, starting to move to that. We are still in SecretsManager for most of our stuff.

AgustínGonzalezNicolini

awsome, thanks

AgustínGonzalezNicolini

I’m using TF to manage all github

2019-09-10

Anyone know if it’s possible to do what amounts to an else if in 0.12?

I’m doing name = (var.branch == "master" ? "${var.namespace}-${var.stage}-${var.service}" : "${var.namespace}-${var.stage}-${var.service}-${var.branch}")

but I want to also check for var.branch == “staging” in the middle there

aknysh

name = var.branch == "master" ? .... : (var.branch == "staging" ? ... : ...)

aknysh

or use locals to simplify

Thanks @aknysh. I’ll check into using locals for this as well, that’s a good idea.

aknysh
cloudposse/terraform-terraform-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-terraform-label

2019-09-09

terraform 0.12 still fail if data resources return nothing ?

2019-09-05

oscar
Upgrade to terraform 0.12 by addisonj · Pull Request #20 · cloudposse/terraform-aws-eks-cluster

This moves this module to terraform 0.12, the example isn&#39;t ported, as some of those modules aren&#39;t 0.12 compliant yet, but this is working with our EKS clusters. I notice there are also te…

oscar

We’re looking to use the EKS modules

oscar
Terraform 0.12 upgrade by addisonj · Pull Request #21 · cloudposse/terraform-aws-eks-workers

Note, this depends on cloudposse/terraform-aws-ec2-autoscale-group#14 getting merged and then making a change here to reference that new tag. This does the upgrade and also copies the new arguments…

oscar
Upgrade to terraform 0.12 by addisonj · Pull Request #14 · cloudposse/terraform-aws-ec2-autoscale-group

This moves us to terraform 0.12, it is working with our usages of this module, but it hasn&#39;t been tested completely with all options, but does appear valid. note that the examples aren&#39;t po…

aknysh

@oscar we’ll get to it soon, sorry for the delay

1
oscar

Dont apologise!

oscar

I’m using the guys forks for now but let me know when I can move back to Cloudposses repos

1
oscar

Didn’t quite work. Some sub-module issues. I’ll just slip in a use terraform0.11

2019-09-04

2019-09-03

oscar

How do I change this

names = ["ecr-1", "ecr-2", "ecr-3"]

locals {
  name  = tolist([for name in var.names : "${name}"])
}

resource "aws_ecr_repository" "default" {
  for_each = toset(var.names)
  name     = local.name[0]
}

To a sort of splat / wildcard. I don’t want just the first index I want them all e.g. local.names[*] — what am I missing?

oscar

I’ve tried all sorts of combos

oscar

Oh lol got it working now

oscar

each.key is working again, I must have changed something else.

@oscarsullivan_old what are you trying to achieve with

name = tolist([for name in var.names : “${name}”])

oscar

I got it now with just a simple for_each and each.key

oscar

I think I tried so many combinations to get it working and made so many changes that I had something overly complex

oscar

ended up being a 3 liner lol

1
1
oscar

Anyone noticed how even with the Makefile below, they still end up with .terraform and .module?

 ✗ . (none) services ⨠ cat Makefile
-include ${TF_MODULE_CACHE}/Makefile

# Makefile used by Geodesic shells to operate Terraform projects

init:
	mkdir -p ${TF_MODULE_CACHE}
	terraform init
oscar

@aknysh I know you’re familiar with this. In your previous example the Reset target does not remove .terraform — have I missed something or misconfigured and now ending up with both dirs?

aknysh

you can add removing .terraform in the Make target. Our example was for CI/CD so we just removed .modules that was created before

oscar

Great thanks, I wasn’t sure if I had inadvertently caused some duplication. My understanding now though is that: .modules is used purely to clone the repo, and then that is used as the source for terraform init.. at which point it appears in the .terraform/modules as per norm

aknysh

TF 0.12 does not like if a folder has any files in it, even dot-files

aknysh

that’s why we create a completely new folder .modules and call terraform init on it

oscar

Any way to have count and for_each on a resource block? So: Count for is_enabled and for_each to iterate through, say, a list of strings for ‘name’ (for example)

oscar

All I can think of is some local variable that checks if is__enabled is true and if it is the array used in the resource for_each is populated, else it is made empty as though it were ‘disabled’? But no idea if that’d just cause an unset error or make it null.. unless Null is a keyword for that

you can use something like this

for_each = { for rule in var.waf_rules : rule.name =&gt; rule if rule.enabled }
aknysh

or something like this (if is_enabled is to enable/disable globally)

aknysh
for_each = var.is_enabled ? toset(var.names) : []
1
Callum Robertson

I really like this toset function, I didn’t think of using this before!

1
aknysh

yea it’s nice. Only needed for list(string). If you use list(object) then list works w/o converting it to set

1
oscar

Oo both interesting examples. Thanks

Anyone knows a way to do in Terraform something like “fire and forget” type of operation ?

I’m creating a rds cluster and it checks for the instance to be created and it takes WAY to long

I added this :

# Make it faster by skipping some checks
  skip_get_ec2_platforms      = true
  skip_metadata_api_check     = true
  skip_region_validation      = true
  skip_credentials_validation = true
  skip_requesting_account_id  = true

but still takes a long time

and some times the connection times out

@PePe I think Terraform needs the output of the API call to update the state file

You can just run the apply in the background

that is what I thought too

and it has been

ing... [48m31s elapsed]

rds is painfull

2019-08-29

How to ask for help on IRC - RJ's Notes

How to ask for help properly on IRC so that you get responses faster. Also relevant to forums and mailing lists

oscar

@Erik Osterman looks like 0.12 for_each on modules is still not yet developed, it is purely reserved ATM https://github.com/hashicorp/terraform/issues/17519

for_each for modules · Issue #17519 · hashicorp/terraform

Is it possible to dynamically select map variable, e.g? Currently I am doing this: http://vars.tf locals { map1 = { name1 = &quot;foo&quot; name2 = &quot;bar&quot; } } http://main.tf module &quot;x1&quot; { sour…

oscar

I’m either going to PR your ECR (https://github.com/cloudposse/terraform-aws-ecr) module to support for_each or work on it privately and have it as an internal module. What’s your pref as that would change a chunk of the code?

Erik Osterman

ahk, i got it mixed up

Erik Osterman

2019-08-28

oscar

Can I get some input pls on for_each?

resource "aws_iam_user" "mfa_user" {
  for_each = toset(var.users)
  name = each.value
  force_destroy = true
}

resource "aws_iam_user_group_membership" "mfa" {
  user = aws_iam_user.mfa_user
  groups = [
    aws_iam_group.mfa_group.name
  ]
  depends_on = [aws_iam_user.mfa_user]
}

I’ve tried all variations of the syntax and even had the for_each inside the membership resource…

I need the users to be created from a list of names, and then I need them adding to a group. It also needs to be in that order else the group_membership resource complains about missing users (?)

oscar

I just can’t seem to nail this for_each thing in 0.12

oscar

NVM I gots it

oscar
resource "aws_iam_user" "mfa_user" {
  for_each = toset(var.users)
  name = each.value
  force_destroy = true
}

resource "aws_iam_user_group_membership" "mfa" {
  for_each = toset(var.users)
  user = aws_iam_user.mfa_user[each.key].name
  groups = [
    aws_iam_group.mfa_group.name
  ]
  depends_on = [aws_iam_user.mfa_user]
}
oscar

For reference

does terraform 0.12 supports MFA properly now ?

Sharanya

Did anyone Come across NPM memory Issues ?

2019-08-27

Lakshmi Kallam

I am trying to upgrade to 0.12.6 from 0.11.4, with aws emr cluster, I am using multiple bootstrap_action scripts. Now I am getting error: resource “aws_emr_cluster” “cluster”: 124: bootstrap_action = [

An argument named “bootstrap_action” is not expected here. Did you mean to define a block of type “bootstrap_action”?

Lakshmi Kallam

any suggestions?

aknysh

Use dynamic blocks

aknysh

In CloudPosse GitHub, search for emr-cluster

aknysh

It’s already in 0.12

Erik Osterman
cloudposse/terraform-aws-emr-cluster

Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster

aknysh

Deployed it today, so should work :)

Erik Osterman
cloudposse/terraform-aws-emr-cluster

Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster

Lakshmi Kallam

Thanks, Let me check that

Lakshmi Kallam

and the same thing applies for having multiple steps also?

aknysh

var.bootstrap_action is a list of objects (each representing a step)

aknysh
cloudposse/terraform-aws-emr-cluster

Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster

2019-08-25

Andrew Jeffree

@Sharanya you’ll need to specify what module you’re using and provide some more info before anyone can give you any precise help. But the error is pretty clear that you need to set the variable lambda_settings to something appropriate for whatever requires it.

2019-08-23

Sharanya

The variable “lambda_settings” is required, so Terraform cannot proceed without a defined value for it.

Sharanya

anyone came across this issues

2019-08-22

oscarsullivan_old

How do you go about creating N of a module resource when looping a list of names?

For instance I have a list of ecr repos and I want to have the module create a repo for every item in the list of strings

oscarsullivan_old

I’m aware the for each is there for resources but I csnt seem to get it working for a module.

oscar

New account as that was registered to my old work email so couldn’t log in on different devices.

oscar

It doesnt seem like you can use for each or dynamic in a module

Sharanya

Error: The role “arniam:role/gc-invoicedataimport-function-role” cannot be assumed.

There are a number of possible causes of this - the most common are:

* The credentials used in order to assume the role are invalid

* The credentials do not have appropriate permission to assume the role

* The role ARN is not valid

2019-08-20

geertn

Anyone know how to access the iterator count within a dynamic block? EG:

  dynamic "security_rule" {
    for_each = module.tf-var-globals.wl-trust

    content {
      name = "${local.saname_prefix}-wl-tcp-${count.index}"
      priority = "14${count.index}"
      direction = "Inbound"
      access = "Allow"
      protocol = "Tcp"
      source_port_range = "*"
      destination_port_range = "80"
      source_address_prefix = "${security_rule.value.ip}"
      description = "${security_rule.value.description}"
      destination_address_prefix = "*"
    }
  }
Vitaliy Lobachev

Yes I do : dynamic “website” { for_each = contains(each.value.type, “website”) ? [each.value.website] : [] content { error_document = each.value.website.error_document index_document = each.value.website.index_document } }

https://github.com/devops-best-practices/terraform-best-practice/blob/master/s3.tf

devops-best-practices/terraform-best-practice

Contribute to devops-best-practices/terraform-best-practice development by creating an account on GitHub.

Vitaliy Lobachev

===================== for_each = contains(each.value.type, “website”) ? [each.value.website] : [] =====================

geertn

If at all possible

aknysh
The iterator object  has two attributes:

key is the map key or list element index for the current element. If the for_each expression produces a set value then key is identical to value and should not be used.
value is the value of the current element.
aknysh
Expressions - Configuration Language - Terraform by HashiCorp

The Terraform language allows the use of expressions to access data exported by resources and to transform and combine that data to produce other values.

aknysh

if module.tf-var-globals.wl-trust is a list, then name = "${local.saname_prefix}-wl-tcp-${security_rule.key}"

geertn

Thanks!!

mpmsimo

If using a list it must be a set(list) if you are using for_each. Otherwise maps are fine.

aknysh

for_each could be used with any collection type

aknysh

map, list, set

aknysh

it does not have to be always a set

mpmsimo

Hmm, I remember trying to pass in a list of strings and explicitly getting a failure for this.

mpmsimo

I could of been doing something weird, as it was a local variable being passed into a module, the module manipulating that var and creating a list.

mpmsimo

Lots of places where I could of gone wrong I think

mpmsimo
Error: Invalid for_each argument

  on .terraform/modules/inventor/github.tf line 56, in resource "github_repository_webhook" "discord":
  56:   for_each = var.discord_webhooks

The given "for_each" argument value is unsuitable: the "for_each" argument
must be a map, or set of strings, and you have provided a value of type list
of dynamic.
mpmsimo

Where var.discord_webhooks was something like: ["a8efu9a8fuae8u9f8eua98fu", "a3ijoij40958092840932j"]

mpmsimo

Within the var definition, it was associated explicitly with the list type and when I had changed it to set(list) was resolved.

mpmsimo

0.12.6 for reference, unsure if it’s applicable all the time but in my specific case it helped me.

mpmsimo

dynamic looks so useful! Haven’t been able to try it out yet.

mpmsimo

Would help me be more DRY with file provisioners in some of the resources I have. Any sub-resource block expansion really

2019-08-19

2019-08-16

2019-08-15

joshmyers

Any ideas about Error: Invalid combination of "count" and "for_each" in TF 0.12 ?

joshmyers

What are the semantics of for_each to replicate boolean logic of count?

joshmyers

nvm, got it

joshmyers

Does 0.12 have the ability to do nested loops?

joshmyers

for_each gives you each.key / each.value

joshmyers

I want to loop through each.value too

it does, one moment

joshmyers

ah ha, think I can… for foo in bar

joshmyers
joshmyers

lol

playing with null again ?

joshmyers

No, playing with loops, no null

joshmyers

Nothing particularly complex either, sigh

joshmyers

back to count for me.

Addison Higham

hey, not sure where the best place to ask this is, curious if there is a place where ya’ll are tracking compatibility with terraform 0.12? I am making use primarily of https://github.com/cloudposse/terraform-aws-eks-workers and https://github.com/cloudposse/terraform-aws-eks-cluster (great modules btw!), happy also to help get them ported, but just was curious if you have a guide on how you are approaching that? I noticed it looks like you are maintaining a 0.11 branch

cloudposse/terraform-aws-eks-workers

Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers - cloudposse/terraform-aws-eks-workers

cloudposse/terraform-aws-eks-cluster

Terraform module for provisioning an EKS cluster. Contribute to cloudposse/terraform-aws-eks-cluster development by creating an account on GitHub.

I have an existing aws ecs cluster (made by hand) and would like to update it by using terraform. Is there any documentation for updating existing aws services (alb, ecr, ecs)?

Check terraform import.

mpmsimo

Alternatively, if you are doing imports at scale: https://github.com/dtan4/terraforming

dtan4/terraforming

Export existing AWS resources to Terraform style (tf, tfstate) - dtan4/terraforming

2019-08-12

Vitaliy Lobachev

Hello! I want to share with you resource:for_each and dynamicfor_each construction for terraform 12.6 . Hope this helps you work with large arrays of resources. https://github.com/devops-best-practices/terraform-best-practice/blob/master/s3.tf

Sharanya

Hey people, looking for terraform template on vpc peering ( syntax 0.12) any help plz

2019-08-08

Milos Backonja

Awesome. Thanks @Erik Osterman

2019-08-07

Milos Backonja

Guys, I am looking how can I tag resources dynamically, and without repeating same block of code with one change.

Milos Backonja
# Resource 1
tags = merge(
    var.tags,
    map(
      "Name", format("dev-bastion-0%s.${var.domain}",count.index+1),
      "type", "bastion"
    )
  )
  
# Resource 2

tags = merge(
    var.tags,
    map(
      "Name", format("dev-app-0%s.${var.domain}",count.index+1),
      "type", "app"
    )
  )
Milos Backonja

any suggestions are welcome, thanks

Erik Osterman

Have you looked at terraform-null-label?

Erik Osterman
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

Erik Osterman

it supports inheritance using context

2019-08-06

AgustínGonzalezNicolini

hi guys, quick one

AgustínGonzalezNicolini

is hcl string or weak type?

aknysh

hcl1 was completely string based (loose/weak typing)

aknysh

hcl2 added some strong typing by having first-class bool, number and object types

AgustínGonzalezNicolini

thanks!

Julio Tain Sueiras

also added nesting type like map, list

1
Julio Tain Sueiras

(so you can define it as map(list(string))

2019-08-05

Just made https://github.com/Flaconi/terraform-aws-waf-acl-rules using the for_each directive

Flaconi/terraform-aws-waf-acl-rules

Module for simple management of WAF Rules and the ACL - Flaconi/terraform-aws-waf-acl-rules

4

2019-08-02

Julio Tain Sueiras

P.S. since I am not sure if anybody used this trick, but someone on reddit ask the question and I did a small recording of it

Julio Tain Sueiras

basically due to show behaviour changed in 0.12

Julio Tain Sueiras

you can generate terraform code from any resource that support import

loren

way cool

so it is like terraforming ?

dtan4/terraforming

Export existing AWS resources to Terraform style (tf, tfstate) - dtan4/terraforming

Julio Tain Sueiras

similar, but the nice thing about the trick above is that it apply to any resouurce

Julio Tain Sueiras

not limited to aws

Julio Tain Sueiras

as long as the resource support import

ohhh I c ok, yep that is cool

2019-07-31

Julio Tain Sueiras

note: 0.12.6 have been released and added for each on resource

3
Julio Tain Sueiras

(and probably data source as well)

loren

Bam! Nice!

2019-07-29

Sharanya

Hey Folks, Trying to find some Terraform Modules related to AWS - app stream service ( for creating fleets and stacks) any help appreciated

2019-07-28

Callum Robertson

This is very helpful! Thanks @

2019-07-26

terraformdns/terraform-dns-recordsets

Terraform module for creating DNS recordsets using RFC 2136 dynamic updates - terraformdns/terraform-dns-recordsets

2019-07-23

for_each on maps, it’s coming https://github.com/hashicorp/terraform/pull/21922

Resource for_each by pselle · Pull Request #21922 · hashicorp/terraform

Allow instances to be created according to a map or a set of strings. locals { little_map = { a = 1 b = 2 } } resource &quot;random_pet&quot; &quot;server&quot; { for_each = little_ma…

loren

been following that one, with a lot of excitement

Resource for_each by pselle · Pull Request #21922 · hashicorp/terraform

Allow instances to be created according to a map or a set of strings. locals { little_map = { a = 1 b = 2 } } resource &quot;random_pet&quot; &quot;server&quot; { for_each = little_ma…

Callum Robertson

so nice!

2019-07-18

Michael Iams

@Erik Osterman When do you expect to have the the majority of .12 conversion complete?

aknysh

we converted about 35% of all our modules. We actively working on it when we are not 100% consumed by customers’ projects. I would say in the next 1-2 weeks

2019-07-16

Callum Robertson

PSA: If you’re upgrading to terraform 0.12 and the VSCode extension for Terraform Syntax highlighting, add this to your settings.json

Callum Robertson
10:31:23 AM
Callum Robertson

Should resolve all the maddening false positives on syntax errors

Callum Robertson

(You have to restart the IDE as well)

Callum Robertson
loren

thanks for the reference, and the workaround, the broken highlighting is maddening

Callum Robertson

glad it helped someone!

2019-07-09

does tf 12 allow you to interpolate backends?

Erik Osterman

not yet

Erik Osterman

use environment variables instead

Erik Osterman

or a hybrid

Erik Osterman

TF_CLI_ARGS_init="-backend-config=/something.ini"

Erik Osterman

then write your config to /something.ini

Erik Osterman
Backends: Configuration - Terraform by HashiCorp

Backends are configured directly in Terraform files in the terraform section.

2019-06-23

Callum Robertson

Thanks @Erik Osterman

2019-06-20

joshmyers

hey folks - if you were starting a new project, thoughts on using 0.12 from the get go….? cc @antonbabenko @Erik Osterman @aknysh

aknysh

should be ok. Not sure about it 100% since we converted just a few modules, working on the rest now

joshmyers

Nice, any “fun” with lists of maps/other workarounds we came up with for enabled/disabed etc?

aknysh

(we did not get to those modules yet)

aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

joshmyers

hah, I bet

joshmyers

Cheers Andriy

Erik Osterman

0.12 is definitely more enjoyable

Erik Osterman

I would start fresh with that

2

are many of you guys running into:

Error: Failed to instantiate provider "aws" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]

I get this with 0.12.2.

the solutions I seem to find out there are to recompile tf, but wondered if people had a workaround?

loren

What version of the aws provider are you using?

  version             = "~> 2"

huh, I guess

  version             = "~> 2.16"

works

loren

Ahh, they must have updated the schema version?

Erik Osterman
GitHub

GitHub is where people build software. More than 36 million people use GitHub to discover, fork, and contribute to over 100 million projects.

why have terraform-terraform-label and terraform-null-label. Are we planning to deprecate anyone?

Erik Osterman

terraform-terraform-label was introduced as a simpler alternative to terraform-null-label which grew unwieldy in 0.11

Erik Osterman

with 0.12, terraform-null-label is once again sane, but we’ll continue supporting terraform-terraform-label

Erik Osterman

and both have been updated to 0.12

2019-06-19

hi all, seems like terraform-null-label is not compatible with terraform 0.12. The same module being used in all modules make them kind of unusable too

aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

aknysh

to use it with TF 0.12, pin to the latest release

aknysh

to use with TF 0.11, pin to 0.11.1

then we have to change this in all the modules correct, i can send pr for the modules which we uses.

aknysh

we have to update all the modules, we are working on it now

aknysh

PRs are welcome, thanks

or may be a better solution is https://dependabot.com/terraform/

Dependabot

Automated dependency updates for your Ruby, Python, JavaScript, PHP, .NET, Go, Elixir, Rust, Java and Elm.

which should fix this across all repos for you

have you tried that?

aknysh

we are using dependabot

aknysh

not sure if it’s possible to automatically convert everything to TF 0.12

aknysh

works in simple cases

aknysh

but usually you have to manually fix/update the code after the conversion

aknysh

as far as I’ve seen it, the automatic conversion can’t work in some cases or breaks code in other cases

i though you only need to update the null-label dependency across all projects.

aknysh

if your modules are TF 0.11 and you point them to null-label 0.12, will it work?

i didn’t tried null-label 0.12 yet. What I do know is you can make null-label 0.12 work with both 0.11 and 0.12.

If its not working for any particular syntaxes, should raise a bug in terraform

anyways you can specify that modules with tag version like 2.x only support 0.12

aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

aknysh

will not work with TF 0.11

aknysh

if your modules are TF 0.11

i got it, you are saying automated null-label bump is not satisfactory since you want to address tagging along with it.

anyways I will send pr for the modules which we are using.

aknysh

i mean when you update your modules to TF 0.12 and if the modules use the label, you will bump the label version in the new TF 0.12 code

aknysh

automated label bump to TF 0.12 in the module that supports only 0.11will not work

that i agree, but if we fixed the deps and ci runs auto terraform 0.12upgrade --yes we can easily check narrow down the errors. Few modules like https://github.com/cloudposse/terraform-aws-key-pair.git don’t need anything apart from label bump and upgrade.

cloudposse/terraform-aws-key-pair

Terraform Module to Automatically Generate SSH Key Pairs (Public/Private Keys) - cloudposse/terraform-aws-key-pair

anyways there is a faster way which is clone all repos and do sed to replace version.

so automation won’t be worth it

Erik Osterman

Dependabot is awesome but without automated tests, a sure fire way to absolutely break everything with regressions

Erik Osterman

We tried it on a handful of repos about a year ago and quickly things started breaking (aka GitHub issues started spiking)

Erik Osterman

So as part of our upgrading to 0.12 we are trying to add more tests with terratest and bats

Erik Osterman

That way we catch regressions or at least have a way to test for them as they arise in the future

yup ci should have better tests for automations

But with 100+ modules we should work in that direction as well. I would love to help with something you required.

one more thing I would recommend is to have http://version.tf file. The automatic upgrade does create this file and its easy to identify current terraform version for modules by just looking at the presence of file.

aknysh

yes, we are using <http://versions.tf> file in all repos we convert

Erik Osterman

@ would massively appreciate some help

Erik Osterman

I will type up some guidance

today i sleep, tomorrow morning I would try an approach to bump all those modules which requires lesser tinkering with some scripts.

Erik Osterman

If you have time to do a quick call this week that would be awesome too

Erik Osterman

Ok

the part where i got lazy is fork and raise pr

Erik Osterman

You were working with some in house git bots, right?

yes but they are mostly chatops related thing, and work within an org

Erik Osterman

Did you finish rolling out test-infra used by istio?

Erik Osterman

And k8s

no but we did the vanilla prows one and hooked with tekton

you can avoid tekton and can continue use cloudfresh in parallel

Erik Osterman

Btw office hours today at 11:30 - in 1.5 hours

i got severe cold, and its already past 10 pm for me

Erik Osterman

Oh no! Definitely get some rest

early morning person, i probably won’t be able to attend any of your office hours till I am in bangalore.

Will catchup tomorrow morning with what I was able to do.

Also you need some marking strategy whether the repo is done, may be presence of http://version.tf or a specific tag versioning method

I would recommend http://version.tf

If you agree can we add that to null label repo

aknysh

sure

aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

1
aknysh
cloudposse/terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label

1
aknysh
cloudposse/terraform-terraform-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-terraform-label

1

Awesome

1
Callum Robertson

That label module is the hotness

1

2019-06-18

davidvasandani

Is it possible to taint an entire module yet?

1

2019-06-15

2019-06-14

2019-06-13

@Erik Osterman what is the problem with the current terraform-terraform-label pr for 0.12.. I’d ike to push dynamodb to 0.12. Also current travis config fails for 0.12 still if im not mistaken.

Erik Osterman

Thought I replied but don’t see the messages

Erik Osterman

we need to convert this repo to use codefresh where all of our tooling is to support 0.12

Erik Osterman

andriy needed to take a couple days off, so project is on hold until next week

All clear, thanks

aknysh

I’ll finish it tomorrow

Erik Osterman

@aknysh started working on it but had to take some days off

Erik Osterman

We need to take a few steps with each module

Erik Osterman

First updating it to use Codefresh where we have all the 0.12 tooling in place

Erik Osterman

I will try to rush this out though for you if it’s a blocker

Hi,

I just started to upgrade the gilab-runner-spot-module (for AWS) to TF 0.12. Would be great if you can help me with the following questions.

I used the tool terraform-docs to generate documentation of the variables, this tool seems not working (yet) for 0.12. Does anybody knows / uses an alternative approach?

Does anybody has a tip what is the best way to upgrade a data “aws_ami”. In my TF 0.11 module I had provided the option to inject the filter via a variable as follow:

variable "ami_filter" {
  type        = "list"

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

data "aws_ami" "runner" {
  most_recent = "true"

  filter = "${var.ami_filter}"

  owners = ["${var.ami_owners}"]
}

Does anybody has a good example how I can keep the filter(s) configurable in tf 0.12?

Oops, already hab an answer on the filter question, map with a dynamic block

2019-06-11

Nikola Velkovski

A small appreciation to hands down one of the best modules out there

module "label" {
  source    = "git:<i class="em em-<https"></i>//github.com/cloudposse/terraform-null-label.git?ref=0.12.0>"
  stage     = local.stage
  name      = local.name
  delimiter = "-"
  tags = {
    "<http://kubernetes.io/cluster/${module.label.id}\|kubernetes.io/cluster/${module.label.id}>" = "shared"
  }
}
2
1
1
Erik Osterman

hrm… does this work? looks like the tags are referring to the label itself?

2
1
1
Nikola Velkovski

Yes it does!

2
1
1
Nikola Velkovski

Not sure if this will work in 0.11 though.

Erik Osterman

thanks @Nikola Velkovski!! comments like these is what keeps us going!

1

and the salary….and food too

Nikola Velkovski

And the coffee

1
Nikola Velkovski

2019-06-04

Erik Osterman
0.12 support for terraform-docs by osterman · Pull Request #152 · cloudposse/build-harness

what Add a hack to support terraform 0.12 with terraform-docs Use awk to generate variables and outputs suitable for terraform-docs why terraform-docs does not yet support HCL2 references segm…

Erik Osterman

it’s dirty. it’s nasty. but if you need terraform-docs to work with 0.12, it works for us.

4
1
cytopia

Great work and thanks for that! As @antonbabenko has mentioned an issue on this PR and I am also facing this, I’ve tried to address it: https://github.com/cloudposse/build-harness/pull/155

#152 Ensure terraform-docs 0.12 multi-line default statement is parsed correctly by cytopia · Pull Request #155 · cloudposse/build-harness

terraform-docs 0.12 multi-line default parsing There currently seems to be an issue with multi-line default statement parsing as mentioned by @antonbabenko here: #152 (comment) This PR tries to add…

4
1
antonbabenko

Awesome, I will give it a try on Monday! Really hope it works :)

4
1
Erik Osterman

Thanks @cytopia !

4
1
cytopia

@Erik Osterman @antonbabenko one last issue I am currently facing is default = null. To what should this be transformed for Terraform < 0.12 docs generation?

4
1
antonbabenko

it is tricky… default = null in 0.12 is closest to default = "null" in 0.11. It is a hack, really, because there was no null value before 0.12.

4
1
Erik Osterman

null == ""

4
1
Erik Osterman

or maybe you can hack it like

4
1
Erik Osterman

null == “null

4
1
Erik Osterman

with markdown

4
1
Erik Osterman

@antonbabenko

antonbabenko

Awesome! Thanks @Erik Osterman!

2019-06-02

please someone tell me what i am doing worng

09:14:12 AM

and i am getting back

09:14:31 AM

seems like it founr the right subent id but ignores it

when i remove the module.main.web_public_subnets[0].id and hard code the subnet it works

and this happens also if i make module.main.web_public_subnets output to be only one var and then remove the [0]

never mind i added .id but forgot that i took the value from an output and not the resource output

2019-05-30

Erik Osterman

any handy 0.12 cheatsheets?

Erik Osterman
rberlind/terraform-0.12-examples

Some Terraform 0.12 Examples. Contribute to rberlind/terraform-0.12-examples development by creating an account on GitHub.

2019-05-29

joshmyers

Doesn’t look like that module has too many….hairy parts…..the rest of us have been using hacks on hacks on hacks

2019-05-28

Gosia

hey, a little question regarding 0.12, seems the feature of generating resources based on count and value list still keeps resources list in statefile in an indexed structure, is there a workaround? Still can’t remove an element from anywhere but the end of the list without forcing a replace on remaining elements.

loren

That’s still a limitation in this release… They’ve indicated it will be addressed in 0.12.x, but no indication of what value of x… (Other than not 0)

Gosia

aww, sucks, but thank you

loren
Attributes as Blocks - Configuration Language - Terraform by HashiCorp

For historical reasons, certain arguments within resource blocks can use either block or attribute syntax.

2
antonbabenko

I think it is a good idea to read the whole Terraform docs, because there are few things here and there. Attrs as blocks is one of the most trickiest

loren

yeah, i’m not a fan of that change. makes it impossible for many resources to write modules that work for both tf 0.11 and tf 0.12

Erik Osterman

hah, is there even a point to try and make them compatible?

loren

i wanted an upgrade path of this kind:

  1. update modules to be cross-compatible as a patch release
  2. update the executing project to use tf 0.12
  3. leisurely update modules to leverage tf 0.12 syntax
loren

1 is fast, easy, and low risk

loren

and gives users an inflection point for their own upgrade paths. hashicorp is doing the same thing for providers with their SDK and with tf 0.11.14

David Nolan

I think adding version tags in your modules is the supported approach. Honestly this upgrade is going to be long enough and slow enough I suspect branches or forks will end up having to be the real world answer.

2019-05-26

2019-05-24

loren
tf 0.12.0: Call to function "matchkeys" failed: lists must be of the same type. · Issue #21432 · hashicorp/terraform

Terraform Version > terraform012 -version Terraform v0.12.0 Terraform Configuration Files locals { foo = [&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;] match = &quot;${matchkeys(local.foo, …

loren

looks like they might have just run the upgrade tool on everything?

2019-05-23

Nikola Velkovski
- vpc.label in .terraform/modules/vpc.label
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.

Error: Attribute name required

  on .terraform/modules/dynamic_subnets/private.tf line 34, in resource "aws_subnet" "private":
  34:     ignore_changes = ["tags.%", "tags.kubernetes", "tags.SubnetType"]

Dot must be followed by attribute name.


Error: Attribute name required

  on .terraform/modules/dynamic_subnets/public.tf line 35, in resource "aws_subnet" "public":
  35:     ignore_changes = ["tags.%", "tags.kubernetes", "tags.SubnetType"]

Dot must be followed by attribute name.

Nikola Velkovski

ah

Nikola Velkovski
cloudposse/terraform-aws-dynamic-subnets

Terraform module for public and private subnets provisioning in existing VPC - cloudposse/terraform-aws-dynamic-subnets

Nikola Velkovski

Is there any roadmap for making the module 0.12 compatible? Let me know if I can be of help somehow.

Erik Osterman

We will inevitably support 0.12, but not until there’s more mainstream adoption.

Erik Osterman

Most likely it will come from (cloudposse) customer demand.

Erik Osterman

I think we might need to start with a master/0.12 branch and go from there.

Erik Osterman

also, it will mess with versions. We’ll probably need to affix +0.12 to the semmver

Erik Osterman

e.g. 0.1.2+0.12

Erik Osterman

and doubt we’ll be backporting fixes.

Nikola Velkovski

Allright, thanks for the info.

Erik Osterman

Welcome suggestions from community on how we can straddle the two worlds.

Erik Osterman

And if the proposal above make sense.

2019-05-22

Exequiel Barrirero
hashicorp/terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amon…

Exequiel Barrirero

Finally! Terraform 0.12 is here to stay!

8
4
Exequiel Barrirero
Announcing Terraform 0.12

We are very proud to announce that Terraform 0.12 is officially released. Terraform 0.12 is a major update that includes dozens of improvements and features spanning the breadth a…

5
1
1
2

i know they really tried to focus on making the 0.11 -> 0.12 migration easy (even providing a migration tool), but im curious to see how much of a headache (or lack thereof) it will be

Erik Osterman

Has anyone done his yet for a sizable terraform codebase?

Erik Osterman

(I guess I’m more interested in a non-monorepo migration)

Erik Osterman

…though this is a great case for mono-repo

loren

I’d expect similar types of updates, plus a little workflow around versioning… Pin references to nested modules (which you should be doing anyway), update leaf modules, release those updates as new versions, update parent modules once all nested/leaf modules are good

loren

For sure it’ll suck more if you feel the need to backport patches to support two major versions at once

Erik Osterman

(basically, we have 130+ repos… so it’s gonna hurt. a lot and we don’t have a graph of how they are related, so planning it out is difficult)

nope, kinda worried to

even now some of the providers i use are pretty fickle (when using them together - azure, kubernetes, helm, etc)

Andrew Jeffree

well my first upgrade to 0.12 went well

1
Andrew Jeffree

but it was a relatively simple thing

Andrew Jeffree

all our datadog monitors

Andrew Jeffree

for all our customers

Andrew Jeffree

so 20~ modules used about 40 times each, with about 3 or 4 resources per module. The most time consuming part was upgrading the modules, docs and publishing new versions etc.

2019-05-09

Exequiel Barrirero
Releasing Terraform 0.12.0-rc1

Release candidate 1 of Terraform 0.12.0 is now available for testing. Unless testing identifies a significant blocker, we expect to publish the final 0.12.0 release a few weeks fro…

2
Exequiel Barrirero

Almost there!

Exequiel Barrirero

Erik Osterman

wow

1

2019-04-19

Exequiel Barrirero
Announcing Terraform 0.12 Beta 2

We are pleased to announce the availability of the second beta release of HashiCorp Terraform 0.12! The 0.12 release of Terraform contains major language improvements and a host of…

2
Exequiel Barrirero
08:29:05 PM

2019-04-18

Exequiel Barrirero
terraform-providers/terraform-provider-aws

Terraform AWS provider. Contribute to terraform-providers/terraform-provider-aws development by creating an account on GitHub.

Exequiel Barrirero
06:01:58 PM
3
Exequiel Barrirero
hashicorp/terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amon…

3

2019-03-19

Announcing Terraform 0.12 Beta 1

We’d like to invite the community to try the first Terraform 0.12 Beta release. This release includes major Terraform language improvements and a tool for automatically upgrading m…

6

2019-03-09

ldlework

I got stuff like

Error: Incorrect attribute value type

  on .terraform/modules/rds_cluster_aurora_mysql_serverless/main.tf line 22, in resource "aws_security_group" "default":
  22:     security_groups = ["${var.security_groups}"]

Inappropriate value for attribute "security_groups": element 0: string
required.

after updating to the beta

ldlework

Will various modules be being update soon or should I hold off for a while?

ldlework

(I’m also pretty new to Terraform so excuse any future ignorance )

ldlework
08:49:41 PM

pokes @Erik Osterman

Erik Osterman

@idlework unfortunately we have not had a chance to update any of our modules to 0.12 (yet)

Erik Osterman

So we cannot provide much yet in ways of guidance.

ldlework

Oh I was simply interested in that information, thank you. I will hold off on upgrading (since I use your modules!)

Erik Osterman

also, the terraform-aws-provider v2+ might have broken some things

Erik Osterman

we have a lot of homework ahead of us

ldlework

@Erik Osterman Are you saying that you think the most recent aws provider for 0.12 might itself be broken? Or that changes in the provider might have broken bits of sweetops modules?

Erik Osterman

the terraform-aws-provider is used by all versions of terraform. it broke compatibility with some things.

Erik Osterman
aws_route53_record `allow_overwrite` deprecation will break ability to update `SOA` · Issue #7846 · terraform-providers/terraform-provider-aws

Community Note Please vote on this issue by adding a reaction to the original issue to help the community and maintainers prioritize this request Please do not leave &quot;+1&quot; or &quot;me to…

2019-02-28

stobiewankenobi

Woooooooooooooooooooooo

stobiewankenobi
Announcing Terraform 0.12 Beta 1

We’d like to invite the community to try the first Terraform 0.12 Beta release. This release includes major Terraform language improvements and a tool for automatically upgrading m…

2

2019-02-20

Was actually looking for a pre-0.12 module . Nice to see some have done some 0.12 effort already. Have to backport unfortunately

https://github.com/innovationnorway/terraform-github-repository/blob/master/main.tf

innovationnorway/terraform-github-repository

Create GitHub repository. Contribute to innovationnorway/terraform-github-repository development by creating an account on GitHub.

antonbabenko

one day you will discover my Azure module in that org too - https://github.com/innovationnorway/terraform-azurerm-network . Not for 0.12 though.

innovationnorway/terraform-azurerm-network

Terraform module which creates networking resources on Azure - innovationnorway/terraform-azurerm-network

Erik Osterman

a lot of interesting things going on in innocationnorway

2019-02-14

Erik Osterman
05:22:41 AM

@Erik Osterman set the channel purpose: Discuss upgrading to terraform 0.12

Archive: https://archive.sweetops.com/terraform-0_12/

2019-02-10

bamaral
03:43:53 PM

@joshmyers I think that the module on the repo is more specific and I evaluate that the part related to the autoscaling group resource is compatible with the tf-0_12 version. I created a general purpose module where for example I don’t set tags and these values should be passed through an upper module. Or should I create a PR with the generic approach? https://github.com/bamaralf/terraform-aws-autoscaling/blob/tf-0_12/main.tf

bamaralf/terraform-aws-autoscaling

Terraform module which creates Auto Scaling resources on AWS - bamaralf/terraform-aws-autoscaling

joshmyers

@bamaral pretty big change in a single commit (239 additions and 1,210 deletions), looks good but I’m not quite sure what to be looking at. Any chance you can open a PR with info how it has been tested etc?

bamaral

@joshmyers On my repository, I decouple the autoscaling_group resource and this is the reason you found so many deletions. I don’t think it is mergeable. On your repository you create a launch_template, a autoscaling_group and “attach” the launch template to this asg. I don’t know if it’s interesting to add the launch_template “attachment” as a dynamic block since the behavior of the module is to create the launch_template and attach it. But I think we can use a dynamic block here: https://github.com/cloudposse/terraform-aws-ec2-autoscale-group/blob/7af452e82effc45c0fb776a54cb594d7a27784d7/main.tf#L63

cloudposse/terraform-aws-ec2-autoscale-group

Terraform module to provision Auto Scaling Group and Launch Template on AWS - cloudposse/terraform-aws-ec2-autoscale-group

bamaral

I will create a PR with this change

bamaral

in fact, we can use one of these arguments on the aws_autoscaling_resource “tags” (map) or “tag” (config block). Since you are using the “tags” argument, that is fine.

bamaral

I’ll just check tha compatibility of the module with the terraform alpha version

2019-02-09

What are your takes on the points that he raises, as prolific module creators?

2019-02-08

bamaral

Hi @antonbabenko

bamaral
terraform-aws-modules/terraform-aws-autoscaling

Terraform module which creates Auto Scaling resources on AWS - terraform-aws-modules/terraform-aws-autoscaling

bamaral

I created modules terraform-aws-autoscaling and terraform-aws-launch-config for terraform_0.12

bamaral

Could you please create a branch in the terraform-aws-autoscaling repository where I can send a PR?

bamaral

perhaps, it could be a good idea to have a terraform-aws-launch-config module

joshmyers

@bamaral can you fork it, add whatever and then open a PR against ours?

Erik Osterman

Yes, this opens up an interesting question

Erik Osterman

Should we start (temporary) yet longer lived branches for 0.12

Erik Osterman

So that we can front load some of the work

Erik Osterman

@joshmyers any strategic advice on how we should handle this across all repos?

joshmyers

Painfully?

joshmyers

Take the most used modules first or the ones which do could really require 0.12 features

joshmyers

Folks spend an hour a day moving things over?

joshmyers

longer lived branches are the only way to do it

bamaral
03:43:12 PM

Hi @joshmyers, I’ll check yours

@bamaral can you fork it, add whatever and then open a PR against ours?

bamaral
cloudposse/terraform-aws-ec2-autoscale-group

Terraform module to provision Auto Scaling Group and Launch Template on AWS - cloudposse/terraform-aws-ec2-autoscale-group

bamaral
03:54:49 PM

I think it is a good idea

Should we start (temporary) yet longer lived branches for 0.12

antonbabenko

@bamaral I am away for a few days, and then will take a look at your PR. As always, fork and send a pr to the origin repo. Thanks!

1
Erik Osterman

Cool we will also get some 0.12 branches ready

Erik Osterman

Wonder what the implications will be on versioning

Erik Osterman

How should we version our releases if we have long lived branches?

2019-02-06

antonbabenko

Trying 0.12 while at CfgMgmtCamp hackathon - it works for the majority of cases for people around me who is trying it on more or less real resources and works well enough for me and some small modules - no panics, no bugs which can’t be fixed.

antonbabenko

I think it is time to dedicate more efforts on updating modules.

3
2
bamaral

I agree

bamaral

@antonbabenko I created some AWS modules for tf0.12

bamaral

I just created a PR on https://github.com/terraform-aws-modules/terraform-aws-s3-bucket, but I think it’s better we create a specific branch for it.

terraform-aws-modules/terraform-aws-s3-bucket

Terraform module which creates S3 bucket resources on AWS - terraform-aws-modules/terraform-aws-s3-bucket

antonbabenko

Cool. I will check it out tomorrow. I also started writing the same module today after several attempts of making it for 0.11 :) exciting!

1

2018-11-30

Erik Osterman
12:03:36 AM

@Erik Osterman set the channel topic:

2018-11-16

Erik Osterman

has anyone played around with the terraform 0.12 rc with terragrunt?

catdevman
Terraform 0.12 Deep Dive: Why HCL 2.0 and Remote Plan & Apply?

With over a dozen new improvements in Terraform 0.12 release, we’d like to focus our webinar on 2 key updates and their use cases: What is HCL 2.0 and Remote Plan & Apply?

2018-11-06

06:23:41 PM

@ has joined the channel

2018-11-03

I will be, but waiting to merge a few things first. Also looking at the issues, I wonder if they ship 0.12 before the new year.

08:10:21 PM

@ has joined the channel

2018-11-02

hashicorp/terraform

Terraform is a tool for building, changing, and combining infrastructure safely and efficiently. - hashicorp/terraform

Erik Osterman

How’s airship coming along? You’re porting it right?

2018-10-31

04:52:29 PM

@ has joined the channel

2018-10-29

Kenny Inggs
11:55:56 AM

@Kenny Inggs has joined the channel

2018-10-27

03:03:10 AM

@ has joined the channel

2018-10-26

Jake Lundberg (HashiCorp)
09:55:01 PM

@Jake Lundberg (HashiCorp) has joined the channel

Steven
03:06:39 AM

@Steven has joined the channel

2018-10-25

03:58:35 PM

@ has joined the channel

mallen
07:03:12 PM

@mallen has joined the channel

2018-10-24

07:40:36 AM

@ has joined the channel

stobiewankenobi
11:21:10 PM

@stobiewankenobi has joined the channel

2018-10-23

Erik Osterman
07:34:23 PM

@Erik Osterman has joined the channel

Erik Osterman
07:34:24 PM

@Erik Osterman set the channel purpose: Discuss upgrading to terraform 0.12

07:34:24 PM

@ has joined the channel

aknysh
07:34:24 PM

@aknysh has joined the channel

jarv
07:34:39 PM

@jarv has joined the channel

Erik Osterman

i imagine it will be quiet here until more jump head first into migration

Erik Osterman

related discussions

Erik Osterman

the jump to 11 breaks a lot of “sloppy” code practices of older versions

Has anyone else tried 0.12upgradewith the alpha 0.12 + alpha AWS + alpha template provider. I get this now:

Warning: Unsupported root block type

  on <http://main.tf> line 5, in data "aws_lb" "main":
   5: data "aws_lb" "main" {

The block type "data" is not expected here, so its content was not upgraded.
ndobbs
07:51:52 PM

@ndobbs has joined the channel

ankur
07:57:05 PM

@ankur has joined the channel

Andy
08:18:55 PM

@Andy has joined the channel

jsanchez
09:23:24 PM

@jsanchez has joined the channel

catdevman
09:25:27 PM

@catdevman has joined the channel

    keyboard_arrow_up