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

Terrafy a single resource #166

Merged
merged 17 commits into from
Jul 15, 2022
Merged

Terrafy a single resource #166

merged 17 commits into from
Jul 15, 2022

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Jul 5, 2022

This PR refactors the CLI to move the default functionality into resource-group/rg subcommand, and introduce a new subcommand: resource/res, which "terrafies" only a single resource by specifying its Azure resource id. It only works non-interactively and generate the TF state and cfg. It also supports --append option to allow users to import a single resource into existing workspace.

Example:

/tmp/test
💢  aztfy res /subscriptions/0000/resourceGroups/spin-dailyrun-rg/providers/Microsoft.Compute/virtualMachines/spin-vm
Initializing...
Identifying reource type...
Importing /subscriptions/0000/resourceGroups/spin-dailyrun-rg/providers/Microsoft.Compute/virtualMachines/spin-vm as azurerm_linux_virtual_machine.res-0
Generating Terraform configurations...

Note that the TF resource type is identified automatically, by leveraging the https://github.com/magodo/aztft.

@magodo magodo added enhancement New feature or request breaking-change labels Jul 5, 2022
@magodo magodo requested a review from ms-henglu July 14, 2022 01:02
Copy link
Member

@ms-henglu ms-henglu left a comment

Choose a reason for hiding this comment

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

LGTM!

@magodo magodo merged commit 6f66b2c into Azure:main Jul 15, 2022
@rtorato
Copy link

rtorato commented Jul 18, 2022

It'll be create a new release with this merge?

@magodo
Copy link
Collaborator Author

magodo commented Jul 19, 2022

@rtorato Yes, a new release will come shortly.

@koudaiii
Copy link
Member

I found v0.6.0. If brew user will be able to do so shortly. ref Homebrew/homebrew-core#106301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants