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 brandon-pollack and blog post on terraform convert #13777

Open
wants to merge 4 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.

with a single unified programming model.
To that end, we've already added support for [any Terraform/OpenTofu provider](/home/brpol/src/pulumi/docs/content/blog/any-terraform-provider/).
This works great if you already have an existing pulumi project and want to
utilize some providers from the Terraform ecosystem that aren't yet available for
Copy link
Contributor

Choose a reason for hiding this comment

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

"utilize" -> "use" (improper word use: "utilize" means to use for a purpose other than what was intended, "e.g. i utilized a kitchen spatula to remove the ice from the car." vs "i used a kitchen spatula to flip an egg" or "i used an ice scraper to remove the ice from the car)

Copy link
Author

Choose a reason for hiding this comment

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

I want to emphasize that we are taking advantage of somehting very useful. How about "leverage"

Copy link
Contributor

Choose a reason for hiding this comment

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

Leverage works!

To that end, we've already added support for [any Terraform/OpenTofu provider](/home/brpol/src/pulumi/docs/content/blog/any-terraform-provider/).
This works great if you already have an existing pulumi project and want to
utilize some providers from the Terraform ecosystem that aren't yet available for
Pulumi natively! However, What if you are trying to move your already existing
Copy link
Contributor

Choose a reason for hiding this comment

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

"What" -> "what" (capitalize beginnings of sentences, not phrases)

Copy link
Contributor

Choose a reason for hiding this comment

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

"already existing" -> "existing" (simplify grammar)

This works great if you already have an existing pulumi project and want to
utilize some providers from the Terraform ecosystem that aren't yet available for
Pulumi natively! However, What if you are trying to move your already existing
Infrastructure as Code solution to Pulumi IaC?
Copy link
Contributor

Choose a reason for hiding this comment

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

"Infrastructure as Code" -> "infrastructure as code" (infrastructure as code is not a proper noun so should not be capitalized)


We already have a [handy
utility](/docs/using-pulumi/adopting-pulumi/migrating-to-pulumi/from-terraform/)
called `pulumi convert` built into the cli to convert terraform projects to any
Copy link
Contributor

Choose a reason for hiding this comment

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

"cli" -> "CLI" (capitalize acronyms)

Copy link
Contributor

Choose a reason for hiding this comment

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

"terraform" -> "Terraform" (capitalize proper nouns)

utility](/docs/using-pulumi/adopting-pulumi/migrating-to-pulumi/from-terraform/)
called `pulumi convert` built into the cli to convert terraform projects to any
Pulumi language, but up until now it didn't handle dependencies on external
terraform providers which don't have a known Pulumi native equivalent.
Copy link
Contributor

Choose a reason for hiding this comment

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

"terraform" -> "Terraform" (capitalize proper nouns)

* We still have a bit of [unimplemented Terraform functionality](https://github.com/pulumi/pulumi-converter-terraform/issues/65) that we're tracking and are evaluating how to move forward. For now when these functions are detected it will require some manual intervention on the converted project before you're ready to deploy.
* If you define your terraform module in a parent directory of your deployment code, you'll encounter a [known bug](https://github.com/pulumi/pulumi-converter-terraform/issues/194), but a simple workaround is to restructure your Terraform code before running a conversion.
* Terraform programs are dynamically typed, when converting to a type safe language sometimes a type is unknown and still needs to be added manually (as in the typescript example above).
* Variables/Configuration are not yet converted automatically, so tfvars files etc will need to be manually converted into pulumi stack configurations.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Variables/Configuration" -> "Variables and configuration" (grammar: sentence capitalization and conjunction use)

Copy link
Contributor

Choose a reason for hiding this comment

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

"tfvars" -> ".tfvars" (use code formatting for filenames)

Copy link
Contributor

Choose a reason for hiding this comment

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

"pulumi" -> "Pulumi" (capitalize proper nouns)

---
title: "Pulumi Convert Terraform Improvements"
date: 2025-01-08T14:47:13+09:00
meta_desc: "Pulumi convert now supports a number of enhancements and bug fixes for terraform, including automatically bridging providers"
Copy link
Contributor

Choose a reason for hiding this comment

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

"terraform" -> "Terraform" (capitalize proper nouns)

At Pulumi, we want to provide access to manage **any** cloud infrastructure
with a single unified programming model.
To that end, we've already added support for [any Terraform/OpenTofu provider](/home/brpol/src/pulumi/docs/content/blog/any-terraform-provider/).
This works great if you already have an existing pulumi project and want to
Copy link
Contributor

Choose a reason for hiding this comment

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

"pulumi" -> "Pulumi" (capitalize proper nouns)


In order to illustrate the example further, I've thrown together a simple
Terraform project that sets up a Google Compute Engine virtual machine, a
Planetscale database, and wires them together. At the time of writing, there
Copy link
Contributor

Choose a reason for hiding this comment

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

"Planetscale" -> "PlanetScale" (use correct capitalization for product name)

@thoward
Copy link
Contributor

thoward commented Jan 9, 2025

Also, looks like the build is failing the linter check:

Errors:

/home/runner/work/docs/docs/content/blog/pulumi-convert-terraform-improvements/index.md:
Line 349: Unordered list style [Expected: dash; Actual: asterisk].
Line 350: Unordered list style [Expected: dash; Actual: asterisk].
Line 351: Unordered list style [Expected: dash; Actual: asterisk].
Line 352: Unordered list style [Expected: dash; Actual: asterisk].

You can run make lint from the root of the docs repo to resolve these. The linter is pretty strict about Markdown formatting details, but it should be straightforward to satisfy its requirements.

@pulumi-bot
Copy link
Collaborator

@pulumi-bot
Copy link
Collaborator

@brandonpollack23
Copy link
Author

Addressed :)


At Pulumi, we want to provide access to manage **any** cloud infrastructure
with a single unified programming model.
To that end, we've already added support for [any Terraform/OpenTofu provider](/home/brpol/src/pulumi/docs/content/blog/any-terraform-provider/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To that end, we've already added support for [any Terraform/OpenTofu provider](/home/brpol/src/pulumi/docs/content/blog/any-terraform-provider/).
To that end, we've already added support for [any Terraform/OpenTofu provider](blog/any-terraform-provider/).

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.


{{% /chooser %}}

This will download the necessary converter and language plugins, run the
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't language plugins always bundled with the pulumi installation? So they shouldn't need to be downloaded.

{{% choosable language python %}}

```shell
pulumi convert --from terraform --language python --out python
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pulumi convert --from terraform --language python --out python
pulumi convert --from terraform --language python --out pulumi-program

Or something? I stumbled over this wondering why we need python twice for a minute.

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

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

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.

4 participants