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

Add more documentation about how to work with existing resources (import/alteration) #1313

Open
remyleone opened this issue Nov 17, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. size/medium estimated < 1 week

Comments

@remyleone
Copy link

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

Description

I have not found tutorials or guides that explain how I can re-use existing resources and existing state.
I've searched here:

Maybe using https://www.terraform.io/docs/cdktf/concepts/data-sources.html could be an option but it seems to be quite verbose. Is there an easier way to import an existing resource within the state managed by the CDK?
If it is the only way, maybe adding a tutorial/guide to focus on this importing workflow could be helpful. Especially if it combines discovered aspects (tags) to apply different treatments (use tags as an input of a function that will apply other tags to the given resource).

@remyleone remyleone added enhancement New feature or request new Un-triaged issue labels Nov 17, 2021
@jsteinich
Copy link
Collaborator

Data sources don't actually import the resource into state. They basically function as a lookup into the already provisioned infrastructure.

Actually importing is probably more work as it requires creating code that matches the existing infrastructure and then running terraform import for each resource. Definitely room for some improvements to that process.

@ansgarm
Copy link
Member

ansgarm commented Nov 22, 2021

(linking Support terraform import via the cdk cli #1134 for reference)

@DanielMSchmidt DanielMSchmidt added documentation Improvements or additions to documentation needs-priority Issue has not yet been prioritized; this will prompt team review priority/important-soon High priority, to be worked on as part of our current release or the following one. size/medium estimated < 1 week and removed new Un-triaged issue needs-priority Issue has not yet been prioritized; this will prompt team review labels Nov 25, 2021
@xiehan xiehan added priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. and removed priority/important-soon High priority, to be worked on as part of our current release or the following one. labels Feb 16, 2023
@xiehan xiehan added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. and removed priority/backlog Low priority (though possibly still important). Unlikely to be worked on within the next 6 months. labels Jun 1, 2023
@xiehan xiehan removed the enhancement New feature or request label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. size/medium estimated < 1 week
Projects
None yet
Development

No branches or pull requests

5 participants