@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
415 lines (414 loc) • 18.4 kB
TypeScript
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: "*",
* }],
* },
* suspended: false,
* rules: [{
* promoteReleaseRule: {
* id: "promote-release",
* },
* }],
* });
* ```
* ### 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: ["deploy"],
* wait: "200s",
* },
* },
* ],
* });
* ```
*
* ## 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<pulumi.ID>, 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 'effective_annotations' 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<string>;
/**
* The deliveryPipeline for the resource
*/
readonly deliveryPipeline: pulumi.Output<string>;
/**
* Optional. Description of the 'Automation'. Max length is 255 characters.
*/
readonly description: pulumi.Output<string | undefined>;
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<string>;
/**
* 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 'effective_labels' 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<string>;
/**
* Name of the `Automation`.
*/
readonly name: pulumi.Output<string>;
readonly project: pulumi.Output<string>;
/**
* 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<outputs.clouddeploy.AutomationRule[]>;
/**
* Required. Selected resources to which the automation will be applied.
* Structure is documented below.
*/
readonly selector: pulumi.Output<outputs.clouddeploy.AutomationSelector>;
/**
* Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources.
*/
readonly serviceAccount: pulumi.Output<string>;
/**
* Optional. When Suspended, automation is deactivated from execution.
*/
readonly suspended: pulumi.Output<boolean | undefined>;
/**
* Output only. Unique identifier of the `Automation`.
*/
readonly uid: pulumi.Output<string>;
/**
* Output only. Time at which the automation was updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* 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 'effective_annotations' for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Output only. Time at which the automation was created.
*/
createTime?: pulumi.Input<string>;
/**
* The deliveryPipeline for the resource
*/
deliveryPipeline?: pulumi.Input<string>;
/**
* Optional. Description of the 'Automation'. Max length is 255 characters.
*/
description?: pulumi.Input<string>;
effectiveAnnotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* 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<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.
*/
etag?: pulumi.Input<string>;
/**
* 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 'effective_labels' for all of the labels present on the
* resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The location for the resource
*/
location?: pulumi.Input<string>;
/**
* Name of the `Automation`.
*/
name?: pulumi.Input<string>;
project?: pulumi.Input<string>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<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.
*/
rules?: pulumi.Input<pulumi.Input<inputs.clouddeploy.AutomationRule>[]>;
/**
* Required. Selected resources to which the automation will be applied.
* Structure is documented below.
*/
selector?: pulumi.Input<inputs.clouddeploy.AutomationSelector>;
/**
* Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources.
*/
serviceAccount?: pulumi.Input<string>;
/**
* Optional. When Suspended, automation is deactivated from execution.
*/
suspended?: pulumi.Input<boolean>;
/**
* Output only. Unique identifier of the `Automation`.
*/
uid?: pulumi.Input<string>;
/**
* Output only. Time at which the automation was updated.
*/
updateTime?: pulumi.Input<string>;
}
/**
* 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 'effective_annotations' for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The deliveryPipeline for the resource
*/
deliveryPipeline: pulumi.Input<string>;
/**
* Optional. Description of the 'Automation'. Max length is 255 characters.
*/
description?: pulumi.Input<string>;
/**
* 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 'effective_labels' for all of the labels present on the
* resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The location for the resource
*/
location: pulumi.Input<string>;
/**
* Name of the `Automation`.
*/
name?: pulumi.Input<string>;
project?: pulumi.Input<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.
*/
rules: pulumi.Input<pulumi.Input<inputs.clouddeploy.AutomationRule>[]>;
/**
* Required. Selected resources to which the automation will be applied.
* Structure is documented below.
*/
selector: pulumi.Input<inputs.clouddeploy.AutomationSelector>;
/**
* Required. Email address of the user-managed IAM service account that creates Cloud Deploy release and rollout resources.
*/
serviceAccount: pulumi.Input<string>;
/**
* Optional. When Suspended, automation is deactivated from execution.
*/
suspended?: pulumi.Input<boolean>;
}