Skip to content

aws_bcmdataexports_export: Provider produced inconsistent result after apply: new element "INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY" has appeared. #42761

Open
@antonysouthworth-halter

Description

Terraform and AWS Provider Version

Terraform v1.12.1
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.98.0

Affected Resource(s) or Data Source(s)

  • aws_bcmdataexports_export

Expected Behavior

It should succeed (reprex provided in later section).

Actual Behavior

It does not succeed, get error below.

Relevant Error/Panic Output

│ Error: Provider produced inconsistent result after apply

│ When applying changes to aws_bcmdataexports_export.cur, provider
│ "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected
│ new value:
│ .export[0].data_query[0].table_configurations["COST_AND_USAGE_REPORT"]: new
│ element "INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY" has appeared.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Sample Terraform Configuration

Click to expand configuration
var "region" {
  default = "ap-southeast-2"
}

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.98.0"
    }
  }
  required_version = "~> 1.12.0"

  // backend "s3" {} // we are using S3 backend, don't think it should matter though
}

provider "aws" {
  region = var.region
}

resource "aws_bcmdataexports_export" "cur" {
  export {
    name        = "cur-test"
    description = "Full daily export of AWS CUR data."

    data_query {
      query_statement = local.bcm_query_stmt
      table_configurations = {
        COST_AND_USAGE_REPORT = {
          INCLUDE_RESOURCES                  = "TRUE"
          INCLUDE_SPLIT_COST_ALLOCATION_DATA = "FALSE"
          TIME_GRANULARITY                   = "DAILY"
        }
      }
    }

    destination_configurations {
      s3_destination {
        s3_bucket = aws_s3_bucket.bucket.bucket_name
        s3_prefix = "aws/cur/"
        s3_region = var.region
        s3_output_configurations {
          compression = "PARQUET"
          format      = "PARQUET"
          output_type = "CUSTOM"
          overwrite   = "OVERWRITE_REPORT"
        }
      }
    }

    refresh_cadence {
      frequency = "SYNCHRONOUS"
    }
  }
}

resource "aws_s3_bucket" "bucket" {
  bucket_name_prefix = "cur-test"
}

// NB: you would also need to set bucket policy correctly, this is omitted here for brevity

locals {
  bcm_query_stmt = <<EOF
SELECT bill_bill_type,
	bill_billing_entity,
	bill_billing_period_end_date,
	bill_billing_period_start_date,
	bill_invoice_id,
	bill_invoicing_entity,
	bill_payer_account_id,
	bill_payer_account_name,
	cost_category,
	discount,
	discount_bundled_discount,
	discount_total_discount,
	identity_line_item_id,
	identity_time_interval,
	line_item_availability_zone,
	line_item_blended_cost,
	line_item_blended_rate,
	line_item_currency_code,
	line_item_legal_entity,
	line_item_line_item_description,
	line_item_line_item_type,
	line_item_net_unblended_cost,
	line_item_net_unblended_rate,
	line_item_normalization_factor,
	line_item_normalized_usage_amount,
	line_item_operation,
	line_item_product_code,
	line_item_resource_id,
	line_item_tax_type,
	line_item_unblended_cost,
	line_item_unblended_rate,
	line_item_usage_account_id,
	line_item_usage_account_name,
	line_item_usage_amount,
	line_item_usage_end_date,
	line_item_usage_start_date,
	line_item_usage_type,
	pricing_currency,
	pricing_lease_contract_length,
	pricing_offering_class,
	pricing_public_on_demand_cost,
	pricing_public_on_demand_rate,
	pricing_purchase_option,
	pricing_rate_code,
	pricing_rate_id,
	pricing_term,
	pricing_unit,
	product,
	product_comment,
	product_fee_code,
	product_fee_description,
	product_from_location,
	product_from_location_type,
	product_from_region_code,
	product_instance_family,
	product_instance_type,
	product_instancesku,
	product_location,
	product_location_type,
	product_operation,
	product_pricing_unit,
	product_product_family,
	product_region_code,
	product_servicecode,
	product_sku,
	product_to_location,
	product_to_location_type,
	product_to_region_code,
	product_usagetype,
	reservation_amortized_upfront_cost_for_usage,
	reservation_amortized_upfront_fee_for_billing_period,
	reservation_availability_zone,
	reservation_effective_cost,
	reservation_end_time,
	reservation_modification_status,
	reservation_net_amortized_upfront_cost_for_usage,
	reservation_net_amortized_upfront_fee_for_billing_period,
	reservation_net_effective_cost,
	reservation_net_recurring_fee_for_usage,
	reservation_net_unused_amortized_upfront_fee_for_billing_period,
	reservation_net_unused_recurring_fee,
	reservation_net_upfront_value,
	reservation_normalized_units_per_reservation,
	reservation_number_of_reservations,
	reservation_recurring_fee_for_usage,
	reservation_reservation_a_r_n,
	reservation_start_time,
	reservation_subscription_id,
	reservation_total_reserved_normalized_units,
	reservation_total_reserved_units,
	reservation_units_per_reservation,
	reservation_unused_amortized_upfront_fee_for_billing_period,
	reservation_unused_normalized_unit_quantity,
	reservation_unused_quantity,
	reservation_unused_recurring_fee,
	reservation_upfront_value,
	resource_tags,
	savings_plan_amortized_upfront_commitment_for_billing_period,
	savings_plan_end_time,
	savings_plan_instance_type_family,
	savings_plan_net_amortized_upfront_commitment_for_billing_period,
	savings_plan_net_recurring_commitment_for_billing_period,
	savings_plan_net_savings_plan_effective_cost,
	savings_plan_offering_type,
	savings_plan_payment_option,
	savings_plan_purchase_term,
	savings_plan_recurring_commitment_for_billing_period,
	savings_plan_region,
	savings_plan_savings_plan_a_r_n,
	savings_plan_savings_plan_effective_cost,
	savings_plan_savings_plan_rate,
	savings_plan_start_time,
	savings_plan_total_commitment_to_date,
	savings_plan_used_commitment
FROM COST_AND_USAGE_REPORT
EOF
}

Steps to Reproduce

Attempt to apply the configuration.

Debug Logging

Click to expand log output

GenAI / LLM Assisted Development

n/a

Important Facts and References

No response

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/bcmdataexportsIssues and PRs that pertain to the bcmdataexports service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions