Questions tagged [terraform]

For questions about Terraform, an open source tool to maintain infrastructure.

Filter by
Sorted by
Tagged with
0
votes
2answers
18 views

How can I find out when Terraform will support newly released AWS services?

For example, AWS announced their new "RDS Proxy" service at re:Invent 2019 and it is now in preview. How can I find out when/if Terraform will support this (for planning purposes)? https://aws.amazon....
0
votes
0answers
10 views

How to handle oauth2 in dynamic environments

We have a DevOps pipeline supporting 2 services with dynamic environments, where we use Terraform to provision each service independently. One of such services is an web API that can be accessed by ...
1
vote
1answer
18 views

How to create databases, users and grants with terraform mysql and output the created credentials?

For a new deployment I want to create databases, users and grants on a previous created MySQL database on azure. The following code used inside a module creates the environment as expected and I ...
1
vote
1answer
15 views

Having some trouble getting service running with Docker and Terraform

I'm very new to DevOps but I'm trying to learn some of it a bit. I'm working with Terraform, trying to get a service to run on AWS using Fargate and Docker. I've successfully set up my ECR ...
1
vote
1answer
25 views

How to set Terraform Cloud environment variables from the command line?

Terraform Cloud is a SaaS platform for managing Terraform runs, state and variables. Once you have created a project you can set environment variables via the following page: https://app.terraform....
0
votes
1answer
20 views

Unable to understand the logic behind this terraform function

So i was going through a code of some one else and just could not make sense of it,, if may be some can of this, "${replace(jsonencode(list(local.cadvisor_container_definition)), "/\"(\\d{2,5}|true|...
0
votes
1answer
24 views

Use Terraform to manage ssh-keys in GCE

I use Terrafrom and manage access to VMs in GCE by changing VM metadata. Before I put it to string, but it not good, so I try to put them to variable and use it. But I faced problem. This is my code: ...
1
vote
2answers
19 views

how long does it take to deploy a serverless function?

using any method - cli, serverless.com, terraform, roughly: how much time can i expect to pass between these two steps: submitting a new function to AWS (or azure or GCF), and having that function ...
0
votes
1answer
36 views

Where do I use Ansible and where is Terraform used? ( Strengths & Weaknesses) [closed]

What is Ansible mainly used for? Where do I use Terraform? This question focusses on where the tools have relative strengths or weaknesses. For example: Ansible for VM build and Software ...
1
vote
1answer
43 views

How do I enter a multi line variable in Terraform?

It's for the public key variable for testing lab enviroments in my variables.tf file I tried <<EOF the string EOF but terraform dosn't seem to like that
1
vote
1answer
24 views

Terraform creating single SG but multiple CIDR blocks

I am trying to use Terraform to create a single security group that will allow traffic for mongo on port 27017 from all my private subnets that are stored in a variable. My issue is I am unsure how ...
1
vote
2answers
77 views

Given a blank slate, tool recommendations? [closed]

so I have 8 months of DevOps experience previously working as a desktop engineer for two and a half years.Starting a new role in the education sector, recently they brought their IT department which ...
2
votes
1answer
30 views

How to specify specific subnet in Terraform when using for each

I am trying to create an ec2 instance that will hold my Jenkins server. I want this to be in a private subnet which I created using a for each loop. Below is my subnet for each loop and my ec2 ...
0
votes
0answers
15 views

Use an existing AWS VPC with Terraform?

I have a VPC that was created/and is managed in the AWS console. Not Terraform. I do not have permissions to alter this VPC. When creating a new Terraform EC2 instance I need that resource to use the ...
1
vote
1answer
25 views

Module directory modules/queues.tf does not exist or cannot be read

I am trying to setup terraform with modules and when doing terraform init after creating a module I have ran into an issue where I am told it does not exist or can't be read. I've checked many times ...
0
votes
0answers
8 views

How to grant the currently authenticated AzureAD Service Principal to a newly created Azure Key Vault?

When creating an Azure KeyVault instance in a subscription, we want to create an azurerm_key_vault_access_policy that grants the Service Principal that Terraform is authenticating as Set and Delete ...
0
votes
0answers
16 views

How do I detach an existing volume and attach a new volume using Terraform?

