google_clouddeploy_automation

An Automation enables the automation of manually driven actions for a Delivery Pipeline, which includes Release promotion amongst Targets, Rollout repair and Rollout deployment strategy advancement.

To get more information about Automation, see:

Example Usage - Clouddeploy Automation Basic

resource "google_clouddeploy_automation" "b-automation" {
  name     = "cd-automation"
  project = google_clouddeploy_delivery_pipeline.pipeline.project
  location = google_clouddeploy_delivery_pipeline.pipeline.location
  delivery_pipeline = google_clouddeploy_delivery_pipeline.pipeline.name
  service_account = "my@service-account.com"
  selector {
    targets {
      id = "*"
    }
  }
  suspended = false
  rules {
    promote_release_rule {
      id = "promote-release"
    }
  }
}

resource "google_clouddeploy_delivery_pipeline" "pipeline" {
  name = "cd-pipeline"
  location = "us-central1"
  serial_pipeline  {
    stages {
      target_id = "test"
      profiles = []
    }
  }
 }

Example Usage - Clouddeploy Automation Full

resource "google_clouddeploy_automation" "f-automation" {
  name     = "cd-automation"
  location = "us-central1"
  delivery_pipeline = google_clouddeploy_delivery_pipeline.pipeline.name
  service_account = "my@service-account.com"
  annotations = {
    my_first_annotation = "example-annotation-1"
    my_second_annotation = "example-annotation-2"
  }
  labels = {
    my_first_label = "example-label-1"
    my_second_label = "example-label-2"
  }
  description = "automation resource"
  selector {
    targets {
      id = "test"
      labels = {
        foo = "bar"
      }
    }
  }
  suspended = true
  rules {
    promote_release_rule{
      id = "promote-release"
      wait = "200s"
      destination_target_id = "@next"
      destination_phase = "stable"
    }
  }
  rules {
    advance_rollout_rule {
      id                    = "advance-rollout"
      source_phases         = ["deploy"]
      wait                  = "200s"
    }
  }
}

resource "google_clouddeploy_delivery_pipeline" "pipeline" {
  name = "cd-pipeline"
  location = "us-central1"
  serial_pipeline  {
    stages {
      target_id = "test"
      profiles = ["test-profile"]
    }
  }
}

Argument Reference

The following arguments are supported:

The selector block supports:

The targets block supports:

The rules block supports:

The promote_release_rule block supports:

The advance_rollout_rule block supports:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Automation can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Automation using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/deliveryPipelines/{{delivery_pipeline}}/automations/{{name}}"
  to = google_clouddeploy_automation.default
}

When using the terraform import command, Automation can be imported using one of the formats above. For example:

$ terraform import google_clouddeploy_automation.default projects/{{project}}/locations/{{location}}/deliveryPipelines/{{delivery_pipeline}}/automations/{{name}}
$ terraform import google_clouddeploy_automation.default {{project}}/{{location}}/{{delivery_pipeline}}/{{name}}
$ terraform import google_clouddeploy_automation.default {{location}}/{{delivery_pipeline}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.