terraform-aws-modules / terraform-aws-dms

Terraform module to create AWS DMS (Database Migration Service) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/dms/aws
Apache License 2.0
60 stars 93 forks source link

fix: Add conditional to access IAM role when used as fallback value #48

Closed mrobinson1022 closed 8 months ago

mrobinson1022 commented 10 months ago

Description

Added a ternary on create_access_iam_role on lookups for service_access_role_arn in aws_dms_endpoint.this.kinesis settings, secrets_manager_access_role_arn and service_access_role in aws_dms_endpoint.this. I did not add the ternary to the elasticsearch block as the role is required in that context. However, using an already defined role will likely cause a failure here for the same reason, but I did not test this scenario as I am not using elasticsearch with DMS.

Motivation and Context

Implementations of the module where roles have already been provisioned for access and are passed to the necessary objects resulted in a failure when create_access_iam_role = false due to aws_iam_role.access[0].arn is an empty tuple.

Breaking Changes

This should not introduce any breaking changes.

How Has This Been Tested?

jasoncuriano commented 9 months ago

Thanks for fixing this, this issue has been blocking upgrading the module reference in existing deployments. Any chance for someone to review this PR?

mrobinson1022 commented 8 months ago

@bryantbiggs Let me know if you need anything to merge this PR, thanks!

antonbabenko commented 8 months ago

This PR is included in version 2.0.1 :tada:

github-actions[bot] commented 7 months ago

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.