gcp.container.getEngineVersions
Explore with Pulumi AI
Provides access to available Google Kubernetes Engine versions in a zone or region for a given project.
If you are using the
gcp.container.getEngineVersions
datasource with a regional cluster, ensure that you have provided a region as thelocation
to 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
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()
{
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 main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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{
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
})
}
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()
.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()));
}
}
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",
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"])
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", {
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);
resources:
foo:
type: gcp:container:Cluster
properties:
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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:container/getEngineVersions:getEngineVersions
arguments:
# arguments dictionary
The 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
, andzone
are 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.
- Version
Prefix string If provided, the provider will only return versions that match the string prefix. For example,
1.11.
will match all1.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. 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
, andzone
are 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.
- Version
Prefix string If provided, the provider will only return versions that match the string prefix. For example,
1.11.
will match all1.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. 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
, andzone
are 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.
- version
Prefix String If provided, the provider will only return versions that match the string prefix. For example,
1.11.
will match all1.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. 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
, andzone
are 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.
- version
Prefix string If provided, the provider will only return versions that match the string prefix. For example,
1.11.
will match all1.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. 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
, andzone
are 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.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. 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
, andzone
are 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.
- version
Prefix String If provided, the provider will only return versions that match the string prefix. For example,
1.11.
will match all1.11
series releases. Since this is just a string match, it's recommended that you append a.
after minor versions to ensure that prefixes such as1.1
don't match versions like1.12.5-gke.10
accidentally. See the docs on versioning schema for full details on how version strings are formatted.
getEngineVersions Result
The following output properties are available:
- Default
Cluster stringVersion Version of Kubernetes the service deploys by default.
- Id string
The provider-assigned unique ID for this managed resource.
- Latest
Master stringVersion The latest version available in the given zone for use with master instances.
- Latest
Node stringVersion The latest version available in the given zone for use with node instances.
- Release
Channel Dictionary<string, string>Default Version A map from a release channel name to the channel's default version.
- Release
Channel Dictionary<string, string>Latest Version A map from a release channel name to the channel's latest version.
- Valid
Master List<string>Versions A list of versions available in the given zone for use with master instances.
- Valid
Node List<string>Versions A list of versions available in the given zone for use with node instances.
- Location string
- Project string
- Version
Prefix string
- Default
Cluster stringVersion Version of Kubernetes the service deploys by default.
- Id string
The provider-assigned unique ID for this managed resource.
- Latest
Master stringVersion The latest version available in the given zone for use with master instances.
- Latest
Node stringVersion The latest version available in the given zone for use with node instances.
- Release
Channel map[string]stringDefault Version A map from a release channel name to the channel's default version.
- Release
Channel map[string]stringLatest Version A map from a release channel name to the channel's latest version.
- Valid
Master []stringVersions A list of versions available in the given zone for use with master instances.
- Valid
Node []stringVersions A list of versions available in the given zone for use with node instances.
- Location string
- Project string
- Version
Prefix string
- default
Cluster StringVersion Version of Kubernetes the service deploys by default.
- id String
The provider-assigned unique ID for this managed resource.
- latest
Master StringVersion The latest version available in the given zone for use with master instances.
- latest
Node StringVersion The latest version available in the given zone for use with node instances.
- release
Channel Map<String,String>Default Version A map from a release channel name to the channel's default version.
- release
Channel Map<String,String>Latest Version A map from a release channel name to the channel's latest version.
- valid
Master List<String>Versions A list of versions available in the given zone for use with master instances.
- valid
Node List<String>Versions A list of versions available in the given zone for use with node instances.
- location String
- project String
- version
Prefix String
- default
Cluster stringVersion Version of Kubernetes the service deploys by default.
- id string
The provider-assigned unique ID for this managed resource.
- latest
Master stringVersion The latest version available in the given zone for use with master instances.
- latest
Node stringVersion The latest version available in the given zone for use with node instances.
- release
Channel {[key: string]: string}Default Version A map from a release channel name to the channel's default version.
- release
Channel {[key: string]: string}Latest Version A map from a release channel name to the channel's latest version.
- valid
Master string[]Versions A list of versions available in the given zone for use with master instances.
- valid
Node string[]Versions A list of versions available in the given zone for use with node instances.
- location string
- project string
- version
Prefix 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.
- release_
channel_ Mapping[str, str]latest_ version A map from a release channel name to the channel's latest version.
- 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
- default
Cluster StringVersion Version of Kubernetes the service deploys by default.
- id String
The provider-assigned unique ID for this managed resource.
- latest
Master StringVersion The latest version available in the given zone for use with master instances.
- latest
Node StringVersion The latest version available in the given zone for use with node instances.
- release
Channel Map<String>Default Version A map from a release channel name to the channel's default version.
- release
Channel Map<String>Latest Version A map from a release channel name to the channel's latest version.
- valid
Master List<String>Versions A list of versions available in the given zone for use with master instances.
- valid
Node List<String>Versions A list of versions available in the given zone for use with node instances.
- location String
- project String
- version
Prefix String
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.