Skip to content

Conversation

rafstef
Copy link

@rafstef rafstef commented Oct 28, 2021

Update reader_endpoint_address to null when cluster_mode_enabled true.

what

Update reader_endpoint_address to null when cluster_mode_enabled is enabled.

why

  • Update reader_endpoint_address to null when cluster_mode_enabled is enabled and cluster_mode_num_node_groups == 1 otherwise after the creation creation the terraform return an error of null variable.

references

Update reader_endpoint_address  to null when cluster_mode_enabled true.
@rafstef rafstef requested review from a team as code owners October 28, 2021 13:40
@rafstef rafstef requested review from florian0410 and milldr and removed request for a team October 28, 2021 13:40
@Nuru Nuru added the bugfix Change that restores intended behavior label Oct 28, 2021
@Nuru
Copy link
Contributor

Nuru commented Oct 28, 2021

/test all


output "reader_endpoint_address" {
value = join("", aws_elasticache_replication_group.default.*.reader_endpoint_address)
value = var.cluster_mode_enabled ? null : join("", aws_elasticache_replication_group.default.*.reader_endpoint_address)
Copy link
Member

@nitrocode nitrocode Oct 28, 2021

Choose a reason for hiding this comment

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

Don't we also to make sure the module is also enabled ?

Suggested change
value = var.cluster_mode_enabled ? null : join("", aws_elasticache_replication_group.default.*.reader_endpoint_address)
value = local.enabled && var.cluster_mode_enabled ? null : join("", aws_elasticache_replication_group.default.*.reader_endpoint_address)

If so, we'd probably want to add local.enabled to the endpoint output as well

Copy link
Contributor

Choose a reason for hiding this comment

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

@nitrocode Close, but not quite. Also should verify/fix other outputs.

@Nuru Nuru self-requested a review October 28, 2021 20:00
Copy link
Contributor

@Nuru Nuru left a comment

Choose a reason for hiding this comment

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

Need to fix all outputs for case when module is disabled. @rafstef please wait, I will do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Change that restores intended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid function argument in reader_endpoint_address output

3 participants