1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. container
  5. getAttachedVersions
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.container.getAttachedVersions

Explore with Pulumi AI

Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

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]);
Copy
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])
Copy
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
	})
}
Copy
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]),
    };
});
Copy
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]);
    }
}
Copy
variables:
  uswest:
    fn::invoke:
      function: gcp:container:getAttachedVersions
      arguments:
        location: us-west1
        project: my-project
outputs:
  firstAvailableVersion: ${uswest.validVersions[0]}
Copy

Using getAttachedVersions

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 getAttachedVersions(args: GetAttachedVersionsArgs, opts?: InvokeOptions): Promise<GetAttachedVersionsResult>
function getAttachedVersionsOutput(args: GetAttachedVersionsOutputArgs, opts?: InvokeOptions): Output<GetAttachedVersionsResult>
Copy
def get_attached_versions(location: Optional[str] = None,
                          project: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetAttachedVersionsResult
def get_attached_versions_output(location: Optional[pulumi.Input[str]] = None,
                          project: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetAttachedVersionsResult]
Copy
func GetAttachedVersions(ctx *Context, args *GetAttachedVersionsArgs, opts ...InvokeOption) (*GetAttachedVersionsResult, error)
func GetAttachedVersionsOutput(ctx *Context, args *GetAttachedVersionsOutputArgs, opts ...InvokeOption) GetAttachedVersionsResultOutput
Copy

> Note: This function is named GetAttachedVersions in the Go SDK.

public static class GetAttachedVersions 
{
    public static Task<GetAttachedVersionsResult> InvokeAsync(GetAttachedVersionsArgs args, InvokeOptions? opts = null)
    public static Output<GetAttachedVersionsResult> Invoke(GetAttachedVersionsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAttachedVersionsResult> getAttachedVersions(GetAttachedVersionsArgs args, InvokeOptions options)
public static Output<GetAttachedVersionsResult> getAttachedVersions(GetAttachedVersionsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:container/getAttachedVersions:getAttachedVersions
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Location This property is required. string
The location to list versions for.
Project This property is required. string
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.
Location This property is required. string
The location to list versions for.
Project This property is required. string
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.
location This property is required. String
The location to list versions for.
project This property is required. String
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.
location This property is required. string
The location to list versions for.
project This property is required. string
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.
location This property is required. str
The location to list versions for.
project This property is required. str
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.
location This property is required. String
The location to list versions for.
project This property is required. String
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.

getAttachedVersions Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Location string
Project string
ValidVersions List<string>
A list of versions available for use with this project and location.
Id string
The provider-assigned unique ID for this managed resource.
Location string
Project string
ValidVersions []string
A list of versions available for use with this project and location.
id String
The provider-assigned unique ID for this managed resource.
location String
project String
validVersions List<String>
A list of versions available for use with this project and location.
id string
The provider-assigned unique ID for this managed resource.
location string
project string
validVersions string[]
A list of versions available for use with this project and location.
id str
The provider-assigned unique ID for this managed resource.
location str
project str
valid_versions Sequence[str]
A list of versions available for use with this project and location.
id String
The provider-assigned unique ID for this managed resource.
location String
project String
validVersions List<String>
A list of versions available for use with this project and location.

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.
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi