Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to follow change in aws_db_instance id
aws_db_instance was updated by hashicorp/terraform-provider-aws#31232 such that the `id` attribute now tracks the resource ID, and the identifier is now returned in a new attribute named `identifier`. The resource ID is already available in `instance_resource_id`. This fix allows existing users to continue using this module with no changes and preserves the original function of the `id` attribute in this module. Fixes terraform-aws-modules#495.
- Loading branch information
3ca00c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jwoytek there is no identifier in the outputs of the resource https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#attributes-reference
do you mean ?
value = try(local.identifier, "")
3ca00c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ricosega I was initially confused at the documentation as well and filed a documentation bug report on it, but one of the folks there let me know that it is indeed available, but listed under arguments because it can also be set by the caller (see: hashicorp/terraform-provider-aws#31854).
This has been tested using one of the module's provided examples and it works.
local.identifier
(even if it is available--I have not looked) would not work in any case, as when one does not set an identifier when creating adb_instance
, AWS will generate one, so it must be retrieved from thedb_instance
resource.