get Attached Versions
Provides access to available platform versions in a location for a given project.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const uswest = gcp.container.getAttachedVersions({
location: "us-west1",
project: "my-project",
});
export const firstAvailableVersion = uswest.then(uswest => uswest.validVersions?.[0]);
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
uswest = gcp.container.get_attached_versions(location="us-west1",
project="my-project")
pulumi.export("firstAvailableVersion", uswest.valid_versions[0])
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var uswest = Gcp.Container.GetAttachedVersions.Invoke(new()
{
Location = "us-west1",
Project = "my-project",
});
return new Dictionary<string, object?>
{
["firstAvailableVersion"] = uswest.Apply(getAttachedVersionsResult => getAttachedVersionsResult.ValidVersions[0]),
};
});
Content copied to clipboard
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 {
uswest, err := container.GetAttachedVersions(ctx, &container.GetAttachedVersionsArgs{
Location: "us-west1",
Project: "my-project",
}, nil)
if err != nil {
return err
}
ctx.Export("firstAvailableVersion", uswest.ValidVersions[0])
return nil
})
}
Content copied to clipboard
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.GetAttachedVersionsArgs;
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 uswest = ContainerFunctions.getAttachedVersions(GetAttachedVersionsArgs.builder()
.location("us-west1")
.project("my-project")
.build());
ctx.export("firstAvailableVersion", uswest.validVersions()[0]);
}
}
Content copied to clipboard
variables:
uswest:
fn::invoke:
function: gcp:container:getAttachedVersions
arguments:
location: us-west1
project: my-project
outputs:
firstAvailableVersion: ${uswest.validVersions[0]}
Content copied to clipboard
Return
A collection of values returned by getAttachedVersions.
Parameters
argument
A collection of arguments for invoking getAttachedVersions.
Return
A collection of values returned by getAttachedVersions.
Parameters
location
The location to list versions for.
project
ID of the project to list available platform versions for. Should match the project the cluster will be deployed to. Defaults to the project that the provider is authenticated with.
See also
suspend fun getAttachedVersions(argument: suspend GetAttachedVersionsPlainArgsBuilder.() -> Unit): GetAttachedVersionsResult
Return
A collection of values returned by getAttachedVersions.
Parameters
argument
Builder for com.pulumi.gcp.container.kotlin.inputs.GetAttachedVersionsPlainArgs.