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

Improve Experience of Renaming / Moving Constructs #2 #3722

Open
1 task
infowolfe opened this issue Sep 6, 2024 · 0 comments
Open
1 task

Improve Experience of Renaming / Moving Constructs #2 #3722

infowolfe opened this issue Sep 6, 2024 · 0 comments
Labels
enhancement New feature or request new Un-triaged issue

Comments

@infowolfe
Copy link

Description

The fix in #3152 doesn't actually apply to constructs, but instead only to TerraformResource #219 leaving a substantial gap/difficulty in renaming constructs.

Given you have a construct like

class Foo(Construct):
    def __init__(self, scope: Construct, name: str) -> None:
        super().__init__(scope, name)
        
        pass

If you call it with a name from within your stack:

class StackName(TerraformStack):
   def __init__(self, scope: Construct, name: str) -> None:
       super().__init__(scope, name)
       
       newthing = Foo(self, name="demo")

you cannot then do something like:

class StackName(TerraformStack):
    def __init__(self, scope: Construct, name: str) -> None:
        super().__init__(scope, name)
        
        newthing = Foo(self, name="demo-copy")
        newthing.move_from("demo")

Because there's no support for .move* methods of the Construct class (at least in python)

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@infowolfe infowolfe added enhancement New feature or request new Un-triaged issue labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant