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 google_compute_instance to v6 cai2hcl #12723

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zli82016
Copy link
Member

@zli82016 zli82016 commented Jan 9, 2025

  1. The cai2hcl conversion workflow for google_compute_instance is cai asset -> API object -> tfplan. In this way, the flatten functions in the provider, which convert API object into Terraform resource, can be reused. To handle the inconsistency between cai asset and API object, some modification is needed for the flatten functions.
  2. The fields with default value in provider are only converted when their values are not default.
  3. Testing:

In magic modules, generate tgc

make tgc  OUTPUT_PATH="$GOPATH/src/github.com/GoogleCloudPlatform/terraform-google-conversion"

In terraform-google-conversion

make build
./bin/tgc cai2hcl convert full_compute_instance.json > full_compute_instance.tf

The automatic testing will come soon.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

terraform-google-conversion: Diff ( 4 files changed, 561 insertions(+), 4 deletions(-))

@zli82016 zli82016 marked this pull request as ready for review January 9, 2025 23:04
@zli82016 zli82016 requested a review from c2thorn January 10, 2025 17:35
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.

2 participants