gcp.container.getEngineVersions
Explore with Pulumi AI
Provides access to available Google Kubernetes Engine versions in a zone or region for a given project.
To get more information about GKE versions, see:
If you are using the
gcp.container.getEngineVersionsdatasource with a regional cluster, ensure that you have provided a region as thelocationto the datasource. A region can have a different set of supported versions than its component zones, and not all zones in a region are guaranteed to support the same version.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const central1b = gcp.container.getEngineVersions({
    location: "us-central1-b",
    versionPrefix: "1.12.",
});
const foo = new gcp.container.Cluster("foo", {
    name: "test-cluster",
    location: "us-central1-b",
    nodeVersion: central1b.then(central1b => central1b.latestNodeVersion),
    initialNodeCount: 1,
});
export const stableChannelDefaultVersion = central1b.then(central1b => central1b.releaseChannelDefaultVersion?.STABLE);
export const stableChannelLatestVersion = central1b.then(central1b => central1b.releaseChannelLatestVersion?.STABLE);
import pulumi
import pulumi_gcp as gcp
central1b = gcp.container.get_engine_versions(location="us-central1-b",
    version_prefix="1.12.")
foo = gcp.container.Cluster("foo",
    name="test-cluster",
    location="us-central1-b",
    node_version=central1b.latest_node_version,
    initial_node_count=1)
pulumi.export("stableChannelDefaultVersion", central1b.release_channel_default_version["STABLE"])
pulumi.export("stableChannelLatestVersion", central1b.release_channel_latest_version["STABLE"])
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/container"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		central1b, err := container.GetEngineVersions(ctx, &container.GetEngineVersionsArgs{
			Location:      pulumi.StringRef("us-central1-b"),
			VersionPrefix: pulumi.StringRef("1.12."),
		}, nil)
		if err != nil {
			return err
		}
		_, err = container.NewCluster(ctx, "foo", &container.ClusterArgs{
			Name:             pulumi.String("test-cluster"),
			Location:         pulumi.String("us-central1-b"),
			NodeVersion:      pulumi.String(central1b.LatestNodeVersion),
			InitialNodeCount: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		ctx.Export("stableChannelDefaultVersion", central1b.ReleaseChannelDefaultVersion.STABLE)
		ctx.Export("stableChannelLatestVersion", central1b.ReleaseChannelLatestVersion.STABLE)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var central1b = Gcp.Container.GetEngineVersions.Invoke(new()
    {
        Location = "us-central1-b",
        VersionPrefix = "1.12.",
    });
    var foo = new Gcp.Container.Cluster("foo", new()
    {
        Name = "test-cluster",
        Location = "us-central1-b",
        NodeVersion = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.LatestNodeVersion),
        InitialNodeCount = 1,
    });
    return new Dictionary<string, object?>
    {
        ["stableChannelDefaultVersion"] = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.ReleaseChannelDefaultVersion?.STABLE),
        ["stableChannelLatestVersion"] = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.ReleaseChannelLatestVersion?.STABLE),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.container.ContainerFunctions;
import com.pulumi.gcp.container.inputs.GetEngineVersionsArgs;
import com.pulumi.gcp.container.Cluster;
import com.pulumi.gcp.container.ClusterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var central1b = ContainerFunctions.getEngineVersions(GetEngineVersionsArgs.builder()
            .location("us-central1-b")
            .versionPrefix("1.12.")
            .build());
        var foo = new Cluster("foo", ClusterArgs.builder()
            .name("test-cluster")
            .location("us-central1-b")
            .nodeVersion(central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.latestNodeVersion()))
            .initialNodeCount(1)
            .build());
        ctx.export("stableChannelDefaultVersion", central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.releaseChannelDefaultVersion().STABLE()));
        ctx.export("stableChannelLatestVersion", central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.releaseChannelLatestVersion().STABLE()));
    }
}
resources:
  foo:
    type: gcp:container:Cluster
    properties:
      name: test-cluster
      location: us-central1-b
      nodeVersion: ${central1b.latestNodeVersion}
      initialNodeCount: 1
variables:
  central1b:
    fn::invoke:
      function: gcp:container:getEngineVersions
      arguments:
        location: us-central1-b
        versionPrefix: 1.12.
outputs:
  stableChannelDefaultVersion: ${central1b.releaseChannelDefaultVersion.STABLE}
  stableChannelLatestVersion: ${central1b.releaseChannelLatestVersion.STABLE}
