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

--append mode should discover previous generated resource names #255

Open
hguy opened this issue Oct 11, 2022 · 3 comments
Open

--append mode should discover previous generated resource names #255

hguy opened this issue Oct 11, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@hguy
Copy link

hguy commented Oct 11, 2022

I succesfuly generate tf files from a ressource group then i tried to include afterward some containers using a "query --recursive --append" but the default naming rule restart at "0" which make import collid.

How to use --append and ensuring new resources stack in the main.tf without name collision ?
How to force an "resource override recursive" ?
image

@magodo
Copy link
Collaborator

magodo commented Oct 12, 2022

@hguy In this case, you can use --name-pattern/-p to specify the pattern to something other than res-* to avoid name collision. Currently, aztfy is not smart enough to start the index of * from what is left in the state file.

@magodo magodo added the question Further information is requested label Oct 12, 2022
@hguy
Copy link
Author

hguy commented Oct 12, 2022

@hguy In this case, you can use --name-pattern/-p to specify the pattern to something other than res-* to avoid name collision. Currently, aztfy is not smart enough to start the index of * from what is left in the state file.

Thank you for that tip.
It could be very useful to add these params in addition to --name-pattern.

--name-startindex #default `0`
--append-main #default `false`, require `--append`. If `true` append HCL to `main.tf`, append to `main.aztfy.tf` otherwise.

@magodo
Copy link
Collaborator

magodo commented Oct 12, 2022

--append-main is not necessary as users can always append the content of main.aztfy.tf to main.tf by themselves.

--name-pattern-start-index is what I've also thought about :)

@magodo magodo added enhancement New feature or request and removed question Further information is requested labels Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants