import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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: * * * [API documentation](https://cloud.google.com/deploy/docs/api/reference/rest/v1/projects.locations.deliveryPipelines.automations) * * How-to Guides * * [Automate your deployment](https://cloud.google.com/deploy/docs/automation) * * ## Example Usage * * ### Clouddeploy Automation Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const pipeline = new gcp.clouddeploy.DeliveryPipeline("pipeline", { * name: "cd-pipeline", * location: "us-central1", * serialPipeline: { * stages: [{ * targetId: "test", * profiles: [], * }], * }, * }); * const b_automation = new gcp.clouddeploy.Automation("b-automation", { * name: "cd-automation", * project: pipeline.project, * location: pipeline.location, * deliveryPipeline: pipeline.name, * serviceAccount: "my@service-account.com", * selector: { * targets: [{ * id: "*", * }], * }, * rules: [ * { * promoteReleaseRule: { * id: "promote-release", * }, * }, * { * advanceRolloutRule: { * id: "advance-rollout", * }, * }, * { * repairRolloutRule: { * id: "repair-rollout", * repairPhases: [ * { * retry: { * attempts: "1", * }, * }, * { * rollback: {}, * }, * ], * }, * }, * { * timedPromoteReleaseRule: { * id: "timed-promote-release", * schedule: "0 9 * * 1", * timeZone: "America/New_York", * }, * }, * ], * }); * ``` * ### Clouddeploy Automation Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const pipeline = new gcp.clouddeploy.DeliveryPipeline("pipeline", { * name: "cd-pipeline", * location: "us-central1", * serialPipeline: { * stages: [{ * targetId: "test", * profiles: ["test-profile"], * }], * }, * }); * const f_automation = new gcp.clouddeploy.Automation("f-automation", { * name: "cd-automation", * location: "us-central1", * deliveryPipeline: pipeline.name, * serviceAccount: "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: [ * { * promoteReleaseRule: { * id: "promote-release", * wait: "200s", * destinationTargetId: "@next", * destinationPhase: "stable", * }, * }, * { * advanceRolloutRule: { * id: "advance-rollout", * sourcePhases: ["canary"], * wait: "200s", * }, * }, * { * repairRolloutRule: { * id: "repair-rollout", * phases: ["stable"], * jobs: ["deploy"], * repairPhases: [ * { * retry: { * attempts: "1", * wait: "200s", * backoffMode: "BACKOFF_MODE_LINEAR", * }, * }, * { * rollback: { * destinationPhase: "stable", * disableRollbackIfRolloutPending: true, * }, * }, * ], * }, * }, * { * timedPromoteReleaseRule: { * id: "timed-promote-release", * destinationTargetId: "@next", * schedule: "0 9 * * 1", * timeZone: "America/New_York", * destinationPhase: "stable", * }, * }, * ], * }); * ``` * * ## Import * * Automation can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/deliveryPipelines/{{delivery_pipeline}}/automations/{{name}}` * * * `{{project}}/{{location}}/{{delivery_pipeline}}/{{name}}` * * * `{{location}}/{{delivery_pipeline}}/{{name}}` * * When using the `pulumi import` command, Automation can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:clouddeploy/automation:Automation default projects/{{project}}/locations/{{location}}/deliveryPipelines/{{delivery_pipeline}}/automations/{{name}} * ``` * * ```sh * $ pulumi import gcp:clouddeploy/automation:Automation default {{project}}/{{location}}/{{delivery_pipeline}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:clouddeploy/automation:Automation default {{location}}/{{delivery_pipeline}}/{{name}} * ``` */ export declare class Automation extends pulumi.CustomResource { /** * Get an existing Automation resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AutomationState, opts?: pulumi.CustomResourceOptions): Automation; /** * Returns true if the given object is an instance of Automation. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Automation; /** * Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. Annotations must meet the following constraints: * Annotations are key/value pairs. * Valid annotation keys have two segments: an optional prefix and name, separated by a slash (`/`). * The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. * The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(`.`), not longer than 253 characters in total, followed by a slash (`/`). See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set for more details. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ readonly annotations: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Output only. Time at which the automation was created. */ readonly createTime: pulumi.Output; /** * The deliveryPipeline for the resource */ readonly deliveryPipeline: pulumi.Output; /** * Optional. Description of the `Automation`. Max length is 255 characters. */ readonly description: pulumi.Output; readonly effectiveAnnotations: pulumi.Output<{ [key: string]: string; }>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Optional. The weak etag of the `Automation` resource. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. */ readonly etag: pulumi.Output; /** * Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 63 characters. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The location for the resource */ readonly location: pulumi.Output; /** * Name of the `Automation`. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Required. List of Automation rules associated with the Automation resource. Must have at least one rule and limited to 250 rules per Delivery Pipeline. Note: the order of the rules here is not the same as the order of execution. * Structure is documented below. */ readonly rules: pulumi.Output; /** * Required. Selected resources to which the automation will be applied. * Structure is documented below. */ readonly selector: pulumi.Output; /** * Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources. */ readonly serviceAccount: pulumi.Output; /** * Optional. When Suspended, automation is deactivated from execution. */ readonly suspended: pulumi.Output; /** * Output only. Unique identifier of the `Automation`. */ readonly uid: pulumi.Output; /** * Output only. Time at which the automation was updated. */ readonly updateTime: pulumi.Output; /** * Create a Automation resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AutomationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Automation resources. */ export interface AutomationState { /** * Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. Annotations must meet the following constraints: * Annotations are key/value pairs. * Valid annotation keys have two segments: an optional prefix and name, separated by a slash (`/`). * The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. * The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(`.`), not longer than 253 characters in total, followed by a slash (`/`). See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set for more details. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Output only. Time at which the automation was created. */ createTime?: pulumi.Input; /** * The deliveryPipeline for the resource */ deliveryPipeline?: pulumi.Input; /** * Optional. Description of the `Automation`. Max length is 255 characters. */ description?: pulumi.Input; effectiveAnnotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Optional. The weak etag of the `Automation` resource. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. */ etag?: pulumi.Input; /** * Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 63 characters. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The location for the resource */ location?: pulumi.Input; /** * Name of the `Automation`. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Required. List of Automation rules associated with the Automation resource. Must have at least one rule and limited to 250 rules per Delivery Pipeline. Note: the order of the rules here is not the same as the order of execution. * Structure is documented below. */ rules?: pulumi.Input[]>; /** * Required. Selected resources to which the automation will be applied. * Structure is documented below. */ selector?: pulumi.Input; /** * Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources. */ serviceAccount?: pulumi.Input; /** * Optional. When Suspended, automation is deactivated from execution. */ suspended?: pulumi.Input; /** * Output only. Unique identifier of the `Automation`. */ uid?: pulumi.Input; /** * Output only. Time at which the automation was updated. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a Automation resource. */ export interface AutomationArgs { /** * Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. Annotations must meet the following constraints: * Annotations are key/value pairs. * Valid annotation keys have two segments: an optional prefix and name, separated by a slash (`/`). * The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. * The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots(`.`), not longer than 253 characters in total, followed by a slash (`/`). See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set for more details. * **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration. * Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The deliveryPipeline for the resource */ deliveryPipeline: pulumi.Input; /** * Optional. Description of the `Automation`. Max length is 255 characters. */ description?: pulumi.Input; /** * Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 63 characters. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The location for the resource */ location: pulumi.Input; /** * Name of the `Automation`. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Required. List of Automation rules associated with the Automation resource. Must have at least one rule and limited to 250 rules per Delivery Pipeline. Note: the order of the rules here is not the same as the order of execution. * Structure is documented below. */ rules: pulumi.Input[]>; /** * Required. Selected resources to which the automation will be applied. * Structure is documented below. */ selector: pulumi.Input; /** * Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources. */ serviceAccount: pulumi.Input; /** * Optional. When Suspended, automation is deactivated from execution. */ suspended?: pulumi.Input; }