Skip to content

Commit

Permalink
add omit_external_ip field to export post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
mike9107 authored and cmgsj committed Feb 11, 2025
1 parent ccab8d3 commit 11f85ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ the [authentication](/packer/integrations/hashicorp/googlecompute#authentication

- `service_account_email` (string) - Service Account Email

- `omit_external_ip` (bool) - If true, the exporter instance will not have an external IP.

<!-- End of code generated from the comments of the Config struct in post-processor/googlecompute-export/post-processor.go; -->


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@

- `service_account_email` (string) - Service Account Email

- `omit_external_ip` (bool) - If true, the exporter instance will not have an external IP.

<!-- End of code generated from the comments of the Config struct in post-processor/googlecompute-export/post-processor.go; -->
3 changes: 3 additions & 0 deletions post-processor/googlecompute-export/post-processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ type Config struct {
Zone string `mapstructure:"zone"`
IAP bool `mapstructure-to-hcl2:",skip"`
ServiceAccountEmail string `mapstructure:"service_account_email"`
//If true, the exporter instance will not have an external IP.
OmitExternalIP bool `mapstructure:"omit_external_ip" required:"false"`

ctx interpolate.Context
}
Expand Down Expand Up @@ -183,6 +185,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifa
SourceImageProjectId: []string{"compute-image-tools"},
Subnetwork: p.config.Subnetwork,
Zone: p.config.Zone,
OmitExternalIP: p.config.OmitExternalIP,
Scopes: []string{
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.full_control",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11f85ad

Please sign in to comment.