https://pulumi.com logo
#general
Title
# general
m

millions-lunch-7967

11/17/2021, 6:38 PM
@here - how do I create an environment for running orchestration tasks. In terraform, I can do this
Copy code
resource "google_composer_environment" "test" {
  name   = "example-composer-env"
  region = "us-central1"
  config {
    node_count = 4

    node_config {
      zone         = "us-central1-a"
      machine_type = "n1-standard-1"

      network    = google_compute_network.test.id
      subnetwork = google_compute_subnetwork.test.id

      service_account = google_service_account.test.name
    }

    database_config {
      machine_type = "db-n1-standard-2"
    }

    web_server_config {
      machine_type = "composer-n1-webserver-2"
    }
  }
}
b

billowy-army-68599

11/17/2021, 6:42 PM
Hi Sree, I ran this through tf2pulumi: https://www.pulumi.com/tf2pulumi/ and got this, in TypeScript:
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const test = new gcp.composer.Environment("test", {
    region: "us-central1",
    config: {
        nodeCount: 4,
        nodeConfig: {
            zone: "us-central1-a",
            machineType: "n1-standard-1",
            network: google_compute_network.test.id,
            subnetwork: google_compute_subnetwork.test.id,
            serviceAccount: google_service_account.test.name,
        },
        databaseConfig: [{
            machineType: "db-n1-standard-2",
        }],
        webServerConfig: [{
            machineType: "composer-n1-webserver-2",
        }],
    },
});
🎉 2
if you need another language, choose it in tf2pulumi
m

millions-lunch-7967

11/17/2021, 6:45 PM
perfect. thanks so much
6 Views