Skip to content

terraform/modules/vpc/vpc-flow-logs.tf line 28 The "region" parameter does not exist #1207

@hmrg2222

Description

@hmrg2222

Description

hi guys
my code can complete the whole process smoothly in the version before 6.0.0. The main reason for this upgrade is the problem of the historical version of provider helm in my configuration, which caused the verification of the relevant configuration of helm block to fail. I upgraded the helm provider version, and when I re-executed terraform plan && terraform apply -auto-approve, I quickly found an error. Since I did not specify the version number of the module, according to the output, I found that the module was also upgraded recently. I wonder if it was caused by this upgrade?

│ Error: Unsupported attribute
│ 
│   on .terraform/modules/vpc/vpc-flow-logs.tf line 28, in locals:
│   28:     "arn:${data.aws_partition.current[0].partition}:logs:${data.aws_region.current[0].region}:${data.aws_caller_identity.current[0].account_id}:log-group:${log_group.name}:*"
│ 
│ This object has no argument, nested block, or exported attribute named
│ "region".
╵

Versions

  • Module version [Required]: 6.0.0
- Terraform version:
Terraform v1.12.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v5.100.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.7
+ provider registry.terraform.io/hashicorp/helm v3.0.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.37.1
+ provider registry.terraform.io/hashicorp/null v3.2.4
+ provider registry.terraform.io/hashicorp/time v0.13.1
+ provider registry.terraform.io/hashicorp/tls v4.1.0

Your version of Terraform is out of date! The latest version
is 1.12.2. You can update by downloading from https://developer.hashicorp.com/terraform/install
- Provider version(s):
Terraform v1.12.0
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v5.100.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.3.7
+ provider registry.terraform.io/hashicorp/helm v3.0.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.37.1
+ provider registry.terraform.io/hashicorp/null v3.2.4
+ provider registry.terraform.io/hashicorp/time v0.13.1
+ provider registry.terraform.io/hashicorp/tls v4.1.0

Your version of Terraform is out of date! The latest version
is 1.12.2. You can update by downloading from https://developer.hashicorp.com/terraform/install

Reproduction Code [Required]

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "test-vpc"
  cidr = "10.0.0.0/16"

  create_vpc = true
  azs             = ["us-east-1a", "us-east-1b", "us-east-1c"]
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]

  enable_nat_gateway = true
  enable_vpn_gateway = true
  single_nat_gateway = true
  public_subnet_tags = {
    "kubernetes.io/role/elb" = 1
    "kubernetes.io/cluster/${var.cluster_name}"  = "shared"
  }

  private_subnet_tags = {
    "kubernetes.io/role/internal-elb" = 1
    "kubernetes.io/cluster/${var.cluster_name}"  = "shared"
  }

  flow_log_file_format = "parquet"

  tags = {
    Terraform = "true"
    Environment = "prod"
  }

Steps to reproduce the behavior:

terraform plan && terraform apply -auto-approve

Expected behavior

Complete deployment execution

Actual behavior

After terraform completes initialization, this error will pop up soon

Terminal Output Screenshot(s)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions