Skip to content

[Bug]: Optional block encryption_configuration in aws_sfn_state_machine is marked as unexpected #40746

Closed
@sleepypower

Description

Terraform Core Version

1.10.3 darwin_arm64

AWS Provider Version

5.50.0

Affected Resource(s)

aws_sfn_state_machine

Expected Behavior

Create/Update state machine with encryption_configuration block after running terraform init, terraform apply

Actual Behavior

After running terraform apply, terraform returns Error: Unsupported block type

Relevant Error/Panic Output Snippet

│ Error: Unsupported block type
│ 
│   on ../../../../../modules/step-functions/v1.0/main.tf line 21, in resource "aws_sfn_state_machine" "sfn_state_machine":
│   21:   dynamic "encryption_configuration" {
│ 
│ Blocks of type "encryption_configuration" are not expected here.

Terraform Configuration Files

resource "aws_sfn_state_machine" "sfn_state_machine" {
  name     = var.name
  role_arn = var.role_arn
  type     = var.type
  publish  = var.publish
  tags     = var.tags

  // Step function code definition
  definition = var.definition

  dynamic "logging_configuration" {
    for_each = var.logging_configuration != null ? [var.logging_configuration] : []

    content {
      include_execution_data = logging_configuration.value.include_execution_data
      level                  = logging_configuration.value.execution_log_level
      log_destination        = logging_configuration.value.log_destination_arn
    }
  }

  dynamic "encryption_configuration" {
    for_each = var.encryption_configuration != null ? [var.encryption_configuration] : []

    content {
      kms_data_key_reuse_period_seconds = var.encryption_configuration.kms_data_key_reuse_period_seconds
      kms_key_id                        = var.encryption_configuration.kms_key_id
      type                              = var.encryption_configuration.type
    }
  }

  tracing_configuration {
    enabled = var.enable_xray_tracing
  }
}

Provider

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.50.0"
    }
  }
}

provider "aws" {
  region = var.region
}

locals {
  tags = {
    Product     = var.product
    Service     = var.service
    Environment = var.profile
  }
}

Steps to Reproduce

Run terraform init
Run terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sfn_state_machine#encryption_configuration-configuration-block

Would you like to implement a fix?

No

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/sfnIssues and PRs that pertain to the sfn service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions