Questions tagged [terraform]
For questions about Terraform, an open source tool to maintain infrastructure.
313
questions
0
votes
0
answers
23
views
How to set database cluster arguments (like password) with terraform?
I deploy a digitalocean_database_cluster with Terraform. It's working and I can connect to it with the username and password that Terraform generates in .tfstate
I want to set a concrete username, ...
0
votes
1
answer
71
views
Key Vault managed stored account encryption permissions denied
Trying to amend an existing storage account to add Customer-Managed-Key Rotation to it, using key vault, as per the docs from Terraform and MS.
Looks like we've done everything right, but we're just ...
1
vote
2
answers
128
views
How To Convert Jenkins String Parameter To Terraform Map Variable? (Invalid number literal)
Edit (8/16/2023): I figured it out!
I'm trying to pass string parameter(s) to a Terraform map variable, but receiving error "Invalid number literal".
Jenkinsfile:
pipeline {
agent any
...
0
votes
1
answer
35
views
terraform remote state bucket on s3
I want to use a remote state bucket on s3 for my terraform tfstate files (described here: https://developer.hashicorp.com/terraform/language/settings/backends/s3). It looks pretty basic, but in ...
0
votes
1
answer
29
views
How to pass terraform locals variables into AWS resource template body
I am trying to apply aws conformance pack to my aws account using terraform. I am using the sample aws config rules in cloudformation syntax provided in the awslabs repository.
Now from an example ...
0
votes
0
answers
23
views
Error creating GCP notebook: Error waiting for Creating Instance: Error code 12, message: GCE unexpected error: RPC::UNREACHABLE: EOF
I'm trying to create a managed notebook for Google Cloud Vertex AI, and the application of the terraform template fails with:
Plan: 1 to add, 0 to change, 0 to destroy.
google_notebooks_instance....
0
votes
1
answer
67
views
& (ampersand) in Terraform string or/and AWS IAM policy
I coudn't find meaning of & sign in Terraform or/and AWS IAM policy. There is an example in Data Source: aws_iam_policy_document (docs) where you can see Basic Example (docs, github source):
data &...
1
vote
1
answer
58
views
Is terraform good option for data management
I have complex stack which consists of infrastructure, application and config parts, which are deployed to datacenters around the world. We have custom inhouse configuration system, based on database ...
0
votes
0
answers
158
views
Import to non-existent module error from Terraform
I have this module in my code and I am trying to import the existing APIM to state.
module apim {
source = "source"
environment = var.environment
prefix ...
0
votes
0
answers
48
views
SSH Keys not propagating correctly from instance metadata to authorized_keys: missing keys, user discrepancy, and duplicate key
I want to add eight public keys via instance metadata to avoid adding them manually (i.e.: ssh to VMs, pasting the keys to .ssh/authorized_keys, etc.).
I added the keys in Terraform (four distinct ...
0
votes
0
answers
37
views
Inject configuration from Terraform into Kubernetes without hardcoding
I have a pretty simple setup:
An AWS DocumentDB managed using Terraform
A container running on EKS, managed in a Flux (GitOps) repository
The container needs to access the DocumentDB, so somehow I ...
3
votes
3
answers
205
views
Should I use multiple Terraform projects or only one?
I am starting to build a Terraform GIT project to build resources for azure.
Currently my idea is to have a project that is taking care of identity and access topics & to have a project that is ...
0
votes
1
answer
90
views
Configure Azure Terraform provider to only allow SSH access to my current IP address
After following this quick start guide https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-terraform, running lastb on the provisioned host shows login attempts from many IP ...
0
votes
0
answers
119
views
Terraform GCP "API has not been used in project" for the wrong project
I'm trying to create a google_kms_key_ring in project b89d. When I run terraform apply, I can see the google_kms_key_ring project field is set to the project I want:
+ resource "...
0
votes
2
answers
48
views
Is there a way to migrate from HCL with the Terraform provider to YAML?
Currently I have a deployment of an applicationn done with HCL in Terraform. Is it possible to have the terraform provider for Kubernetes output to a directory or in some form the YAML that it is ...
0
votes
0
answers
37
views
EFS is getting unmounted from lambda when there is an update to efs
I have created EFS, and mounted this on lambda using terraform. It works, but when there is an update in EFS, then EFS gets unmounted.
I need terraform to detect this update and automatically mount it ...
0
votes
0
answers
420
views
Terraform - No Infrastructure Changes Detected
I have deployed a Cloudwatch Log Group community module to my terraform stack (sourced from https://github.com/cloudposse/terraform-aws-components) but I have spent more than a day trying to resolve ...
0
votes
0
answers
164
views
How to edit a GitLab managed Terraform state file?
I seem to have encountered a long-standing Terraform issue, where I have attempted to create an AWS RDS Cluster without having specified skip_final_snapshot = true,
however any attempt to extricate ...
0
votes
0
answers
45
views
How to retrieve required values from a kubeconfig file from AKS and give as values in a terraform script?
I'm trying to automate the creation of infrastructure - azurerm_container_registry, azurerm_kubernetes_cluster, azurerm_role_assignment (to pull the image from ACR) using one terraform script and in ...
0
votes
0
answers
279
views
Error When Importing to a for_each Resource
I'm trying to import multiple AWS IAM policies and IAM roles to my tfstate files using a shell script to automate the import mechanism. It works fine when I was trying to import the IAM roles, but ...
0
votes
0
answers
70
views
Is there a way to automate service principal connections for ACR and AKS (in azure portal) from Azure Devops ? or can we acheive this with a pipeline?
Here, I'm trying to create ACR and AKS (in azure portal) with terraform tasks in azure devops pipeline and right after creating these resources I'm trying to add "deploy into AKS" task in ...
1
vote
0
answers
289
views
Terraform init too slow on installing hashicorp/aws
It takes a few minutes to install the following provider but installs modules and other providers quickly. There is an open issue on GitHub for this but no steps for troubleshooting.
Installing ...
2
votes
2
answers
1k
views
Terraform kubernetes_manifest: forbidden: User "system:anonymous" cannot get path "/apis"
Getting the following error with Terraform
forbidden: User "system:anonymous" cannot get path "/apis"
In context,
│ Error: Invalid configuration for API client
│
│ with acme....
2
votes
1
answer
235
views
Terraform error: Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module
Is there anyway to find out what triggers a message like this,
Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module and ...
1
vote
0
answers
33
views
How can I point Cloud Run to my latest container image when its path changes based on version?
I am trying to model continuous deployment infrastructure in Terraform.
The problem I have is Cloud Run requires a path to the container image, and that image's path changes based on its 'version'.
...
0
votes
0
answers
19
views
How do I provide my app with a service account key to access a GCP bucket?
I'm experimenting with terraform and GCP at the moment. For now I want to run a ruby project locally that have access to a bucket. For that I supposedly need a service account and a key. terraform ...
0
votes
2
answers
443
views
Can terraform re-create a vm that was manually deleted
I have a terraform managed infrastructure with a set of 4 virtually identical VMs. One of them has been deleted in VSphere by mistake. I had expected terraform refresh to re-create it, but I ...
1
vote
0
answers
332
views
Triggering local-exec provisioner on resource change
We're needing to run a 3rd party python script to do some testing/validation on RDS resources provisioned by terraform.
We use Terraform Enterprise where the runtime environment is simplistic and ...
0
votes
0
answers
75
views
subnet_arn for datasync location using Terraform vpc module?
In Terraform, I'm trying to define a datasync location for syncing files from S3 -> EFS. I'm new to Terraform and using the terraform-aws-modules/vpc/aws module[1] to help me get started so I ...
0
votes
1
answer
408
views
Terraform's OpenStack provider: Error: One of 'auth_url` or 'cloud` must be specified
When I run terraform apply (but not terraform validate) I get the following error,
Error: Invalid provider configuration
Provider "registry.terraform.io/terraform-provider-openstack/openstack&...
0
votes
2
answers
2k
views
How can I read a file if it exists, but if it doesn't do not throw a fatal error?
Terraform give us the ability to a read a local file, which has a secret..
data "local_sensitive_file" "foo" {
filename = "/tmp/foo"
}
But, what is the right way to ...
3
votes
2
answers
4k
views
How do I find out the attributes of a terraform object?
I'm creating a Terraform file, and something is obviously wrong,
Error: Incorrect condition type
on ssh.tf line 47, in locals:
47: is_generated = data.local_sensitive_file.public_key ? true : ...
0
votes
1
answer
220
views
Is there a way to pass secrets in cloud-init using Terraform?
Cloud-init has the ability to compliment Terraform in configuring the Virtual Machine it just created. My problem is that cloud-init as uploaded through user-data means that the script especially if ...
0
votes
1
answer
20
views
Does OpenStack meta data carry the remote-exec provisioner stanza?
I have a Terraform HCL file with a remote-exec provisioner that looks like this..
resource "openstack_compute_instance_v2" "sandboxvm" {
provisioner "remote-exec" {
...
4
votes
1
answer
3k
views
Getting "(sensitive value)" from `terraform state show`, how can I uncensor the value?
When I run I try to use terraform state show on variables flagged sensitive on some addresses I get
private_data = (sensitive value)
How can I get around this problem?
0
votes
2
answers
479
views
How can I use non-TF environmental variables in Terraform?
Let's say I want to read $HOME in Terraform. I could create a variable called HOME and set it with TF_HOME, ie.,
TF_HOME=$HOME terraform apply
But is there a way to read $HOME directly in Terraform?
...
0
votes
1
answer
447
views
When running terraform from Gitlab CI, terraform asks me for the "The address of the REST endpoint"
When I run terraform apply using the Terraform files in my GitLab CI Pipeline (I didn't write them) I get the following,
Initializing the backend...
address
The address of the REST endpoint
Can ...
0
votes
1
answer
172
views
How can I get my clouds.yaml file from OpenStack Horizons?
OpenStack can export a configuration file called clouds.yaml. How do I export this file from the Horizon's interface?
0
votes
1
answer
99
views
How can I configure OpenStack authentication for Terraform?
I want to use some company terraform files. They all rely on authentication to OpenStack which is the resource they're provisioning from. How can I configure this?
0
votes
0
answers
246
views
Terraform & Helm & aws-load-balancer-controller : ALB won't be created
I try to deploy a complete cluster using EKS. When I run terraform apply the command completes successfully. I can see that my configured Pods, Deployments, Services were created. I also see the ...
2
votes
1
answer
1k
views
conditionals in module providers meta-argument
I am provisioning a bunch of resources via a module.
module "test" {
source = "../modules/my-module"
vpc_id = module.vpc.vpc_id
subnet_ids = module.subnets.ids
}
Now, in ...
0
votes
0
answers
741
views
AWS EKS Kubernetes cluster unreachable: dial tcp Timeout
I configured EKS Cluster with Terraform, and used Helm to deploy ingress.
When I try to apply my Terraform configuration, it fails to create the ingress software because it fails to connect the EKS ...
0
votes
1
answer
279
views
How to enable ContainerInsights (setting) on an ECS cluster created from a Batch compute environment using Terraform?
I have an AWS Batch compute environment defined in my Terraform files. The creation of the compute environment creates an ECS Cluster, where the containers are being run.
The issue I have with ...
0
votes
1
answer
433
views
How can I set a Route53 record as an alias for EKS load balancer?
I set an EKS cluster using Terraform. I try to set Route53 record to map my domain name, to the load balancer of my cluster.
I set my EKS cluster:
resource "aws_eks_cluster" "main" ...
2
votes
1
answer
319
views
Is it possible to create a tls kubernetes secret using Azure Key Vault data resources in Terraform?
I have a certificate file and a private key file that I am using to implement tls encrypted traffic for several different k8s pods running under an NGINX ingress load balancer. This works fine (i.e. ...
1
vote
1
answer
2k
views
Does AWS CloudFront work with a Network Load Balancer?
I am aware that it is straightforward to use AWS CloudFront with an AWS Application Load Balancer (Layer 7) origin (using a certificate in each for E2E encryption). However, is it possible to use AWS ...
0
votes
0
answers
71
views
Automating AWS Cloud resources provisioning for laravel multi-tenant app
I have a Laravel web application, that is a school management system.
Currently I am using Heroku to host the application, but I now want migrate to AWS for cloud hosting.
I want to be able to create ...
3
votes
2
answers
535
views
What is the best way to install ArgoCD as code?
Working on getting a full deployment pipeline set up using GitOps and Everything as Code. I, therefore, need to be able to spin everything up and down with a single click (or pretty close to it!). My ...
1
vote
1
answer
992
views
Error: a number is required
I'm in the process of upgrading our version of the Terraform AWS Provider and after fixing/updating every resource and data source which has been deprecated/changed between versions (3.75.2 -> 4.0....
1
vote
1
answer
135
views
Where can I find GitHub's key id to import key for github_repository_deploy_key resource?
I've added GitHub Deploy key manually. Now I would likt to import it to my state. But when I look into github_repository_deploy_key resource docs I can read
"Repository deploy keys can be ...