Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efs_volume_configuration transit_encryption_port causing replace of task definition #23541

Closed
InbarRose opened this issue Mar 7, 2022 · 12 comments · Fixed by #34020
Closed
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@InbarRose
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

$ terraform -v
Terraform v1.1.6
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v3.74.3
  • provider registry.terraform.io/hashicorp/external v2.2.0
  • provider registry.terraform.io/hashicorp/local v2.1.0
  • provider registry.terraform.io/hashicorp/null v3.1.0
  • provider registry.terraform.io/hashicorp/template v2.2.0

Affected Resource(s)

aws_ecs_task_definition -> volume - > efs_volume_configuration -> transit_encryption_port

relevant code:

reference: https://www.reddit.com/r/Terraform/comments/px60pb/terraform_constantly_reattaches_volumes_when/

  • aws_XXXXX

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

volume {
    name = var.efs_volume_name
    efs_volume_configuration {
      file_system_id     = data.aws_efs_file_system.shared_fs.id
      root_directory     = "/"
      transit_encryption = "DISABLED"
      authorization_config {
        iam = "DISABLED"
      }
    }
  }

Expected Behavior

no change

Actual Behavior

it wants to replace

  - volume {
      - name = "efs" -> null
      - efs_volume_configuration {
          - file_system_id          = "fs-07d0e24a8153ed93c" -> null
          - root_directory          = "/" -> null
          - transit_encryption      = "DISABLED" -> null
          - transit_encryption_port = 0 -> null
          - authorization_config {
              - iam = "DISABLED" -> null
            }
        }
    }
  + volume {
      + name = "efs"
      + efs_volume_configuration {
          + file_system_id     = "fs-07d0e24a8153ed93c"
          + root_directory     = "/"
          + transit_encryption = "DISABLED"
          + authorization_config {
              + iam = "DISABLED"
            }
        }
    }

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 7, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 7, 2022
@InbarRose
Copy link
Author

any movement on this?

@markbaird
Copy link

I'm also seeing this. I would add that you can't set the transit encryption port value to 0 in Terraform. It seems to store it as 0 internally when the value is null or unset, but Terraform doesn't handle that well and results in this perpetual diff.

@amh-mw
Copy link

amh-mw commented May 13, 2022

Duplicate of #19549?

@dsoprea
Copy link

dsoprea commented Nov 1, 2022

So annoying. Every time.

image

@ragumix
Copy link

ragumix commented Jan 10, 2023

Try to explicitly specify transit_encryption_port = null.

@markbaird
Copy link

Try to explicitly specify transit_encryption_port = null.

@ragumix I've done that before. The value is stored as 0 in the state file when the value null is specified. That is the entire issue. It causes the plan to show this diff every time, even when nothing is actually changing.

@dsoprea
Copy link

dsoprea commented Jan 10, 2023

Try to explicitly specify transit_encryption_port = null.

Mentioned earlier in 2022, above.

#23541 (comment)

@bpmb82
Copy link

bpmb82 commented Feb 23, 2023

Has anyone found a workaround for this? I tried adding transit_encryption_port as a lifecycle ignore but then it starts complaining about it not being set. I can try setting it to some random value I suppose, anyone tried that?

@sethjeffery
Copy link

The following works for me and does not recreate it on next apply:

  volume {
    name = "efs"
    efs_volume_configuration {
      file_system_id = data.aws_efs_file_system.efs.file_system_id
      transit_encryption_port = null
      transit_encryption = "DISABLED"
      root_directory = "/"
    }
  }

@markbaird
Copy link

The following works for me and does not recreate it on next apply:

  volume {
    name = "efs"
    efs_volume_configuration {
      file_system_id = data.aws_efs_file_system.efs.file_system_id
      transit_encryption_port = null
      transit_encryption = "DISABLED"
      root_directory = "/"
    }
  }

It makes sense that disabling encryption would fix the issue with the encryption port. However, those of us that need to keep encryption enabled can't use this as a solution.

@github-actions
Copy link

This functionality has been released in v5.23.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
9 participants