hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.7k stars 9.07k forks source link

[Bug]: module.pipeline.module.glue_table_t_sets.aws_glue_catalog_table.aws_glue_catalog_table: Creating #29108

Open safetylab opened 1 year ago

safetylab commented 1 year ago

Terraform Core Version

1.3.7

AWS Provider Version

4.51.0

Affected Resource(s)

aws_glue_catalog_table

Expected Behavior

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to module.pipeline.module.glue_table_t_sets.aws_glue_catalog_table.aws_glue_catalog_table, provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an
│ unexpected new value: Root resource was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵

Actual Behavior

data "aws_s3_bucket" "gov" {
  bucket = "${module.s3_out.s3_bucket_id}"
}

resource "aws_lakeformation_resource" "gov" {
  arn = data.aws_s3_bucket.gov.arn
}
resource "aws_glue_catalog_table" "aws_glue_catalog_table" {
  name          = var.glue_table_name
  database_name = var.glue_name

  #table_type = "EXTERNAL_TABLE"
  table_type = "GOVERNED"
  parameters = {
    EXTERNAL                  = "TRUE"
    "parquet.compression"     = var.classification == "orc" ? "SNAPPY" : ""
    "compressionType"         = var.compression_type
    "classification"          = var.classification
    "projection.enabled"      = var.athena_projection_enabled ? "true" : "false"
    "projection.hour.digits"  = "2"
    "projection.hour.range"   = "01,24"
    "projection.hour.type"    = "integer"
    "projection.day.digits"   = "2"
    "projection.day.range"    = "01,31"
    "projection.day.type"     = "integer"
    "projection.month.digits" = "2"
    "projection.month.range"  = "01,12"
    "projection.month.type"   = "integer"
    "projection.year.digits"  = "4"
    "projection.year.range"   = "2020,2099"
    "projection.year.type"    = "integer"
  }
  partition_keys {
    name = "year"
    type = "bigint"
  }
  partition_keys {
    name = "month"
    type = "bigint"
  }
  partition_keys {
    name = "day"
    type = "bigint"
  }
  partition_keys {
    name = "hour"
    type = "bigint"
  }
  storage_descriptor {
    location      = var.table_storage_location
    input_format  = var.input_format
    output_format = var.output_format
    compressed    = true

    ser_de_info {
      name                  = var.glue_table_name
      serialization_library = var.serialization_library
      parameters = {
        "serialization.format" = 1
      }
    }

    dynamic "columns" {
      for_each = var.groups

      content {
        name = columns.value.name
        type = columns.value.type
      }
    }
  }
}

Relevant Error/Panic Output Snippet

1 of 5 installations give error - please check and fix - this is problem only if I set table_type = "GOVERNED"

Terraform Configuration Files

how can i get it?

Steps to Reproduce

I send you code - just run it

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue