Questions tagged [terraform]

Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.

Filter by
Sorted by
Tagged with
0
votes
0answers
40 views

how to use sed with variable when special characters in variable?

I want to use sed with variables. But my variable is changeable and unknown by us and maybe my string has got some special characters. My concern is if these special characters are the quotes like ' ...
1
vote
1answer
21 views

Downloading Terraform onto linux OCI VM

I am currently trying to play around with some tf scripting in an OCI compartment I have access to. My current position is: I have successfully spun up a VM through the OCI console running Linux 8 on ...
0
votes
0answers
21 views

Why does terraform init keep installing the same modules over and over

I am afraid this is kind of a stupid question, but I cannot find any clear answer on this. Whenever I run terraform init in my project it keeps installing all the plugins on every run even if nothing ...
1
vote
0answers
136 views

Terraform nested maps for_each

I have created this terraform variable. variable "test" { default = { map1 = { secrets = { "user" = "user" "pass" = "123456&...
0
votes
2answers
2k views

Terraform: Interate over map and access child values

I have a terraform variable defined like that: variable "domains" { default = { instance01 = [ "example.com", "www.example.com", "staging....
0
votes
0answers
53 views

Terraform AWS - cannot connect to EC2 instance (SSH port is not accessible from outside)

I am trying to build myself an small EC2 instance that is being launched into an VPC with EIB and a Subnet / Internet Gateway and Security Groups. main.tf resource "aws_instance" "live&...
0
votes
1answer
53 views

Terraform - huaweicloudstack provider - unable to login with ssh key

With the help of terraform and huaweicloudstack provider I created ECS instance with specific ssh key, but I cannot login nor with key, neither with admin password. If I create machine manually ...
0
votes
2answers
133 views

less -R does not show colors when processing ANSI colored text via a pipe

The command terraform show does NOT show colored text but the command terraform show | less shows output with what seem to be text color codes: ESC[0m#module.vpc.module.label.data.null_data_source....
0
votes
1answer
184 views

What is the proper syntax to access attribute (public_ip) of a resource (aws_instance) with count from another resource (null_resource)

I am new to terraform and this issue is perhaps addressed earlier. Unfortunately, I am not able to find one. Question: What is the proper syntax to access attribute (public_ip) of a resource (...
0
votes
0answers
54 views

terraform init command failing on authorization

Terraform init is failing on authenticating. I have manually specified access key, etc in the vars file as specified below. When I am looking at terraform init log, it is erroring out on different ...
0
votes
0answers
491 views

Not able to run terraform from jenkins

I am trying to run a terraform command from jenkins pipeline but I am getting an error stating that, "terraform command not found". I have installed terraform plugins as well as in the system where ...
0
votes
0answers
1k views

Terraform-Nested Maps and Lists

Terraform version: Terraform v0.12.10 OS version: Red Hat Enterprise Linux Server release 7.6 (Maipo) When I use nested maps to create multiple ebs_volumes and trying to delete intermediate volume, ...
1
vote
1answer
249 views

Hashicorp Vault PKI Intermediate request missing private key

I try to set up some PKI structure, but when I request an intermediate CSR from vault, no private key is sent back. Neither in Terraform where I try to implement it, nor via the API. I tried: The ...
0
votes
1answer
514 views

Authenticate Terraform with Okta

The company I work for uses a legacy login from okta for AWS. Thus, in order to use the aws-cli, the aws-okta utility is needed, which requires okta MFA before running any aws-cli command. I'm ...
1
vote
0answers
759 views

to create a tomcat server by terraform code [closed]

provider"aws" { access_key = "AKIAJ7STPAZVP4ZT74HQ" secret_key = "YRxdYqpOLDRCnPcKMBTL0dCSTFGILdd0brw2LlWq" region = "us-east-1" } resource "aws_instance" "example" { ami = "ami-...
0
votes
1answer
127 views

Install issue with Terraform on centos 7

Whenever I run a terraform install on linux using: wget https://releases.hashicorp.com/terraform/0.11.14/terraform_0.11.14_linux_amd64.zip sudo unzip ./terraform_0.11.13_linux_amd64.zip sudo mv ...
1
vote
0answers
268 views

Terraform with tflint in VSCode [closed]

I've found some issues with tflint parsing some values when I try to access data in some maps. First of all, I create aws_health_check with count set to 2. Then, I create aws_dns record, with same ...
0
votes
0answers
125 views

random_pet in Terraform: Error: Cycle:

I am trying to generate random hostnames for a couple of servers. However when running terraform apply I get an error message "Error: Cycle: random_pet.swm01_managers, hcloud_server.swm01_managers" ...
1
vote
3answers
4k views

How to uninstall terraform - Windows PC

I've been looking around on multiple sites on "how to uninstall Hashicorp's Terraform" and I only get back - "Install" results. Does anyone have info on this? I did look on Hashicorps' site but ...
2
votes
0answers
675 views

terraform - remote backend. Error locking state: error acquiring the state lock: resource not found

ill start off by saying I am fairly new to using Terraform so if this is a dumb question I apologize in advanced. So, I am getting the error listed in the title when attempting to run any "terraform ...
0
votes
1answer
341 views

How to add existing role to existing ec2 instance using terraform?

I am running following code but getting exit status 255 error My resource.tf file resource "null_resource" "create-instance-profile" { provisioner "local-exec" { command = "aws iam create-...
0
votes
0answers
249 views

Join a VM to domain automatically which was created using terraform

How do I join a VM created using terraform to domain? I tried using resource azurerm_virtual_machine_extension with azure,VM got created successfully but domain joining dint happen. Error:Code="...
1
vote
0answers
60 views

Terraform , need help to import existing ressource to a module ressource

I would like to import an existing resource into my module. This is my "old" vpc file: https://pastebin.com/DVsacfwt My new one using the terraform registry vpc module: https://pastebin.com/KDrA0Db3 ...
1
vote
1answer
2k views

Terraform AWS Security Group Ingress Rules

How do you define multiple Ingress rules in an AWS Security Group with Terraform? I've tried this: resource "aws_security_group" "sg_allowall" { name = "${var.prefix}-allow" ingress { ...
1
vote
3answers
3k views

how to install terraform on linux

I'm trying to install terraform on linux but getting and error curl -o https://releases.hashicorp.com/terraform/0.11.2/terraform_0.11.2_linux_amd64.zip its giving error as curl: no URL specified! ...
2
votes
1answer
683 views

Connect to Azure machine via public ip from terraform

I successfull made the virtual machine in Azure with Terraform ( from a Packer image). After the Virtual machine created, I would run some commands remotely on the newly created machine. The machine ...