Module composer
This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.
Resources
Functions
Others
Resources
Resource Environment
class Environment extends CustomResourceAn environment for running orchestration tasks.
Environments run Apache Airflow software on Google infrastructure.
To get more information about Environments, see:
- API documentation
- How-to Guides
- Apache Airflow Documentation
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
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const testNetwork = new gcp.compute.Network("testNetwork", {autoCreateSubnetworks: false});
const testSubnetwork = new gcp.compute.Subnetwork("testSubnetwork", {
ipCidrRange: "10.2.0.0/16",
region: "us-central1",
network: testNetwork.id,
});
const testAccount = new gcp.serviceAccount.Account("testAccount", {
accountId: "composer-env-account",
displayName: "Test Service Account for Composer Environment",
});
const composerWorker = new gcp.projects.IAMMember("composer-worker", {
role: "roles/composer.worker",
member: pulumi.interpolate`serviceAccount:${testAccount.email}`,
});
const testEnvironment = new gcp.composer.Environment("testEnvironment", {
region: "us-central1",
config: {
nodeCount: 4,
node_config: {
zone: "us-central1-a",
machineType: "n1-standard-1",
network: testNetwork.id,
subnetwork: testSubnetwork.id,
serviceAccount: testAccount.name,
},
},
});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",
});constructor
new Environment(name: string, args?: EnvironmentArgs, opts?: pulumi.CustomResourceOptions)Create a Environment resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA 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): EnvironmentGet 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 | undefinedmethod isInstance
public static isInstance(obj: any): obj is EnvironmentReturns 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<EnvironmentConfig>;Configuration parameters for this environment Structure is documented below.
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>;User-defined labels for this environment. The labels map can contain
no more than 64 entries. Entries of the labels map are UTF8 strings
that comply with the following restrictions:
Label keys must be between 1 and 63 characters long and must conform
to the following regular expression: a-z?.
Label values must be between 0 and 63 characters long and must
conform to the regular expression (a-z?)?.
No more than 64 labels can be associated with a given environment.
Both keys and values must be <= 128 bytes in size.
property name
public name: pulumi.Output<string>;Name of the environment
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>;The location or Compute Engine region for the environment.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Functions
Function getImageVersions
getImageVersions(args?: GetImageVersionsArgs, opts?: pulumi.InvokeOptions): Promise<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", {
region: "us-central1",
config: {
software_config: {
imageVersion: all.then(all => all.imageVersions[0].imageVersionId),
},
},
});Others
interface EnvironmentArgs
interface EnvironmentArgsThe set of arguments for constructing a Environment resource.
property config
config?: pulumi.Input<EnvironmentConfig>;Configuration parameters for this environment Structure is documented below.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;User-defined labels for this environment. The labels map can contain
no more than 64 entries. Entries of the labels map are UTF8 strings
that comply with the following restrictions:
Label keys must be between 1 and 63 characters long and must conform
to the following regular expression: a-z?.
Label values must be between 0 and 63 characters long and must
conform to the regular expression (a-z?)?.
No more than 64 labels can be associated with a given environment.
Both keys and values must be <= 128 bytes in size.
property name
name?: pulumi.Input<string>;Name of the environment
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>;The location or Compute Engine region for the environment.
interface EnvironmentState
interface EnvironmentStateInput properties used for looking up and filtering Environment resources.
property config
config?: pulumi.Input<EnvironmentConfig>;Configuration parameters for this environment Structure is documented below.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;User-defined labels for this environment. The labels map can contain
no more than 64 entries. Entries of the labels map are UTF8 strings
that comply with the following restrictions:
Label keys must be between 1 and 63 characters long and must conform
to the following regular expression: a-z?.
Label values must be between 0 and 63 characters long and must
conform to the regular expression (a-z?)?.
No more than 64 labels can be associated with a given environment.
Both keys and values must be <= 128 bytes in size.
property name
name?: pulumi.Input<string>;Name of the environment
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>;The location or Compute Engine region for the environment.
interface GetImageVersionsArgs
interface GetImageVersionsArgsA 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 GetImageVersionsResultA collection of values returned by getImageVersions.
property id
id: string;The provider-assigned unique ID for this managed resource.
property imageVersions
imageVersions: 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;