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

generate: Add support for multiple modules having same resource names #111

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

xescugc
Copy link
Member

@xescugc xescugc commented Mar 2, 2021

What we'll do is check if there are more than 1 module with resources, if so then we'll use full
resource name 'module.NAME.aws_instance.NAME2' as canonical. This will also be used on the config
output as key canonical for the resource.

If there is only 1 module they'll not be prefixed in favor of readability of the names.

Closes #103

@xescugc xescugc added the need review Pull Request is ready to be reviewed (tests are passing, commits ordered and no draft status) label Mar 9, 2021
@xescugc
Copy link
Member Author

xescugc commented Mar 9, 2021

Rebased and ready to be reviewed

Copy link
Contributor

@tormath1 tormath1 left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.md Outdated
@@ -1,5 +1,10 @@
## [Unreleased]

### Fixed

- Multiple modules with same resource name now work correctly using full module name `module.NAME.aws_insatance.NAME2`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Multiple modules with same resource name now work correctly using full module name `module.NAME.aws_insatance.NAME2`
- Multiple modules with same resource name now work correctly using full module name `module.NAME.aws_instance.NAME2`

@xescugc
Copy link
Member Author

xescugc commented Mar 9, 2021

Done :)

@tormath1
Copy link
Contributor

tormath1 commented Mar 9, 2021

@xescugc you can RS then

What we'll do is check if there are more than 1 module with resources, if so then we'll use full
resource name 'module.NAME.aws_instance.NAME2' as canonical. This will also be used on the config
output as key canonical for the resource.

If there is only 1 module they'll not be prefixed in favor of readability of the names.
@xescugc
Copy link
Member Author

xescugc commented Mar 9, 2021

Done

@xescugc xescugc merged commit f43b05f into master Mar 9, 2021
@xescugc xescugc deleted the fg-103 branch March 9, 2021 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need review Pull Request is ready to be reviewed (tests are passing, commits ordered and no draft status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: with canonical "aws_security_group.this_name_prefix": graph node already exists
2 participants