Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

compute: fix instance and template meta.yaml mappings - #20591

Open
rileykarson wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
rileykarson:compute-instance-meta-yaml-mappings
Open

rileykarson wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
rileykarson:compute-instance-meta-yaml-mappings

Conversation

@rileykarson

@rileykarson rileykarson commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes handwritten resource metadata (meta.yaml) API field mappings for Compute instance and instance template resources where the API fields are already implemented in Terraform:

  • Map metadata.items.key and metadata.items.value (and properties.metadata.items.{key,value}) to metadata on google_compute_instance, google_compute_instance_from_template, google_compute_instance_from_machine_image, google_compute_instance_template, and google_compute_region_instance_template.
    • Why this is valid: In the Compute API, metadata.items is a list of {key, value} objects rather than a primitive map, so coverage tracks the leaf fields key and value rather than the non-JSON parent metadata.items. Terraform's metadata TypeMap already expands every map entry into items[].key and items[].value and flattens them back on read, and mapping multiple API leaf fields to one Terraform field is standard in meta.yaml (matching partnerMetadata.key / partnerMetadata.value.entries -> partner_metadata in these files).
  • Add networkInterfaces.accessConfigs.setPublicPtr mapped to network_interface.access_config.public_ptr_domain_name on google_compute_instance, google_compute_instance_from_template, and google_compute_instance_from_machine_image.
    • Why this is valid: setPublicPtr is the API boolean toggle that enables publicPtrDomainName and has no standalone behavior without a domain name. In compute_instance_helpers.go.tmpl, expandAccessConfigs sets ac["setPublicPtr"] = true whenever public_ptr_domain_name is non-empty, and flattenAccessConfigs reads setPublicPtr to decide whether to populate public_ptr_domain_name. (Intentionally omitted on instance templates, where public_ptr_domain_name is Computed: true only.)

@rileykarson
rileykarson requested a review from c2thorn December 4, 2026 23:03
@modular-magician

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 16 insertions(+), 4 deletions(-)
google-beta provider View Diff 5 files changed, 21 insertions(+), 5 deletions(-)

This branch has not been deployed

No deployments
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