Skip to content

Commit

Permalink
Allow tfgen to use pulumi convert for examples conversion (#1401)
Browse files Browse the repository at this point in the history
Fixes #1352

Requires a recent Pulumi version including pulumi/pulumi-converter-terraform#29 

A new option is added for tfgen, via the environment variable
PULUMI_CONVERT. IF this option is truthy, `make tfgen` will now be using
`pulumi convert` when converting examples, specifically for the TF HCL
to Pulumi PCL phase of the conversion.

When rolling this out to providers, recommend making sure that Pulumi
CLI in use is pinned first, as the repositories are sensitive to small
changes in the generated examples and a floating Pulumi CLI reference
can introduce breaking CI checks.
  • Loading branch information
t0yv0 authored Oct 3, 2023
1 parent ec0418d commit e3aabd3
Show file tree
Hide file tree
Showing 7 changed files with 759 additions and 18 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ This repo on its own isn't particularly interesting, until it is used to create

We use git tags and [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
1. Maintainers will push a new semver [tag](https://github.com/pulumi/pulumi-terraform-bridge/tags) when appropriate
1. Maintainers will then generate a Release with Changelog using [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository), using the tag pushed in the
1. Maintainers will then generate a Release with Changelog using [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository), using the tag pushed in the
first step.
1. Finally, maintainers will roll out bridge updates across Pulumi providers via manually running the [bridge update
1. Finally, maintainers will roll out bridge updates across Pulumi providers via manually running the [bridge update
workflow in CI Management](https://github.com/pulumi/ci-mgmt/actions/workflows/update-bridge-ecosystem-providers.yml).

### Adapting a New Terraform Provider
Expand Down Expand Up @@ -106,3 +106,4 @@ tfgen, the command that generates Pulumi schema/code for a bridged provider supp
* `PULUMI_SKIP_MISSING_MAPPING_ERROR`: If truthy, tfgen will not fail if a data source or resource in the TF provider is not mapped to the Pulumi provider. Instead, a warning is printed. Default is `false`.
* `PULUMI_SKIP_EXTRA_MAPPING_ERROR`: If truthy, tfgen will not fail if a mapped data source or resource does not exist in the TF provider. Instead, warning is printed. Default is `false`.
* `PULUMI_MISSING_DOCS_ERROR`: If truthy, tfgen will fail if docs cannot be found for a data source or resource. Default is `false`.
* `PULUMI_CONVERT`: If truthy, tfgen will shell out to `pulumi convert` for converting example code from TF HCL to Pulumi PCL
Loading

0 comments on commit e3aabd3

Please sign in to comment.