#terragrunt - July 2020

terragruntArchived
15 messages

Terragrunt discussions
Archive: https://archive.sweetops.com/terragrunt/

Josh Hudson
Josh Hudsonover 6 years ago
Has anyone tried using terragrunt with tf 0.13.x? I'm curious how the module count/each will incorporate w/ terragrunt's wrapping of tf modules.
Adrian
Adrianover 6 years ago
I’ve got Error: No valid credential sources found for AWS Provider. from yestarday, anyone else has that problem?
joshmyers
joshmyersover 6 years ago
Nope.
joshmyers
joshmyersover 6 years ago
Ah, you didn’t mention Terraform cloud. Not using that.
Adrian
Adrianover 6 years ago
downgrading aws.provider from 2.70 to 2.69 solve the issue
# Generate an AWS provider block
generate "provider" {
  path      = "provider.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
provider "aws" {
  region  = "${local.vars.aws_region}"
  profile = "${local.aws_profile}"
  version = "<= 2.69"
  # Only these AWS Account IDs may be operated on by this template
  # allowed_account_ids = ["${local.vars.aws_account_id}"]
}
EOF
}
Adrian
Adrianover 6 years ago
and I’m using local terraform/terragrunt setup
Somnath
Somnathover 6 years ago
@Somnath has joined the channel
jason einon
jason einonover 6 years ago
hey all, just starting the journey with terragrunt, I have a look around, however cant find any great example repo’s that are using gcp and have a gcs as the backend, anyone have any good examples to share?
Milosb
Milosbover 6 years ago
Do you find it difficult to search through official terragrunt documentation 🙂? When it was on git I could just ctrl+f easily, and find what I need in second.
jason einon
jason einonover 6 years ago
yes this is the resource i used 🙂
jason einon
jason einonover 6 years ago
back again 👋 I’m trying to get a clean way to pass in a project var into the provider, as im splitting out my infrastructure across projects.
jason einon
jason einonover 6 years ago
has anyone done this before… this is in google cloud btw
jason einon
jason einonover 6 years ago
this is what i currently have
generate "provider" {
  path      = "provider.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
  provider "google" {
  credentials = "account.json"
  region      = "europe-west2"
  project  = ${gcp_project}
}
EOF
}

remote_state {
  backend = "gcs"
  config = {
    project  = "${gcp_project}"
    location = "eu"
    bucket   = "bucket_name"
    prefix   = "${path_relative_to_include()}/terraform.tfstate"
    credentials = "account.json"


    gcs_bucket_labels = {
      owner = "terragrunt_test"
      name  = "terraform_state_storage"
    }
  }
    generate = {
    path      = "backend.tf"
    if_exists = "overwrite_terragrunt"
  }
}

jason einon
jason einonover 6 years ago
error is allong these lines
terragrunt-gcp-infra/terragrunt.hcl:33,19-30: Unknown variable; There is no variable named "gcp_project"., and 2 other diagnostic(s)