Module composer

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

Resources

Data Sources

Others

Resources

Resource Environment

class Environment extends CustomResource

An environment for running orchestration tasks.

Environments run Apache Airflow software on Google infrastructure.

To get more information about Environments, see:

Warning: We STRONGLY recommend you read the GCP guides as the Environment resource requires a long deployment process and involves several layers of GCP infrastructure, including a Kubernetes Engine cluster, Cloud Storage, and Compute networking resources. Due to limitations of the API, this provider will not be able to automatically find or manage many of these underlying resources. In particular: * It can take up to one hour to create or update an environment resource. In addition, GCP may only detect some errors in configuration when they are used (e.g. ~40-50 minutes into the creation process), and is prone to limited error reporting. If you encounter confusing or uninformative errors, please verify your configuration is valid against GCP Cloud Composer before filing bugs against this provider. * Environments create Google Cloud Storage buckets that do not get cleaned up automatically on environment deletion. More about Composer’s use of Cloud Storage.

Example Usage

Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const test = new gcp.composer.Environment("test", {
    region: "us-central1",
});
With GKE and Compute Resource Dependencies

NOTE To use service accounts, you need to give role/composer.worker to the service account on any resources that may be created for the environment (i.e. at a project level). This will probably require an explicit dependency on the IAM policy binding (see gcp.projects.IAMMember below).

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const testNetwork = new gcp.compute.Network("test", {
    autoCreateSubnetworks: false,
});
const testAccount = new gcp.serviceAccount.Account("test", {
    accountId: "composer-env-account",
    displayName: "Test Service Account for Composer Environment",
});
const testSubnetwork = new gcp.compute.Subnetwork("test", {
    ipCidrRange: "10.2.0.0/16",
    network: testNetwork.selfLink,
    region: "us-central1",
});
const composerWorker = new gcp.projects.IAMMember("composer-worker", {
    member: pulumi.interpolate`serviceAccount:${testAccount.email}`,
    role: "roles/composer.worker",
});
const testEnvironment = new gcp.composer.Environment("test", {
    config: {
        nodeConfig: {
            machineType: "n1-standard-1",
            network: testNetwork.selfLink,
            serviceAccount: testAccount.name,
            subnetwork: testSubnetwork.selfLink,
            zone: "us-central1-a",
        },
        nodeCount: 4,
    },
    region: "us-central1",
}, {dependsOn: [composerWorker]});
With Software (Airflow) Config
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const test = new gcp.composer.Environment("test", {
    config: {
        softwareConfig: {
            airflowConfigOverrides: {
                "core-load_example": "True",
            },
            envVariables: {
                FOO: "bar",
            },
            pypiPackages: {
                numpy: "",
                scipy: "==1.1.0",
            },
        },
    },
    region: "us-central1",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/composer_environment.html.markdown.

constructor

new Environment(name: string, args?: EnvironmentArgs, opts?: pulumi.CustomResourceOptions)

Create a Environment resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EnvironmentState, opts?: pulumi.CustomResourceOptions): Environment

Get an existing Environment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Environment. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property config

public config: pulumi.Output<outputs.composer.EnvironmentConfig>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string | undefined>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Data Sources

Data Source getImageVersions

getImageVersions(args?: GetImageVersionsArgs, opts?: pulumi.InvokeOptions): Promise<GetImageVersionsResult> & GetImageVersionsResult

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", {
    config: {
        softwareConfig: {
            imageVersion: all.imageVersions[0].imageVersionId,
        },
    },
    region: "us-central1",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/d/composer_image_versions.html.markdown.

Others

interface EnvironmentArgs

interface EnvironmentArgs

The set of arguments for constructing a Environment resource.

property config

config?: pulumi.Input<inputs.composer.EnvironmentConfig>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

region?: pulumi.Input<string>;

interface EnvironmentState

interface EnvironmentState

Input properties used for looking up and filtering Environment resources.

property config

config?: pulumi.Input<inputs.composer.EnvironmentConfig>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

region?: pulumi.Input<string>;

interface GetImageVersionsArgs

interface GetImageVersionsArgs

A collection of arguments for invoking getImageVersions.

property project

project?: undefined | string;

The ID of the project to list versions in. If it is not provided, the provider project is used.

property region

region?: undefined | string;

The location to list versions in. If it is not provider, the provider region is used.

interface GetImageVersionsResult

interface GetImageVersionsResult

A collection of values returned by getImageVersions.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property imageVersions

imageVersions: outputs.composer.GetImageVersionsImageVersion[];

A list of composer image versions available in the given project and location. Each imageVersion contains:

property project

project: string;

property region

region: string;