Google Cloud v8.21.0 published on Wednesday, Mar 5, 2025 by Pulumi
gcp.composer.getImageVersions
Explore with Pulumi AI
Provides access to available Cloud Composer versions in a region for a given project.
To get more information about Composer Image Versions, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const all = gcp.composer.getImageVersions({});
const test = new gcp.composer.Environment("test", {
    name: "test-env",
    region: "us-central1",
    config: {
        softwareConfig: {
            imageVersion: all.then(all => all.imageVersions?.[0]?.imageVersionId),
        },
    },
});
import pulumi
import pulumi_gcp as gcp
all = gcp.composer.get_image_versions()
test = gcp.composer.Environment("test",
    name="test-env",
    region="us-central1",
    config={
        "software_config": {
            "image_version": all.image_versions[0].image_version_id,
        },
    })
package main
import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/composer"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		all, err := composer.GetImageVersions(ctx, &composer.GetImageVersionsArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = composer.NewEnvironment(ctx, "test", &composer.EnvironmentArgs{
			Name:   pulumi.String("test-env"),
			Region: pulumi.String("us-central1"),
			Config: &composer.EnvironmentConfigArgs{
				SoftwareConfig: &composer.EnvironmentConfigSoftwareConfigArgs{
					ImageVersion: pulumi.String(all.ImageVersions[0].ImageVersionId),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() => 
{
    var all = Gcp.Composer.GetImageVersions.Invoke();
    var test = new Gcp.Composer.Environment("test", new()
    {
        Name = "test-env",
        Region = "us-central1",
        Config = new Gcp.Composer.Inputs.EnvironmentConfigArgs
        {
            SoftwareConfig = new Gcp.Composer.Inputs.EnvironmentConfigSoftwareConfigArgs
            {
                ImageVersion = all.Apply(getImageVersionsResult => getImageVersionsResult.ImageVersions[0]?.ImageVersionId),
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.composer.ComposerFunctions;
import com.pulumi.gcp.composer.inputs.GetImageVersionsArgs;
import com.pulumi.gcp.composer.Environment;
import com.pulumi.gcp.composer.EnvironmentArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigArgs;
import com.pulumi.gcp.composer.inputs.EnvironmentConfigSoftwareConfigArgs;
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 all = ComposerFunctions.getImageVersions();
        var test = new Environment("test", EnvironmentArgs.builder()
            .name("test-env")
            .region("us-central1")
            .config(EnvironmentConfigArgs.builder()
                .softwareConfig(EnvironmentConfigSoftwareConfigArgs.builder()
                    .imageVersion(all.applyValue(getImageVersionsResult -> getImageVersionsResult.imageVersions()[0].imageVersionId()))
                    .build())
                .build())
            .build());
    }
}
resources:
  test:
    type: gcp:composer:Environment
    properties:
      name: test-env
      region: us-central1
      config:
        softwareConfig:
          imageVersion: ${all.imageVersions[0].imageVersionId}
variables:
  all:
    fn::invoke:
      function: gcp:composer:getImageVersions
      arguments: {}
Using getImageVersions
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 getImageVersions(args: GetImageVersionsArgs, opts?: InvokeOptions): Promise<GetImageVersionsResult>
function getImageVersionsOutput(args: GetImageVersionsOutputArgs, opts?: InvokeOptions): Output<GetImageVersionsResult>def get_image_versions(project: Optional[str] = None,
                       region: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetImageVersionsResult
def get_image_versions_output(project: Optional[pulumi.Input[str]] = None,
                       region: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetImageVersionsResult]func GetImageVersions(ctx *Context, args *GetImageVersionsArgs, opts ...InvokeOption) (*GetImageVersionsResult, error)
func GetImageVersionsOutput(ctx *Context, args *GetImageVersionsOutputArgs, opts ...InvokeOption) GetImageVersionsResultOutput> Note: This function is named GetImageVersions in the Go SDK.
public static class GetImageVersions 
{
    public static Task<GetImageVersionsResult> InvokeAsync(GetImageVersionsArgs args, InvokeOptions? opts = null)
    public static Output<GetImageVersionsResult> Invoke(GetImageVersionsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetImageVersionsResult> getImageVersions(GetImageVersionsArgs args, InvokeOptions options)
public static Output<GetImageVersionsResult> getImageVersions(GetImageVersionsArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:composer/getImageVersions:getImageVersions
  arguments:
    # arguments dictionaryThe following arguments are supported:
getImageVersions Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageVersions List<GetImage Versions Image Version> 
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- Project string
- Region string
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageVersions []GetImage Versions Image Version 
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- Project string
- Region string
- id String
- The provider-assigned unique ID for this managed resource.
- imageVersions List<GetImage Versions Image Version> 
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- project String
- region String
- id string
- The provider-assigned unique ID for this managed resource.
- imageVersions GetImage Versions Image Version[] 
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- project string
- region string
- id str
- The provider-assigned unique ID for this managed resource.
- image_versions Sequence[GetImage Versions Image Version] 
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- project str
- region str
- id String
- The provider-assigned unique ID for this managed resource.
- imageVersions List<Property Map>
- A list of composer image versions available in the given project and location. Each image_versioncontains:
- project String
- region String
Supporting Types
GetImageVersionsImageVersion    
- ImageVersion stringId 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- SupportedPython List<string>Versions 
- Supported python versions for this image version
- ImageVersion stringId 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- SupportedPython []stringVersions 
- Supported python versions for this image version
- imageVersion StringId 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supportedPython List<String>Versions 
- Supported python versions for this image version
- imageVersion stringId 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supportedPython string[]Versions 
- Supported python versions for this image version
- image_version_ strid 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supported_python_ Sequence[str]versions 
- Supported python versions for this image version
- imageVersion StringId 
- The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supportedPython List<String>Versions 
- Supported python versions for this image version
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the google-betaTerraform Provider.