Is there a way to detach EBS volume from existing EC2 instance and attach a new EBS volume using Terraform ? I prefer to replace the volume rather than trying to destroy the instance and create a new ...
1
vote
1answer
16 views

How can I enable active tracing by default for an AWS Lambda function using Terraform?

On the console, there’s the option to enable active tracking for X-ray tracking but I can see this in the Terraform aws_lambda_function resource the aws_xray_sampling_rule resources? I'm currently ...
0
votes
0answers
43 views

Issue running terraform plan using Azure provider

I have the following terraform statement (see below), howeve I am unable to run terraform plan. Is this an account issue or a code issue? # Configure the Microsoft Azure Provider. #provider "azurerm" ...
3
votes
1answer
18 views

Provisioning a server on behalf of a user on GCP/AWS/Azure and probably relinquish access

I'd like to build a service where I run a custom setup script on behalf of a user on an t2.micro equivalent instance but be able to probably relinquish access to the server. Any advice on the tech ...
1
vote
1answer
33 views

How do I create multiple versions of a lambda function in terraform

I have it creating one version. It has latest and version 2 but can’t getting it to create more than one version of the same lambda? resource "aws_lambda_function" "lambda" { function_name = "test-...
5
votes
0answers
37 views

How Can I create layers for a lambda using Terraform?

The docs only seem to give me the option to reference existing layers. I want to make the layer for my lambda in my terraform code rather than through the console but can't see any option to do this ...
0
votes
1answer
25 views

Can Terraform pull down the newest state file by itself?

We started using Terraform to create VMs in some Cloud Providers. But we are a team with several people. Terraform has a state file. Whenever someone changes something via Terraform, ex.: ...
1
vote
1answer
25 views

can't access my instances by public IP in a VPC (aka: what is wrong with my terraform)?

As stated in the title of the question, I have a Terraform file (attached below), but the infrastructure it builds doesn't allow me to connect by SSH (I get "Connection timed out"). So either the ...
1
vote
1answer
72 views

How do I use only an encrypted version of my AWS RDS password in my terraform code?

Is there a way to only have an encrypted version of my RDS password in my Terraform code and for AWS to decrypt it for RDS so you use the decrypted password to login to the RDS? So set my rds ...
0
votes
0answers
109 views

Terraform error for API Gateway unable to add multiple aws_api_gateway_integration_response resources

I am trying to setup a gateway (PUT) Integration Response to handle different status responses from Firehose. All examples I can find use only one status response. If I add two ...
0
votes
0answers
42 views

Terraform giving provider issue error

I am using terraform's google GKE module but I am getting this weird error. Terraform code module "gke" { source = "terraform-google-modules/kubernetes-engine/google" version ...
0
votes
0answers
52 views

Terraform generates different plan for different subscription on Azure

Terraform 0.12.8|Azure Provider 1.33.1|Linux I have a network module as shown below- main.tf: resource "azurerm_virtual_network" "vnet" { name = "${var.vnet_name}" location ...
0
votes
0answers
12 views

Why my template disk is not being cloned?

I've been messing with Terraform for about 3 days but i encounter an issue that is really weird. I wanted to clone a template from a vCenter and deploy multiples VM from this template (something ...
0
votes
1answer
277 views

Terraform | Error “transport is closing” when “terraform apply” after upgrading to 0.12

Terraform v0.12.7 + provider.aws v2.25.0 + provider.null v2.1.2 + provider.template v2.1.2 Hello, when I try run terraform apply after upgrading to 0.12 I get error: module.elasticsearch.module.ec2....
0
votes
1answer
95 views

Create multiple S3 buckets at once

I am trying to create a static website using S3 buckets. I want to create a bucket for www and non-www versions. I can't work out how to create two buckets at once. I read that you can chain two ...
0
votes
1answer
274 views

Terraform | After upgrading to 0.12 receive a lots of error “unsupported value for ”%s“ at 0: string required.”

After upgrading to 0.12 I receive a lots of error like: Error: Error in function call on main.tf line 136, in data "template_file" "inventory": 136: formatlist( 137: 138: 139: 140: |...
0
votes
1answer
319 views

Terraform | Upgrade to 0.12 error Reference to “count” in non-counted context

I'm trying to upgrade terraform from 0.11 to 0.12 but receiving error: Error: Reference to "count" in non-counted context on main.tf line 33, in data "aws_subnet" "public": 33: id = data....
0
votes
1answer
31 views

How to probe all running aws ec2 instances and their sec groups, etc to generate templates?

Typically I spin up all aws ec2 instances together with all its accompanying security groups, volumes, etc ... by executing a series of aws cli commands. However when I manually use the aws console ...
1
vote
0answers
91 views

Terraform destroys and creates new AWS resources

Terraform destroys and creates new AWS resources when I modify the modules with new resources. I tried with: lifecycle { prevent_destroy = true } Getting the below error : the plan would ...
1
vote
2answers
35 views

Which Users Should I Create With Terraform And Which With Ansible?

I am creating some Ubuntu VMs in Azure with Terraform. I am then configuring the VMs with ansible. When terraform creates the VM it creates an admin user resource "azurerm_virtual_machine" "main" { ...
0
votes
1answer
307 views

Service account permissions error when provisioning instance group from template

I'm trying to create a GCE Instance Group Manager using terraform resource "google_compute_region_instance_group_manager" "frontend_group_manager" { name = "frontend-igm" base_instance_name = "...
1
vote
1answer
229 views

How to forcibly remove the resource created by the broken module?

I've created few dns_cname_record resources, however Terraform DNS provider started to throw the errors like: Error: update server is not set I've created the bug report for it, as it prevents me ...
1
vote
1answer
1k views

Terraform | The “count” object can be used only in “resource” and “data” blocks,

I'm trying to upgrade out Terraform seeing as 0.12 (stable) came out recently. I've ran into some issues with a certain pair of resource blocks. I'm getting the below error message when trying to do ...
0
votes
1answer
95 views

Terraform: Route53, LB and CDN interdependencies

My team uses Terraform to deploy the necessary infrastructure. Currently, our stack is composed of: AutoScalingGroup fronted by a Load-Balancer, and a Route53 DNS record that points to this LB; We ...
2
votes
0answers
16 views

How to manage the database in an environment per branch, creating a new instance per branch is the best approach?

I'm trying to create an environment per branch using Git lab CI, until here we're good. But my concern right now is how to manage the Database? I thought of using RDS and terraform, but what I'm ...
0
votes
1answer
105 views

GCE metadata not defined on Travis CI

I have tried initializing terraform code in Travis CI but an error keeps coming up; Failed to load state: Failed to open state file at gs://{{project_id}}/terraform/state/default.tfstate: Get ...
0
votes
0answers
13 views

Using the terraform github provider on an existing github organization

If I use the github provider in terraform on an existing github organization, do I need to write out each user and role within the .tf files or can the state be imported? What is the best approach ...
1
vote
1answer
45 views

How to override default aws region credentials for Terraform?

I am using Terraform to create aws resources. I practiced with a single region and with my aws cli credentials being used. worked great! however when I tried to override the region in the Terraform ....
-2
votes
1answer
315 views

Terraform aws_ecr_repository resource always attempts to destroy

I have been banging my head against this seemingly simple issue for awhile now. I have some Terraform code which sets up an ECR repository, policy and lifecycle policy. provider "aws" { region = "...
0
votes
0answers
21 views

How to query all resources of specific type in terraform?

How to get the list of all .public_ip that are assigned to AWS instances using Terraform? For example, I can query ip address for a single resource from terraform console > "${aws_instance.app....
0
votes
1answer
50 views

DevOps Newbie - How to automate windows infrastructure deployment?

DevOps newbie here, so bear with me. I have a project where infrastructure deployment and application deployment is done using powershell and it is tied to VMWare vCenter. For every client deployment,...
4
votes
2answers
945 views

Automate Helm's tiller installation with Terraform

I need to be able to generate disposable kubernetes environments using terraform. These environments should use helm for application deployment and ideally have tiller installed during the terraform ...
2
votes
3answers
1k views

Terraform - referencing existing security group

Is there a way I can associate existing security group to RDS that is going to be created or the only way is to recreate the security group so it can be added to the state file?
0
votes
1answer
93 views

Terraform: Provide credentials for docker hub registry

How would I provide docker hub credentials to a private image in the following example? data "docker_registry_image" "ubuntu" { name = "ubuntu:latest" } resource "docker_image" "ubuntu" { name ...