Skip to content

Conversation

TheFLHurricane
Copy link
Contributor

Because encryption_config is now strictly defined as an object, count will never be <1 even if empty.

Description

Addendum to previous PR... Changes enable_encryption_config to react to actual value of encryption_config rather than count since strict type object will always be >0.

Motivation and Context

This allows enable_encryption_config to become false when encryption_config is {} as in previous versions.

Breaking Changes

No, restores backwards compatibility.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Because encryption_config is now strictly defined as an object, count will never be <1 even if empty.
@TheFLHurricane TheFLHurricane changed the title Update main.tf fix enable_encryption_config still reads true even when toggled off Jul 24, 2025
@TheFLHurricane TheFLHurricane changed the title fix enable_encryption_config still reads true even when toggled off fix: enable_encryption_config still reads true even when toggled off Jul 24, 2025
@TheFLHurricane TheFLHurricane changed the title fix: enable_encryption_config still reads true even when toggled off fix: Local enable_encryption_config still reads true even when toggled off Jul 24, 2025
role_arn = try(aws_iam_role.this[0].arn, var.iam_role_arn)

create_outposts_local_cluster = var.outpost_config != null
enable_encryption_config = length(var.encryption_config) > 0 && !local.create_outposts_local_cluster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a reproduction of what you are trying to do? I'm not quite following, and this logic change looks incorrect


create_outposts_local_cluster = var.outpost_config != null
enable_encryption_config = length(var.encryption_config) > 0 && !local.create_outposts_local_cluster
enable_encryption_config = var.encryption_config != {} && !local.create_outposts_local_cluster
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this works for me, there's probably a better way to do it

Suggested change
enable_encryption_config = var.encryption_config != {} && !local.create_outposts_local_cluster
enable_encryption_config = length(coalesce(var.encryption_config.resources, [])) > 0 && !local.create_outposts_local_cluster

@antonbabenko
Copy link
Member

This issue has been resolved in version 21.0.4 🎉

Copy link

I'm going to lock this pull request 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 related to this change, 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 Aug 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants