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

Blog post on terraform convert improvements #13777

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

brandonpollack23
Copy link

Proposed changes

Unreleased product version (optional)

Related issues (optional)

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
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
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.

@@ -0,0 +1,352 @@
---
title: "Pulumi Convert Terraform Improvements"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can come up with a more exciting/specific title for this. Maybe

Convert Terraform Projects With Any Provider

Though I don't really love that either 🤔

Copy link
Author

Choose a reason for hiding this comment

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

I'm open to suggestions for sure, I'm not in love with this title

Copy link
Member

Choose a reason for hiding this comment

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

We also want to talk about similar support for pulumi import in this blog post (pulumi/pulumi#17507; which is going to ship in this week's CLI), so might be worth keeping that in mind for the title as well.

Copy link
Author

Choose a reason for hiding this comment

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

Alright I changed it to something fun, let me know if this is too much

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

@@ -0,0 +1,352 @@
---
title: "Pulumi Convert Terraform Improvements"
Copy link
Member

Choose a reason for hiding this comment

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

We also want to talk about similar support for pulumi import in this blog post (pulumi/pulumi#17507; which is going to ship in this week's CLI), so might be worth keeping that in mind for the title as well.

There is still more you can do, the generated code could be cleaned up some as there
are some unused variables, etc.

## Limitations
Copy link
Member

Choose a reason for hiding this comment

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

We wanted to also mention pulumi import support for any Terraform/OpenTofu provider in this blog post as well. I think that could be as simple as an extra section above that says something like:

Importing

We also now support importing existing infrastructure from any Terraform/OpenTofu provider with the pulumi import command. For example:
(insert some example pulumi import command)

It doesn't necessarily have to go as in depth as the sections on pulumi convert above.

Let me know if you want to take a crack at writing this or if you'd like some help.

@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

There is still more you can do, the generated code could be cleaned up some as there
are some unused variables, etc.

## Importing Resources from Bridged Terraform Providers
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
## Importing Resources from Bridged Terraform Providers
## Importing Resources from Any Terraform Provider

Comment on lines +411 to +416
Up until now, Terraform providers bridged this way using our parameterized
[Pulumi Terraform Provider](https://github.com/pulumi/pulumi-terraform-bridge)
could not be
[imported](https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/)
correctly into other stacks (or any other parameterizable provider for that
matter).
Copy link
Member

Choose a reason for hiding this comment

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

I'd cut this paragraph and just focus on the new capability:

Suggested change
Up until now, Terraform providers bridged this way using our parameterized
[Pulumi Terraform Provider](https://github.com/pulumi/pulumi-terraform-bridge)
could not be
[imported](https://www.pulumi.com/docs/iac/cli/commands/pulumi_import/)
correctly into other stacks (or any other parameterizable provider for that
matter).

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

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.

8 participants