packer-plugin-googlecompute icon indicating copy to clipboard operation
packer-plugin-googlecompute copied to clipboard

Add support for reserved private IP in GCP builder

Open helldrum opened this issue 7 months ago • 0 comments

Description

Add the ability to specify a reserved private IP address when creating GCP instances with Packer. This feature would allow users to assign a specific private IP address to instances during the build process.

Use Case(s)

When building images in environments with strict networking requirements or when IP addresses need to be pre-defined for compliance or architectural reasons, users need to be able to specify a static private IP address for the build instance.

Potential configuration

source "googlecompute" "example" {
  project_id   = "your_project_id"
  zone         = "europe-west1-b"
  machine_type = "e2-micro"
  subnetwork   = "my-subnet"
  reserved_ip  = "10.0.0.10"  # Optional: Specify a reserved private IP
}

Potential References

Add reserved_ip field to the builder configuration structure Implement validation in the Prepare function Modify instance creation to use the specified IP when provided Update documentation to reflect the new feature

Thank you for your help

helldrum avatar Mar 18 '25 15:03 helldrum