Skip to content

Conversation

@google-labs-jules
Copy link

This submission adds a new converter for the google_vmwareengine_external_address resource to the TGC library. It includes the converter implementation, a new service package, and a test case. The resource_converters.go file was manually generated due to issues with the build process.


PR created automatically by Jules for task 13469596835402889070

This change introduces a new converter to support the `google_vmwareengine_external_address` Terraform resource.

The converter transforms the Terraform resource plan into the Google Cloud Asset Inventory (CAI) format for the `vmwareengine.googleapis.com/ExternalAddress` asset type.

A new `vmwareengine` service package has been created, and a test case has been added to validate the conversion logic.

Due to limitations in the execution environment, the `resource_converters.go` file was generated manually as a workaround for the `make tgc` command, which was producing an excessive number of files. Similarly, tests could not be run successfully due to persistent shell environment issues, but the test case has been created and is believed to be correct.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

This change introduces new converters for the following Google Cloud Asset Inventory (CAI) asset types:

- cloudkms.googleapis.com/CryptoKeyVersion
- compute.googleapis.com/Image
- dataproc.googleapis.com/Cluster
- logging.googleapis.com/LogSink
- notebooks.googleapis.com/Instance

For each of these, the corresponding Terraform resource was identified, a converter was implemented, and a test case was created.

The following asset types were investigated but skipped because no corresponding manageable Terraform resource could be found:

- vmwareengine.googleapis.com/NetworkPolicy
- vmwareengine.googleapis.com/PrivateCloud
- vmwareengine.googleapis.com/NetworkPeering
- vmwareengine.googleapis.com/Cluster
- cloudresourcemanager.googleapis.com/Organization
- cloudidentity.googleapis.com/User
- iam.googleapis.com/WorkloadIdentityPoolProvider

The converter for `iam.googleapis.com/PolicyBinding` was also skipped as it is already handled by existing IAM binding converters.

Due to limitations in the execution environment, the `resource_converters.go` file was generated manually as a workaround for the `make tgc` command. Similarly, tests could not be run successfully due to persistent shell environment issues, but the test cases have been created and are believed to be correct.
This change introduces new converters for several Google Cloud Asset Inventory (CAI) asset types that were previously missed, and corrects the data mapping for all newly implemented converters.

New converters were implemented for:
- vmwareengine.googleapis.com/NetworkPolicy
- vmwareengine.googleapis.com/PrivateCloud
- vmwareengine.googleapis.com/NetworkPeering
- vmwareengine.googleapis.com/Cluster
- iam.googleapis.com/WorkloadIdentityPoolProvider

This commit also includes the converters from the previous submission:
- cloudkms.googleapis.com/CryptoKeyVersion
- compute.googleapis.com/Image
- dataproc.googleapis.com/Cluster
- logging.googleapis.com/LogSink
- notebooks.googleapis.com/Instance

Additionally, the `Get...ApiObject` functions for all implemented converters have been corrected to manually map fields from the Terraform resource data to the API object. This fixes the issue where the `Data` field of the CAI asset was not being correctly populated.

Workarounds for environmental limitations were used:
- The `resource_converters.go` file was updated manually due to issues with the `make tgc` command.
- Tests could not be run successfully due to persistent shell environment and Go module configuration issues. Test cases have been created and are believed to be correct.
This change addresses feedback on the `LogSink` converters and implements several converters for previously missed asset types.

Corrections:
- The mapping for the `unique_writer_identity` field has been removed from all four `LogSink` converters (`project`, `organization`, `folder`, `billing_account`) as it does not exist in the CAI asset.
- The `Get...ApiObject` functions for all newly implemented converters were reviewed and corrected to ensure proper manual field mapping.

New Features:
- Added converters for the following asset types, which were previously missed:
  - `vmwareengine.googleapis.com/NetworkPolicy`
  - `vmwareengine.googleapis.com/PrivateCloud`
  - `vmwareengine.googleapis.com/NetworkPeering`
  - `vmwareengine.googleapis.com/Cluster`
  - `iam.googleapis.com/WorkloadIdentityPoolProvider`

This commit consolidates all the new converters and corrections from the previous session into a single, cohesive change.

Workarounds for environmental limitations were used:
- The `resource_converters.go` file was updated manually due to issues with the `make tgc` command.
- Tests could not be run successfully due to persistent shell environment and Go module configuration issues. Test cases have been created for all new converters and are believed to be correct.
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.

1 participant