Enrollment
The Eventarc Enrollment resource To get more information about Enrollment, see:
How-to Guides
Example Usage
Eventarc Enrollment With Pipeline Destination
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const pipeline = new gcp.eventarc.Pipeline("pipeline", {
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",
},
}],
});
const primary = new gcp.eventarc.Enrollment("primary", {
location: "us-central1",
enrollmentId: "some-enrollment",
messageBus: primaryGoogleEventarcMessageBus.id,
destination: pipeline.id,
celMatch: "message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'",
});
const messageBus = new gcp.eventarc.MessageBus("message_bus", {
location: "us-central1",
messageBusId: "some-message-bus",
});
import pulumi
import pulumi_gcp as gcp
pipeline = gcp.eventarc.Pipeline("pipeline",
location="us-central1",
pipeline_id="some-pipeline",
destinations=[{
"http_endpoint": {
"uri": "https://10.77.0.0:80/route",
},
"network_config": {
"network_attachment": "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment",
},
}])
primary = gcp.eventarc.Enrollment("primary",
location="us-central1",
enrollment_id="some-enrollment",
message_bus=primary_google_eventarc_message_bus["id"],
destination=pipeline.id,
cel_match="message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'")
message_bus = gcp.eventarc.MessageBus("message_bus",
location="us-central1",
message_bus_id="some-message-bus")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var pipeline = new Gcp.Eventarc.Pipeline("pipeline", new()
{
Location = "us-central1",
PipelineId = "some-pipeline",
Destinations = new[]
{
new Gcp.Eventarc.Inputs.PipelineDestinationArgs
{
HttpEndpoint = new Gcp.Eventarc.Inputs.PipelineDestinationHttpEndpointArgs
{
Uri = "https://10.77.0.0:80/route",
},
NetworkConfig = new Gcp.Eventarc.Inputs.PipelineDestinationNetworkConfigArgs
{
NetworkAttachment = "projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment",
},
},
},
});
var primary = new Gcp.Eventarc.Enrollment("primary", new()
{
Location = "us-central1",
EnrollmentId = "some-enrollment",
MessageBus = primaryGoogleEventarcMessageBus.Id,
Destination = pipeline.Id,
CelMatch = "message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'",
});
var messageBus = new Gcp.Eventarc.MessageBus("message_bus", new()
{
Location = "us-central1",
MessageBusId = "some-message-bus",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/eventarc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pipeline, err := eventarc.NewPipeline(ctx, "pipeline", &eventarc.PipelineArgs{
Location: pulumi.String("us-central1"),
PipelineId: pulumi.String("some-pipeline"),
Destinations: eventarc.PipelineDestinationArray{
&eventarc.PipelineDestinationArgs{
HttpEndpoint: &eventarc.PipelineDestinationHttpEndpointArgs{
Uri: pulumi.String("https://10.77.0.0:80/route"),
},
NetworkConfig: &eventarc.PipelineDestinationNetworkConfigArgs{
NetworkAttachment: pulumi.String("projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment"),
},
},
},
})
if err != nil {
return err
}
_, err = eventarc.NewEnrollment(ctx, "primary", &eventarc.EnrollmentArgs{
Location: pulumi.String("us-central1"),
EnrollmentId: pulumi.String("some-enrollment"),
MessageBus: pulumi.Any(primaryGoogleEventarcMessageBus.Id),
Destination: pipeline.ID(),
CelMatch: pulumi.String("message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'"),
})
if err != nil {
return err
}
_, err = eventarc.NewMessageBus(ctx, "message_bus", &eventarc.MessageBusArgs{
Location: pulumi.String("us-central1"),
MessageBusId: pulumi.String("some-message-bus"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.eventarc.Pipeline;
import com.pulumi.gcp.eventarc.PipelineArgs;
import com.pulumi.gcp.eventarc.inputs.PipelineDestinationArgs;
import com.pulumi.gcp.eventarc.inputs.PipelineDestinationHttpEndpointArgs;
import com.pulumi.gcp.eventarc.inputs.PipelineDestinationNetworkConfigArgs;
import com.pulumi.gcp.eventarc.Enrollment;
import com.pulumi.gcp.eventarc.EnrollmentArgs;
import com.pulumi.gcp.eventarc.MessageBus;
import com.pulumi.gcp.eventarc.MessageBusArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var pipeline = new Pipeline("pipeline", PipelineArgs.builder()
.location("us-central1")
.pipelineId("some-pipeline")
.destinations(PipelineDestinationArgs.builder()
.httpEndpoint(PipelineDestinationHttpEndpointArgs.builder()
.uri("https://10.77.0.0:80/route")
.build())
.networkConfig(PipelineDestinationNetworkConfigArgs.builder()
.networkAttachment("projects/my-project-name/regions/us-central1/networkAttachments/some-network-attachment")
.build())
.build())
.build());
var primary = new Enrollment("primary", EnrollmentArgs.builder()
.location("us-central1")
.enrollmentId("some-enrollment")
.messageBus(primaryGoogleEventarcMessageBus.id())
.destination(pipeline.id())
.celMatch("message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'")
.build());
var messageBus = new MessageBus("messageBus", MessageBusArgs.builder()
.location("us-central1")
.messageBusId("some-message-bus")
.build());
}
}
resources:
primary:
type: gcp:eventarc:Enrollment
properties:
location: us-central1
enrollmentId: some-enrollment
messageBus: ${primaryGoogleEventarcMessageBus.id}
destination: ${pipeline.id}
celMatch: message.type == 'google.cloud.dataflow.job.v1beta3.statusChanged'
pipeline:
type: gcp:eventarc:Pipeline
properties:
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
messageBus:
type: gcp:eventarc:MessageBus
name: message_bus
properties:
location: us-central1
messageBusId: some-message-bus
Import
Enrollment can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/enrollments/{{enrollment_id}}
{{project}}/{{location}}/{{enrollment_id}}
{{location}}/{{enrollment_id}}
When using thepulumi import
command, Enrollment can be imported using one of the formats above. For example:
$ pulumi import gcp:eventarc/enrollment:Enrollment default projects/{{project}}/locations/{{location}}/enrollments/{{enrollment_id}}
$ pulumi import gcp:eventarc/enrollment:Enrollment default {{project}}/{{location}}/{{enrollment_id}}
$ pulumi import gcp:eventarc/enrollment:Enrollment default {{location}}/{{enrollment_id}}
Properties
Resource annotations. 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.
The creation time.
Destination is the Pipeline that the Enrollment is delivering to. It must point to the full resource name of a Pipeline. Format: "projects/{PROJECT_ID}/locations/{region}/pipelines/{PIPELINE_ID)"
Resource display name.
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
The user-provided ID to be assigned to the Enrollment. It should match the format ^a-z?$
.
Resource name of the message bus identifying the source of the messages. It matches the form projects/{project}/locations/{location}/messageBuses/{messageBus}.
The combination of labels configured directly on the resource and default labels configured on the provider.
The last-modified time.