Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi
gcp.composer.getImageVersions
Explore with Pulumi AI
Provides access to available Cloud Composer versions in a region for a given project.
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, nil, 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:composer/getImageVersions:getImageVersions
arguments:
# arguments dictionary
The following arguments are supported:
getImageVersions Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Versions List<GetImage Versions Image Version> - A list of composer image versions available in the given project and location. Each
image_version
contains: - Project string
- Region string
- Id string
- The provider-assigned unique ID for this managed resource.
- Image
Versions []GetImage Versions Image Version - A list of composer image versions available in the given project and location. Each
image_version
contains: - Project string
- Region string
- id String
- The provider-assigned unique ID for this managed resource.
- image
Versions List<GetImage Versions Image Version> - A list of composer image versions available in the given project and location. Each
image_version
contains: - project String
- region String
- id string
- The provider-assigned unique ID for this managed resource.
- image
Versions GetImage Versions Image Version[] - A list of composer image versions available in the given project and location. Each
image_version
contains: - 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_version
contains: - project str
- region str
- id String
- The provider-assigned unique ID for this managed resource.
- image
Versions List<Property Map> - A list of composer image versions available in the given project and location. Each
image_version
contains: - project String
- region String
Supporting Types
GetImageVersionsImageVersion
- Image
Version stringId - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- Supported
Python List<string>Versions - Supported python versions for this image version
- Image
Version stringId - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- Supported
Python []stringVersions - Supported python versions for this image version
- image
Version StringId - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supported
Python List<String>Versions - Supported python versions for this image version
- image
Version stringId - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supported
Python 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
- image
Version StringId - The string identifier of the image version, in the form: "composer-x.y.z-airflow-a.b.c"
- supported
Python 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-beta
Terraform Provider.