Using getEngineVersions
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEngineVersions(args: GetEngineVersionsArgs, opts?: InvokeOptions): Promise<GetEngineVersionsResult>
function getEngineVersionsOutput(args: GetEngineVersionsOutputArgs, opts?: InvokeOptions): Output<GetEngineVersionsResult>def get_engine_versions(location: Optional[str] = None,
                        project: Optional[str] = None,
                        version_prefix: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetEngineVersionsResult
def get_engine_versions_output(location: Optional[pulumi.Input[str]] = None,
                        project: Optional[pulumi.Input[str]] = None,
                        version_prefix: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetEngineVersionsResult]func GetEngineVersions(ctx *Context, args *GetEngineVersionsArgs, opts ...InvokeOption) (*GetEngineVersionsResult, error)
func GetEngineVersionsOutput(ctx *Context, args *GetEngineVersionsOutputArgs, opts ...InvokeOption) GetEngineVersionsResultOutput> Note: This function is named GetEngineVersions in the Go SDK.
public static class GetEngineVersions 
{
    public static Task<GetEngineVersionsResult> InvokeAsync(GetEngineVersionsArgs args, InvokeOptions? opts = null)
    public static Output<GetEngineVersionsResult> Invoke(GetEngineVersionsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetEngineVersionsResult> getEngineVersions(GetEngineVersionsArgs args, InvokeOptions options)
public static Output<GetEngineVersionsResult> getEngineVersions(GetEngineVersionsArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:container/getEngineVersions:getEngineVersions
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Location string
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- Project string
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- VersionPrefix string
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
- Location string
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- Project string
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- VersionPrefix string
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
- location String
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- project String
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- versionPrefix String
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
- location string
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- project string
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- versionPrefix string
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
- location str
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- project str
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- version_prefix str
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
- location String
- The location (region or zone) to list versions for.
Must exactly match the location the cluster will be deployed in, or listed
versions may not be available. If location,region, andzoneare not specified, the provider-level zone must be set and is used instead.
- project String
- ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
- versionPrefix String
- If provided, the provider will only return versions
that match the string prefix. For example, 1.11.will match all1.11series releases. Since this is just a string match, it's recommended that you append a.after minor versions to ensure that prefixes such as1.1don't match versions like1.12.5-gke.10accidentally. See the docs on versioning schema for full details on how version strings are formatted.
getEngineVersions Result
The following output properties are available:
- DefaultCluster stringVersion 
- Version of Kubernetes the service deploys by default.
- Id string
- The provider-assigned unique ID for this managed resource.
- LatestMaster stringVersion 
- The latest version available in the given zone for use with master instances.
- LatestNode stringVersion 
- The latest version available in the given zone for use with node instances.
- ReleaseChannel Dictionary<string, string>Default Version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- ReleaseChannel Dictionary<string, string>Latest Version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- ValidMaster List<string>Versions 
- A list of versions available in the given zone for use with master instances.
- ValidNode List<string>Versions 
- A list of versions available in the given zone for use with node instances.
- Location string
- Project string
- VersionPrefix string
- DefaultCluster stringVersion 
- Version of Kubernetes the service deploys by default.
- Id string
- The provider-assigned unique ID for this managed resource.
- LatestMaster stringVersion 
- The latest version available in the given zone for use with master instances.
- LatestNode stringVersion 
- The latest version available in the given zone for use with node instances.
- ReleaseChannel map[string]stringDefault Version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- ReleaseChannel map[string]stringLatest Version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- ValidMaster []stringVersions 
- A list of versions available in the given zone for use with master instances.
- ValidNode []stringVersions 
- A list of versions available in the given zone for use with node instances.
- Location string
- Project string
- VersionPrefix string
- defaultCluster StringVersion 
- Version of Kubernetes the service deploys by default.
- id String
- The provider-assigned unique ID for this managed resource.
- latestMaster StringVersion 
- The latest version available in the given zone for use with master instances.
- latestNode StringVersion 
- The latest version available in the given zone for use with node instances.
- releaseChannel Map<String,String>Default Version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- releaseChannel Map<String,String>Latest Version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- validMaster List<String>Versions 
- A list of versions available in the given zone for use with master instances.
- validNode List<String>Versions 
- A list of versions available in the given zone for use with node instances.
- location String
- project String
- versionPrefix String
- defaultCluster stringVersion 
- Version of Kubernetes the service deploys by default.
- id string
- The provider-assigned unique ID for this managed resource.
- latestMaster stringVersion 
- The latest version available in the given zone for use with master instances.
- latestNode stringVersion 
- The latest version available in the given zone for use with node instances.
- releaseChannel {[key: string]: string}Default Version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- releaseChannel {[key: string]: string}Latest Version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- validMaster string[]Versions 
- A list of versions available in the given zone for use with master instances.
- validNode string[]Versions 
- A list of versions available in the given zone for use with node instances.
- location string
- project string
- versionPrefix string
- default_cluster_ strversion 
- Version of Kubernetes the service deploys by default.
- id str
- The provider-assigned unique ID for this managed resource.
- latest_master_ strversion 
- The latest version available in the given zone for use with master instances.
- latest_node_ strversion 
- The latest version available in the given zone for use with node instances.
- release_channel_ Mapping[str, str]default_ version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- release_channel_ Mapping[str, str]latest_ version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- valid_master_ Sequence[str]versions 
- A list of versions available in the given zone for use with master instances.
- valid_node_ Sequence[str]versions 
- A list of versions available in the given zone for use with node instances.
- location str
- project str
- version_prefix str
- defaultCluster StringVersion 
- Version of Kubernetes the service deploys by default.
- id String
- The provider-assigned unique ID for this managed resource.
- latestMaster StringVersion 
- The latest version available in the given zone for use with master instances.
- latestNode StringVersion 
- The latest version available in the given zone for use with node instances.
- releaseChannel Map<String>Default Version 
- A map from a release channel name to the channel's default version. See the docs on available release channel names for more details.
- releaseChannel Map<String>Latest Version 
- A map from a release channel name to the channel's latest version. See the docs on available release channel names for more details.
- validMaster List<String>Versions 
- A list of versions available in the given zone for use with master instances.
- validNode List<String>Versions 
- A list of versions available in the given zone for use with node instances.
- location String
- project String
- versionPrefix String
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the google-betaTerraform Provider.