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.78k stars 9.13k forks source link

[Bug]: aws_transfer_workflow does not save state for copy_step_details #29965

Open rdbraber opened 1 year ago

rdbraber commented 1 year ago

Terraform Core Version

1.3.3

AWS Provider Version

4.57.1

Affected Resource(s)

aws_transfer_workflow

Expected Behavior

When creating copy_step_details, those steps should be kept in state.

Actual Behavior

The state for the the copy_step_details is empty. Also when trying to import a workflow that was created in the AWS console, which contains copy steps, the copy_step_details are empty.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

// Provider configuration
terraform {
  required_version = "1.3.3"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.57.1"
    }
  }
}

provider "aws" {
  region = "eu-central-1"
}

resource "aws_s3_bucket" "example_bucket" {
  acl = "private"
  versioning {
    enabled = false
  }
  bucket_prefix = "aws-transfer-workflow"
}

resource "aws_transfer_workflow" "example_workflow" {
  description = "example workflow"
  steps {
    copy_step_details {
      name                 = "backup"
      source_file_location = "$${original.file}"
      overwrite_existing   = "TRUE"
      destination_file_location {
        s3_file_location {
          key    = "home/$${transfer:UserName}/$${transfer:UploadDate}/"
          bucket = aws_s3_bucket.example_bucket.id
        }
      }
    }
    type = "COPY"
  }
}

Steps to Reproduce

After running terraform init and terraform apply, the part of the aws_transfer_workflow in the state file looks like:

{
  "version": 4,
  "terraform_version": "1.3.3",
  "serial": 7,
  "lineage": "9377fd64-8301-68cc-5452-569194faf32d",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "aws_transfer_workflow",
      "name": "example_workflow",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "arn": "arn:aws:transfer:eu-central-1:XXXXXXXXXXXX:workflow/w-2ecf891966386c71d",
            "description": "example workflow",
            "id": "w-2ecf891966386c71d",
            "on_exception_steps": [],
            "steps": [
              {
                "copy_step_details": [],
                "custom_step_details": [],
                "delete_step_details": [],
                "tag_step_details": [],
                "type": "COPY"
              }
            ],
            "tags": null,
            "tags_all": {}
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "aws_s3_bucket.example_bucket"
          ]
        }
      ]
    }
  ],
  "check_results": []
}

When running a terraform plan again it will show changes to the copy_step_details again.

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