Skip to content

Blog post on terraform convert improvements #13777

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

Merged
merged 18 commits into from
Mar 4, 2025

Conversation

brandonpollack23
Copy link
Contributor

Proposed changes

Unreleased product version (optional)

Related issues (optional)

thoward
thoward previously requested changes Jan 9, 2025
Copy link
Contributor

@thoward thoward left a comment

Choose a reason for hiding this comment

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

This is a great article, @brandonpollack23 ! Thanks much for the write-up. There are some minor grammatical issues to address (as noted), but otherwise the post looks good.

@thoward

This comment was marked as outdated.

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@brandonpollack23
Copy link
Contributor Author

Addressed :)

to navigate to your project directory and run the following command with the
latest version of Pulumi installed:

{{% chooser language "javascript,typescript,python,go" %}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not work for yaml/dotnet/java?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does but I havent gotten around to testing each of those (there are enough issues from various subtleties in the ones built into the repo). Figured I'd wait until it was out of draft stage and folks had a look at it, but I'm going to test/add them after that.

@brandonpollack23 brandonpollack23 marked this pull request as ready for review January 10, 2025 08:53
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@meagancojocar meagancojocar changed the title Add brandon-pollack and blog post on terraform convert Blog post on terraform convert improvements Jan 14, 2025
@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

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

Sorry for not sending sooner, but I have some additional feedback on the import section

Comment on lines 418 to 422
With the release of [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0), we have also
addressed this limitation, and you can now import resources that will be
managed by the Pulumi Terraform parameterized provider and code will also be
generated to manage these resources from within Pulumi. See the [documentation for `pulumi import`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/)
for more details.
Copy link
Member

Choose a reason for hiding this comment

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

Could we show an example of importing a PlanetScale resource?

Suggested change
With the release of [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0), we have also
addressed this limitation, and you can now import resources that will be
managed by the Pulumi Terraform parameterized provider and code will also be
generated to manage these resources from within Pulumi. See the [documentation for `pulumi import`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/)
for more details.
In addition to being able to use any Terraform/OpenTofu provider with `pulumi convert`, with the release of [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0) you can now _import_ resources from any Terraform/OpenTofu provider using the [`pulumi import`](https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/) command.
Here's an example of importing an existing PlanetScale resource:
TODO

## What's Really New Here? 🚀

1. **Automatic Provider Bridging**: The converter now automatically handles any Terraform provider, even ones without Pulumi equivalents
2. **Improved Import Support**: With [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0), you can now import resources from any bridged provider
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
2. **Improved Import Support**: With [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0), you can now import resources from any bridged provider
2. **Improved Import Support**: With [Pulumi 3.146.0](https://github.com/pulumi/pulumi/releases/tag/v3.146.0), you can now import resources from any Terraform provider

@brandonpollack23
Copy link
Contributor Author

We should wait to submit this until pulumi/pulumi#18259 is released


- Abstract functionality that is shared, perhaps by extracting it into reusable functions or classes.
- Consider moving any functions that you will use in different infrastructure projects to a shared dependency or a [Component Resource](/docs/iac/concepts/resources/components/#component-resources).
- Do anything you need to have your infrastructure behave how you want: consolidate functionality from scripts, read information from files and services, the sky is the limit! A Pulumi program is _just a program_!
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested edit for clarity: Customize your infrastructure however you need: You can consolidate script functionality, read data from files and services, and more. A Pulumi program is just code!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mixed the two, I kind of want to get the point through that you can do anything the target language can do

pulumi import "b2:index/bucket:Bucket" example_bucket "YOUR_BUCKET_ID"
```

1. As part of the import, code will be generated for you to add to your project as you see fit to manage the resource from Pulumi. By default, Pulumi will set the `protect` option when generating code, which prevents the resources from being deleted by Pulumi; you can use `--protect=false` to disable this.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion for this as well: During the import, Pulumi generates code for you to add to your project, allowing you to manage the resource as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

1. **Improved Import Support**: With [Pulumi 3.153.0](https://github.com/pulumi/pulumi/releases/tag/v3.153.0), you can now import resources from any Terraform provider
1. **Seamless Integration**: Generated code works right out of the box with minimal to no tweaking needed

## The Road Ahead
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest a CTA at the end to download Pulumi, or send folks to our get started guides.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CTA = Call to Action? ok adding

Copy link
Contributor

@interurban interurban left a comment

Choose a reason for hiding this comment

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

Left a couple of comments, looks great.

@pulumi-bot
Copy link
Collaborator

@brandonpollack23 brandonpollack23 enabled auto-merge (squash) March 4, 2025 02:23
@brandonpollack23 brandonpollack23 dismissed thoward’s stale review March 4, 2025 02:28

Addressed these comments a while ago, way new version now and got approval

@brandonpollack23 brandonpollack23 merged commit e35667b into master Mar 4, 2025
10 checks passed
@brandonpollack23 brandonpollack23 deleted the bpollack/pulumi_convert branch March 4, 2025 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.