#terraform-0_12 (2019-08)
Discuss upgrading to terraform 0.12
Archive: https://archive.sweetops.com/terraform-0_12/
2019-08-02
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
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 avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
basically due to show behaviour changed in 0.12
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
you can generate terraform code from any resource that support import
![loren avatar](https://secure.gravatar.com/avatar/d1e25dcfbc68a0857a04dd78c9afe952.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
way cool
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
so it is like terraforming ?
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
Export existing AWS resources to Terraform style (tf, tfstate) - dtan4/terraforming
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
similar, but the nice thing about the trick above is that it apply to any resouurce
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
not limited to aws
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
as long as the resource support import
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
ohhh I c ok, yep that is cool
2019-08-05
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
Just made https://github.com/Flaconi/terraform-aws-waf-acl-rules using the for_each directive
Module for simple management of WAF Rules and the ACL - Flaconi/terraform-aws-waf-acl-rules
2019-08-06
![AgustínGonzalezNicolini avatar](https://secure.gravatar.com/avatar/fb02f51e23f1d447002da0c44050df3d.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
hi guys, quick one
![AgustínGonzalezNicolini avatar](https://secure.gravatar.com/avatar/fb02f51e23f1d447002da0c44050df3d.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
is hcl string or weak type?
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
hcl1
was completely string based (loose/weak typing)
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
hcl2
added some strong typing by having first-class bool
, number
and object
types
![AgustínGonzalezNicolini avatar](https://secure.gravatar.com/avatar/fb02f51e23f1d447002da0c44050df3d.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
thanks!
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
![Julio Tain Sueiras avatar](https://secure.gravatar.com/avatar/ae8dd22144ec05342181f30748bad052.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0022-72.png)
(so you can define it as map(list(string))
2019-08-07
![Milos Backonja avatar](https://avatars.slack-edge.com/2020-02-12/951480322022_b99708fe1d19b4262d4f_72.jpg)
Guys, I am looking how can I tag resources dynamically, and without repeating same block of code with one change.
![Milos Backonja avatar](https://avatars.slack-edge.com/2020-02-12/951480322022_b99708fe1d19b4262d4f_72.jpg)
# 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 avatar](https://avatars.slack-edge.com/2020-02-12/951480322022_b99708fe1d19b4262d4f_72.jpg)
any suggestions are welcome, thanks
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Have you looked at terraform-null-label
?
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes]) - cloudposse/terraform-null-label
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
it supports inheritance using context
2019-08-08
![Milos Backonja avatar](https://avatars.slack-edge.com/2020-02-12/951480322022_b99708fe1d19b4262d4f_72.jpg)
Awesome. Thanks @Erik Osterman (Cloud Posse)
2019-08-12
![Vitaliy Lobachev avatar](https://secure.gravatar.com/avatar/80c47ca1343715cec83a6c499004b85b.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0019-72.png)
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 avatar](https://avatars.slack-edge.com/2019-08-28/730147904066_371d42477a79b1177fc2_72.jpg)
Hey people, looking for terraform template on vpc peering ( syntax 0.12) any help plz
2019-08-15
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Any ideas about Error: Invalid combination of "count" and "for_each"
in TF 0.12 ?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
What are the semantics of for_each to replicate boolean logic of count?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
nvm, got it
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Does 0.12 have the ability to do nested loops?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
for_each gives you each.key / each.value
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
I want to loop through each.value too
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
it does, one moment
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
ah ha, think I can… for foo in bar
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
lol
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
playing with null again ?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
No, playing with loops, no null
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Nothing particularly complex either, sigh
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
back to count for me.
![Addison Higham avatar](https://secure.gravatar.com/avatar/f89cf3e7cbd2c3c485e2219884106de4.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0010-72.png)
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
Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers - cloudposse/terraform-aws-eks-workers
Terraform module for provisioning an EKS cluster. Contribute to cloudposse/terraform-aws-eks-cluster development by creating an account on GitHub.
![igeorgopoulos avatar](https://secure.gravatar.com/avatar/4aa8f5486457e8c77a5e841cfa6eb51d.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0015-72.png)
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)?
![github140 avatar](https://secure.gravatar.com/avatar/afcb56b638b9dc7f3541d9d13accee94.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0016-72.png)
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Alternatively, if you are doing imports at scale: https://github.com/dtan4/terraforming
Export existing AWS resources to Terraform style (tf, tfstate) - dtan4/terraforming
2019-08-16
2019-08-19
2019-08-20
![geertn avatar](https://avatars.slack-edge.com/2020-10-27/1449291918182_42d49487baccfb1264b1_72.png)
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 avatar](https://secure.gravatar.com/avatar/80c47ca1343715cec83a6c499004b85b.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0019-72.png)
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
Contribute to devops-best-practices/terraform-best-practice development by creating an account on GitHub.
![Vitaliy Lobachev avatar](https://secure.gravatar.com/avatar/80c47ca1343715cec83a6c499004b85b.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0019-72.png)
===================== for_each = contains(each.value.type, “website”) ? [each.value.website] : [] =====================
![geertn avatar](https://avatars.slack-edge.com/2020-10-27/1449291918182_42d49487baccfb1264b1_72.png)
If at all possible
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
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.
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
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.
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
if module.tf-var-globals.wl-trust
is a list, then name = "${local.saname_prefix}-wl-tcp-${security_rule.key}"
![geertn avatar](https://avatars.slack-edge.com/2020-10-27/1449291918182_42d49487baccfb1264b1_72.png)
Thanks!!
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
If using a list it must be a set(list)
if you are using for_each
. Otherwise maps are fine.
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
for_each
could be used with any collection type
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
map, list, set
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
it does not have to be always a set
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Hmm, I remember trying to pass in a list
of strings and explicitly getting a failure for this.
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
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 avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Lots of places where I could of gone wrong I think
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
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 avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Where var.discord_webhooks
was something like: ["a8efu9a8fuae8u9f8eua98fu", "a3ijoij40958092840932j"]
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Within the var definition, it was associated explicitly with the list
type and when I had changed it to set(list)
was resolved.
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
0.12.6
for reference, unsure if it’s applicable all the time but in my specific case it helped me.
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
dynamic
looks so useful! Haven’t been able to try it out yet.
![mpmsimo avatar](https://secure.gravatar.com/avatar/906f51ae1f8abaf42956741690b5d174.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Would help me be more DRY with file provisioners in some of the resources I have. Any sub-resource block expansion really
2019-08-22
![oscarsullivan_old avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
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 avatar](https://avatars.slack-edge.com/2019-02-27/563892542694_c14d0b37236a4a398ef8_72.png)
I’m aware the for each is there for resources but I csnt seem to get it working for a module.
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
New account as that was registered to my old work email so couldn’t log in on different devices.
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
It doesnt seem like you can use for each or dynamic in a module
![Sharanya avatar](https://avatars.slack-edge.com/2019-08-28/730147904066_371d42477a79b1177fc2_72.jpg)
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-23
![Sharanya avatar](https://avatars.slack-edge.com/2019-08-28/730147904066_371d42477a79b1177fc2_72.jpg)
The variable “lambda_settings” is required, so Terraform cannot proceed without a defined value for it.
![Sharanya avatar](https://avatars.slack-edge.com/2019-08-28/730147904066_371d42477a79b1177fc2_72.jpg)
anyone came across this issues
2019-08-25
![Andrew Jeffree avatar](https://secure.gravatar.com/avatar/e799098b6ec60c96fc8e1d026c4059ce.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
@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-27
![Lakshmi Kallam avatar](https://secure.gravatar.com/avatar/8c3c9cfeaae038e7bc29765577c4aa9a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
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 avatar](https://secure.gravatar.com/avatar/8c3c9cfeaae038e7bc29765577c4aa9a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
any suggestions?
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
Use dynamic blocks
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
In CloudPosse GitHub, search for emr-cluster
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
It’s already in 0.12
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
Deployed it today, so should work :)
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster
![Lakshmi Kallam avatar](https://secure.gravatar.com/avatar/8c3c9cfeaae038e7bc29765577c4aa9a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
Thanks, Let me check that
![Lakshmi Kallam avatar](https://secure.gravatar.com/avatar/8c3c9cfeaae038e7bc29765577c4aa9a.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0003-72.png)
and the same thing applies for having multiple steps also?
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
var.bootstrap_action
is a list of objects (each representing a step)
![Andriy Knysh (Cloud Posse) avatar](https://avatars.slack-edge.com/2018-06-13/382332470551_54ed1a5d986e2068fd9c_72.jpg)
Terraform module to provision an Elastic MapReduce (EMR) cluster on AWS - cloudposse/terraform-aws-emr-cluster
2019-08-28
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
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 avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
I just can’t seem to nail this for_each thing in 0.12
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
NVM I gots it
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
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 avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
For reference
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
does terraform 0.12 supports MFA properly now ?
![Sharanya avatar](https://avatars.slack-edge.com/2019-08-28/730147904066_371d42477a79b1177fc2_72.jpg)
Did anyone Come across NPM memory Issues ?
2019-08-29
![maarten avatar](https://avatars.slack-edge.com/2020-09-28/1393040065826_b0d13cfde15deff02026_72.png)
@Sharanya How is that related to Terraform ? Please check out http://www.catb.org/~esr/faqs/smart-questions.html https://rurounijones.github.io/blog/2009/03/17/how-to-ask-for-help-on-irc/
How to ask for help properly on IRC so that you get responses faster. Also relevant to forums and mailing lists
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
@Erik Osterman (Cloud Posse) 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
Is it possible to dynamically select map variable, e.g? Currently I am doing this: vars.tf locals { map1 = { name1 = "foo" name2 = "bar" } } main.tf module "x1" { sour…
![oscar avatar](https://avatars.slack-edge.com/2019-08-22/729046633025_ec6984778c640b0e709e_72.jpg)
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 (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
ahk, i got it mixed up
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)
![Erik Osterman (Cloud Posse) avatar](https://secure.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0023-72.png)