UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

654 lines (653 loc) • 24.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * The Eventarc Pipeline resource * * To get more information about Pipeline, see: * * * [API documentation](https://cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations.pipelines) * * How-to Guides * * [Official Documentation](https://cloud.google.com/eventarc/advanced/docs/receive-events/create-enrollment) * * ## Example Usage * * ### Eventarc Pipeline With Topic Destination * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const topic = new gcp.pubsub.Topic("topic", {name: "some-topic"}); * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * destinations: [{ * topic: topic.id, * }], * labels: { * test_label: "test-eventarc-label", * }, * annotations: { * test_annotation: "test-eventarc-annotation", * }, * displayName: "Testing Pipeline", * }); * ``` * ### Eventarc Pipeline With Http Destination * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * destinations: [{ * httpEndpoint: { * uri: "https://10.77.0.0:80/route", * }, * networkConfig: { * networkAttachment: "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment", * }, * }], * }); * ``` * ### Eventarc Pipeline With Workflow Destination * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const workflow = new gcp.workflows.Workflow("workflow", { * name: "some-workflow", * deletionProtection: false, * region: "us-central1", * sourceContents: `# This is a sample workflow, feel free to replace it with your source code * # * # This workflow does the following: * # - reads current time and date information from an external API and stores * # the response in CurrentDateTime variable * # - retrieves a list of Wikipedia articles related to the day of the week * # from CurrentDateTime * # - returns the list of articles as an output of the workflow * # FYI, In terraform you need to escape the or it will cause errors. * * - getCurrentTime: * call: http.get * args: * url: \${sys.get_env("url")} * result: CurrentDateTime * - readWikipedia: * call: http.get * args: * url: https://en.wikipedia.org/w/api.php * query: * action: opensearch * search: \${CurrentDateTime.body.dayOfTheWeek} * result: WikiResult * - returnOutput: * return: \${WikiResult.body[1]} * `, * }); * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * destinations: [{ * workflow: workflow.id, * }], * }); * ``` * ### Eventarc Pipeline With Oidc And Json Format * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * destinations: [{ * httpEndpoint: { * uri: "https://10.77.0.0:80/route", * messageBindingTemplate: "{\"headers\":{\"new-header-key\": \"new-header-value\"}}", * }, * networkConfig: { * networkAttachment: "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment", * }, * authenticationConfig: { * googleOidc: { * serviceAccount: "my@service-account.com", * audience: "http://www.example.com", * }, * }, * outputPayloadFormat: { * json: {}, * }, * }], * inputPayloadFormat: { * json: {}, * }, * retryPolicy: { * maxRetryDelay: "50s", * maxAttempts: 2, * minRetryDelay: "40s", * }, * mediations: [{ * transformation: { * transformationTemplate: `{ * "id": message.id, * "datacontenttype": "application/json", * "data": "{ \\"scrubbed\\": \\"true\\" }" * } * `, * }, * }], * loggingConfig: { * logSeverity: "DEBUG", * }, * }); * ``` * ### Eventarc Pipeline With Oauth And Protobuf Format * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * destinations: [{ * httpEndpoint: { * uri: "https://10.77.0.0:80/route", * messageBindingTemplate: "{\"headers\":{\"new-header-key\": \"new-header-value\"}}", * }, * networkConfig: { * networkAttachment: "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment", * }, * authenticationConfig: { * oauthToken: { * serviceAccount: "my@service-account.com", * scope: "https://www.googleapis.com/auth/cloud-platform", * }, * }, * outputPayloadFormat: { * protobuf: { * schemaDefinition: `syntax = "proto3"; * message schema { * string name = 1; * string severity = 2; * } * `, * }, * }, * }], * inputPayloadFormat: { * protobuf: { * schemaDefinition: `syntax = "proto3"; * message schema { * string name = 1; * string severity = 2; * } * `, * }, * }, * retryPolicy: { * maxRetryDelay: "50s", * maxAttempts: 2, * minRetryDelay: "40s", * }, * mediations: [{ * transformation: { * transformationTemplate: `{ * "id": message.id, * "datacontenttype": "application/json", * "data": "{ \\"scrubbed\\": \\"true\\" }" * } * `, * }, * }], * loggingConfig: { * logSeverity: "DEBUG", * }, * }); * ``` * ### Eventarc Pipeline With Cmek And Avro Format * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const primary = new gcp.eventarc.Pipeline("primary", { * location: "us-central1", * pipelineId: "some-pipeline", * cryptoKeyName: "some-key", * destinations: [{ * httpEndpoint: { * uri: "https://10.77.0.0:80/route", * messageBindingTemplate: "{\"headers\":{\"new-header-key\": \"new-header-value\"}}", * }, * networkConfig: { * networkAttachment: "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment", * }, * outputPayloadFormat: { * avro: { * schemaDefinition: "{\"type\": \"record\", \"name\": \"my_record\", \"fields\": [{\"name\": \"my_field\", \"type\": \"string\"}]}", * }, * }, * }], * inputPayloadFormat: { * avro: { * schemaDefinition: "{\"type\": \"record\", \"name\": \"my_record\", \"fields\": [{\"name\": \"my_field\", \"type\": \"string\"}]}", * }, * }, * retryPolicy: { * maxRetryDelay: "50s", * maxAttempts: 2, * minRetryDelay: "40s", * }, * mediations: [{ * transformation: { * transformationTemplate: `{ * "id": message.id, * "datacontenttype": "application/json", * "data": "{ \\"scrubbed\\": \\"true\\" }" * } * `, * }, * }], * loggingConfig: { * logSeverity: "DEBUG", * }, * }); * ``` * * ## Import * * Pipeline can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/pipelines/{{pipeline_id}}` * * * `{{project}}/{{location}}/{{pipeline_id}}` * * * `{{location}}/{{pipeline_id}}` * * When using the `pulumi import` command, Pipeline can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:eventarc/pipeline:Pipeline default projects/{{project}}/locations/{{location}}/pipelines/{{pipeline_id}} * ``` * * ```sh * $ pulumi import gcp:eventarc/pipeline:Pipeline default {{project}}/{{location}}/{{pipeline_id}} * ``` * * ```sh * $ pulumi import gcp:eventarc/pipeline:Pipeline default {{location}}/{{pipeline_id}} * ``` */ export declare class Pipeline extends pulumi.CustomResource { /** * Get an existing Pipeline 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?: PipelineState, opts?: pulumi.CustomResourceOptions): Pipeline; /** * Returns true if the given object is an instance of Pipeline. 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 Pipeline; /** * User-defined annotations. See https://google.aip.dev/128#annotations. * **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>; /** * The creation time. * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up * to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and * "2014-10-02T15:01:23.045123456Z". */ readonly createTime: pulumi.Output<string>; /** * Resource name of a KMS crypto key (managed by the user) used to * encrypt/decrypt the event data. If not set, an internal Google-owned key * will be used to encrypt messages. It must match the pattern * "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}". */ readonly cryptoKeyName: pulumi.Output<string | undefined>; /** * List of destinations to which messages will be forwarded. Currently, * exactly one destination is supported per Pipeline. * Structure is documented below. */ readonly destinations: pulumi.Output<outputs.eventarc.PipelineDestination[]>; /** * Display name of resource. */ readonly displayName: 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; }>; /** * This checksum is computed by the server based on the value of * other fields, and might be sent only on create requests to ensure that the * client has an up-to-date value before proceeding. */ readonly etag: pulumi.Output<string>; /** * Represents the format of message data. * Structure is documented below. */ readonly inputPayloadFormat: pulumi.Output<outputs.eventarc.PipelineInputPayloadFormat | undefined>; /** * User labels attached to the Pipeline that can be used to group * resources. An object containing a list of "key": value pairs. Example: { * "name": "wrench", "mass": "1.3kg", "count": "3" }. * **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>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ readonly location: pulumi.Output<string>; /** * The configuration for Platform Telemetry logging for Eventarc Advanced * resources. * Structure is documented below. */ readonly loggingConfig: pulumi.Output<outputs.eventarc.PipelineLoggingConfig>; /** * List of mediation operations to be performed on the message. Currently, * only one Transformation operation is allowed in each Pipeline. * Structure is documented below. */ readonly mediations: pulumi.Output<outputs.eventarc.PipelineMediation[] | undefined>; /** * The resource name of the Pipeline. Must be unique within the * location of the project and must be in * `projects/{project}/locations/{location}/pipelines/{pipeline}` format. */ readonly name: pulumi.Output<string>; /** * The user-provided ID to be assigned to the Pipeline. It should match the * format `^a-z?$`. */ readonly pipelineId: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ 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; }>; /** * The retry policy configuration for the Pipeline. The pipeline * exponentially backs off in case the destination is non responsive or * returns a retryable error code. The default semantics are as follows: * The backoff starts with a 5 second delay and doubles the * delay after each failed attempt (10 seconds, 20 seconds, 40 seconds, etc.). * The delay is capped at 60 seconds by default. * Please note that if you set the minRetryDelay and maxRetryDelay fields * to the same value this will make the duration between retries constant. * Structure is documented below. */ readonly retryPolicy: pulumi.Output<outputs.eventarc.PipelineRetryPolicy>; /** * Server-assigned unique identifier for the Pipeline. The value * is a UUID4 string and guaranteed to remain unchanged until the resource is * deleted. */ readonly uid: pulumi.Output<string>; /** * The last-modified time. * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up * to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and * "2014-10-02T15:01:23.045123456Z". */ readonly updateTime: pulumi.Output<string>; /** * Create a Pipeline 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: PipelineArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Pipeline resources. */ export interface PipelineState { /** * User-defined annotations. See https://google.aip.dev/128#annotations. * **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<string>; }>; /** * The creation time. * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up * to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and * "2014-10-02T15:01:23.045123456Z". */ createTime?: pulumi.Input<string>; /** * Resource name of a KMS crypto key (managed by the user) used to * encrypt/decrypt the event data. If not set, an internal Google-owned key * will be used to encrypt messages. It must match the pattern * "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}". */ cryptoKeyName?: pulumi.Input<string>; /** * List of destinations to which messages will be forwarded. Currently, * exactly one destination is supported per Pipeline. * Structure is documented below. */ destinations?: pulumi.Input<pulumi.Input<inputs.eventarc.PipelineDestination>[]>; /** * Display name of resource. */ displayName?: 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>; }>; /** * This checksum is computed by the server based on the value of * other fields, and might be sent only on create requests to ensure that the * client has an up-to-date value before proceeding. */ etag?: pulumi.Input<string>; /** * Represents the format of message data. * Structure is documented below. */ inputPayloadFormat?: pulumi.Input<inputs.eventarc.PipelineInputPayloadFormat>; /** * User labels attached to the Pipeline that can be used to group * resources. An object containing a list of "key": value pairs. Example: { * "name": "wrench", "mass": "1.3kg", "count": "3" }. * **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<string>; }>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ location?: pulumi.Input<string>; /** * The configuration for Platform Telemetry logging for Eventarc Advanced * resources. * Structure is documented below. */ loggingConfig?: pulumi.Input<inputs.eventarc.PipelineLoggingConfig>; /** * List of mediation operations to be performed on the message. Currently, * only one Transformation operation is allowed in each Pipeline. * Structure is documented below. */ mediations?: pulumi.Input<pulumi.Input<inputs.eventarc.PipelineMediation>[]>; /** * The resource name of the Pipeline. Must be unique within the * location of the project and must be in * `projects/{project}/locations/{location}/pipelines/{pipeline}` format. */ name?: pulumi.Input<string>; /** * The user-provided ID to be assigned to the Pipeline. It should match the * format `^a-z?$`. */ pipelineId?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ 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>; }>; /** * The retry policy configuration for the Pipeline. The pipeline * exponentially backs off in case the destination is non responsive or * returns a retryable error code. The default semantics are as follows: * The backoff starts with a 5 second delay and doubles the * delay after each failed attempt (10 seconds, 20 seconds, 40 seconds, etc.). * The delay is capped at 60 seconds by default. * Please note that if you set the minRetryDelay and maxRetryDelay fields * to the same value this will make the duration between retries constant. * Structure is documented below. */ retryPolicy?: pulumi.Input<inputs.eventarc.PipelineRetryPolicy>; /** * Server-assigned unique identifier for the Pipeline. The value * is a UUID4 string and guaranteed to remain unchanged until the resource is * deleted. */ uid?: pulumi.Input<string>; /** * The last-modified time. * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up * to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and * "2014-10-02T15:01:23.045123456Z". */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a Pipeline resource. */ export interface PipelineArgs { /** * User-defined annotations. See https://google.aip.dev/128#annotations. * **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<string>; }>; /** * Resource name of a KMS crypto key (managed by the user) used to * encrypt/decrypt the event data. If not set, an internal Google-owned key * will be used to encrypt messages. It must match the pattern * "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}". */ cryptoKeyName?: pulumi.Input<string>; /** * List of destinations to which messages will be forwarded. Currently, * exactly one destination is supported per Pipeline. * Structure is documented below. */ destinations: pulumi.Input<pulumi.Input<inputs.eventarc.PipelineDestination>[]>; /** * Display name of resource. */ displayName?: pulumi.Input<string>; /** * Represents the format of message data. * Structure is documented below. */ inputPayloadFormat?: pulumi.Input<inputs.eventarc.PipelineInputPayloadFormat>; /** * User labels attached to the Pipeline that can be used to group * resources. An object containing a list of "key": value pairs. Example: { * "name": "wrench", "mass": "1.3kg", "count": "3" }. * **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<string>; }>; /** * Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. */ location: pulumi.Input<string>; /** * The configuration for Platform Telemetry logging for Eventarc Advanced * resources. * Structure is documented below. */ loggingConfig?: pulumi.Input<inputs.eventarc.PipelineLoggingConfig>; /** * List of mediation operations to be performed on the message. Currently, * only one Transformation operation is allowed in each Pipeline. * Structure is documented below. */ mediations?: pulumi.Input<pulumi.Input<inputs.eventarc.PipelineMediation>[]>; /** * The user-provided ID to be assigned to the Pipeline. It should match the * format `^a-z?$`. */ pipelineId: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The retry policy configuration for the Pipeline. The pipeline * exponentially backs off in case the destination is non responsive or * returns a retryable error code. The default semantics are as follows: * The backoff starts with a 5 second delay and doubles the * delay after each failed attempt (10 seconds, 20 seconds, 40 seconds, etc.). * The delay is capped at 60 seconds by default. * Please note that if you set the minRetryDelay and maxRetryDelay fields * to the same value this will make the duration between retries constant. * Structure is documented below. */ retryPolicy?: pulumi.Input<inputs.eventarc.PipelineRetryPolicy>; }