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

fix: support name as a global aws resource ref #2409

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

hugorut
Copy link
Contributor

@hugorut hugorut commented Apr 17, 2023

This PR adds support to use name as a global resource reference. This resolves issues with resources that reference dependent resources with name. For example aws_autoscaling_group.launch_configuration:

resource "aws_autoscaling_group" "asg_lc_min_size_name_ref" {
  launch_configuration = aws_launch_configuration.lc_basic.name
  max_size             = 3
  min_size             = 2
}

Prior to this change asg_lc_min_size_name_ref would have blank references. I've decided to put move the name into the default resource ID func as I believe referencing a resource by name is probably quite a common pattern across a wide range of resources.

@hugorut hugorut self-assigned this Apr 17, 2023
@hugorut hugorut requested a review from aliscott April 17, 2023 07:22
Copy link
Member

@aliscott aliscott left a comment

Choose a reason for hiding this comment

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

Can we now clean up CustomRefIDFuncs that lookup by "name"?

This PR adds support to use `name` as a global resource reference. This resolves issues with resources that reference dependent resources with `name`. For example aws_autoscaling_group.launch_configuration:

```
resource "aws_autoscaling_group" "asg_lc_min_size_name_ref" {
  launch_configuration = aws_launch_configuration.lc_basic.name
  max_size             = 3
  min_size             = 2
}
```

Prior to this change `asg_lc_min_size_name_ref` would have blank references. I've decided to put move the `name` into the default resource ID func as I believe referencing a resource by `name` is probably quite a common pattern across a wide range of resources.
@hugorut hugorut merged commit 0c46bab into master Apr 17, 2023
7 of 9 checks passed
@hugorut hugorut deleted the feat/support-name-refs branch April 17, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants