ns: gcp preamble: | The functions in the `gcp` namespace interface with various Google Cloud Platform APIs to make it possible for a template to render differently based on the GCP environment and metadata. ### Configuring GCP A number of environment variables can be used to control how gomplate communicates with GCP APIs. | Environment Variable | Description | | -------------------- | ----------- | | `GCP_META_ENDPOINT` | _(Default `http://metadata.google.internal`)_ Sets the base address of the instance metadata service. | | `GCP_TIMEOUT` | _(Default `500`)_ Adjusts timeout for API requests, in milliseconds. | funcs: - name: gcp.Meta released: v3.8.0 description: | Queries GCP [Instance Metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata) for information. For times when running outside GCP, or when the metadata API can't be reached, a `default` value can be provided. pipeline: false arguments: - name: key required: true description: the metadata key to query - name: default required: false description: the default value examples: - | $ echo '{{gcp.Meta "id"}}' | gomplate 1334999446930701104 - | $ echo '{{gcp.Meta "network-interfaces/0/ip"}}' | gomplate 10.128.0.23