Relative Content

Tag Archive for terraformterraform-provider-aws

Conditional resource creation in terraform

I’m new to Terraform, having recently transitioned from CloudFormation. The resources for my service were initially created using CloudFormation but are now managed by Terraform.

Terraform Import of EBS Volumes Not Reflecting in State

I’m trying to move an EC2 instance from one module to another using Terraform. This EC2 instance has EBS volumes attached to it. When I run terraform import on an EBS volume, Terraform does not actually import it. Here’s what I get (in this example, I left the resource ID blank):

Terraform: Merge two tuples/lists to create a map

I’m new to Terraform and I would like to know how can create a map from two lists/tuples. To put the question in context, I’ve a variable which holds the subnet IDs and another variable which holds the availability zone IDs for the subnets. Now I want a variable ( map of Zone ID to Subnet ID ) which will create the below result: