get Engine Versions
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
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()));
}
}
Return
A collection of values returned by getEngineVersions.
Parameters
A collection of arguments for invoking getEngineVersions.
Return
A collection of values returned by getEngineVersions.
Parameters
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
, and zone
are not specified, the provider-level zone must be set and is used instead.
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.
If provided, the provider will only return versions that match the string prefix. For example, 1.11.
will match all 1.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 as 1.1
don't match versions like 1.12.5-gke.10
accidentally. See the docs on versioning schema for full details on how version strings are formatted.
See also
Return
A collection of values returned by getEngineVersions.
Parameters
Builder for com.pulumi.gcp.container.kotlin.inputs.GetEngineVersionsPlainArgs.