Hello everybody!!
Im trying to adjust gitlab to work with tf cloud and facing with issue.
After push in Gitlab repository the plan in terraform cloud dont pass because it dont see “schema found for local_file”
I tried to change version in tf cloud. It works with 1.0… but when i choose this version it shows wrong changing state (everything destroy). And from 1.1 to 1.2 version it doesnt work. What i can do to pass this plan check in right way?
Actual terraform version 1.2.4
Can anybody help with it?
Hi @s.kuzakov,
I think this question will be easier to answer by someone who can see your configuration and your workspace settings. For that reason, I would recommend contacting HashiCorp Support for help with this question, since they will be able to work with you to review how your workspace is configured and what you’ve written in your configuration.
Participants in this forum can only offer general help with specific code examples, because we can’t access your code or your workspace settings.
Thanks!
Thank u for your advise but i’ve already tried to create bug report tf-cloud@hashicorp.support · Issue #31413 · hashicorp/terraform · GitHub. And James Bardin forwarded me to visit this forum to find solving my issue. So, maybe next information will be useful.
terraform {
required_providers {
local = {
source = "hashicorp/local"
version = "2.2.3"
}
aws = {
source = "hashicorp/aws"
version = "~> 4.17"
}
}
required_version = ">= 1.2.4"
}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.region}"
}
terraform {
backend "remote" {
organization = "xxxxxxx"
workspaces {
name = "xxxxxxxx"
}
}
}
resource "aws_instance" "instance" {
ami = var.ami
instance_type = var.instance_type
key_name = var.key_name
monitoring = true
vpc_security_group_ids = [aws_security_group.ec2_security_group.id]
subnet_id = var.subnet_id
associate_public_ip_address = true
tags = {
Terraform = "true"
Environment = var.instance_tag
Name = var.instance_name
}
root_block_device {
volume_type = "gp2"
volume_size = var.root_volume_size
delete_on_termination = "true"
}
data "aws_instance" "id" {
instance_id = aws_instance.instance.id
}
data "template_file" "inventory" {
template = file("${var.path_tmpl}/template.tftpl")
vars = {
ip_adr = aws_instance.instance.public_ip
private_key = "${var.path_module}/xxxxxxxxx.pem"
user = var.user
}
}
resource "local_file" "inventory" {
filename = "${var.path_inventory_file}/hosts.yml"
content = join("",data.template_file.inventory.*.rendered)
}