@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
164 lines (163 loc) • 7.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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:
* * [The API reference](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations/getServerConfig)
*
* > If you are using the `gcp.container.getEngineVersions` datasource with a
* regional cluster, ensure that you have provided a region as the `location` 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
*
* ```typescript
* 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);
* ```
*/
export declare function getEngineVersions(args?: GetEngineVersionsArgs, opts?: pulumi.InvokeOptions): Promise<GetEngineVersionsResult>;
/**
* A collection of arguments for invoking getEngineVersions.
*/
export interface GetEngineVersionsArgs {
/**
* 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.
*/
location?: 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.
*/
project?: string;
/**
* 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](https://cloud.google.com/kubernetes-engine/versioning-and-upgrades#versioning_scheme)
* for full details on how version strings are formatted.
*/
versionPrefix?: string;
}
/**
* A collection of values returned by getEngineVersions.
*/
export interface GetEngineVersionsResult {
/**
* Version of Kubernetes the service deploys by default.
*/
readonly defaultClusterVersion: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* The latest version available in the given zone for use with master instances.
*/
readonly latestMasterVersion: string;
/**
* The latest version available in the given zone for use with node instances.
*/
readonly latestNodeVersion: string;
readonly location?: string;
readonly project?: string;
/**
* A map from a release channel name to the channel's default version. See the docs on [available release channel names](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.Channel_1) for more details.
*/
readonly releaseChannelDefaultVersion: {
[key: string]: string;
};
/**
* A map from a release channel name to the channel's latest version. See the docs on [available release channel names](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters#Cluster.Channel_1) for more details.
*/
readonly releaseChannelLatestVersion: {
[key: string]: string;
};
/**
* A list of versions available in the given zone for use with master instances.
*/
readonly validMasterVersions: string[];
/**
* A list of versions available in the given zone for use with node instances.
*/
readonly validNodeVersions: string[];
readonly versionPrefix?: string;
}
/**
* 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:
* * [The API reference](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations/getServerConfig)
*
* > If you are using the `gcp.container.getEngineVersions` datasource with a
* regional cluster, ensure that you have provided a region as the `location` 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
*
* ```typescript
* 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);
* ```
*/
export declare function getEngineVersionsOutput(args?: GetEngineVersionsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetEngineVersionsResult>;
/**
* A collection of arguments for invoking getEngineVersions.
*/
export interface GetEngineVersionsOutputArgs {
/**
* 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.
*/
location?: pulumi.Input<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.
*/
project?: pulumi.Input<string>;
/**
* 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](https://cloud.google.com/kubernetes-engine/versioning-and-upgrades#versioning_scheme)
* for full details on how version strings are formatted.
*/
versionPrefix?: pulumi.Input<string>;
}