Package com.pulumi.gcp.eventarc
-
Class Summary Class Description Channel The Eventarc Channel resource ## Example Usage ### Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.kms.KmsFunctions; import com.pulumi.gcp.kms.inputs.GetKMSKeyRingArgs; import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyArgs; import com.pulumi.gcp.kms.CryptoKeyIAMMember; import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs; import com.pulumi.gcp.eventarc.Channel; import com.pulumi.gcp.eventarc.ChannelArgs; import com.pulumi.resources.CustomResourceOptions; 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) { final var testProject = OrganizationsFunctions.getProject(GetProjectArgs.builder() .projectId("my-project-name") .build()); final var testKeyRing = KmsFunctions.getKMSKeyRing(GetKMSKeyRingArgs.builder() .name("keyring") .location("us-west1") .build()); final var key = KmsFunctions.getKMSCryptoKey(GetKMSCryptoKeyArgs.builder() .name("key") .keyRing(testKeyRing.applyValue(getKMSKeyRingResult -> getKMSKeyRingResult.id())) .build()); var key1Member = new CryptoKeyIAMMember("key1Member", CryptoKeyIAMMemberArgs.builder() .cryptoKeyId(data.google_kms_crypto_key().key1().id()) .role("roles/cloudkms.cryptoKeyEncrypterDecrypter") .member(String.format("serviceAccount:service-%[email protected]", testProject.applyValue(getProjectResult -> getProjectResult.number()))) .build()); var primary = new Channel("primary", ChannelArgs.builder() .location("us-west1") .project(testProject.applyValue(getProjectResult -> getProjectResult.projectId())) .cryptoKeyName(data.google_kms_crypto_key().key1().id()) .thirdPartyProvider(String.format("projects/%s/locations/us-west1/providers/datadog", testProject.applyValue(getProjectResult -> getProjectResult.projectId()))) .build(), CustomResourceOptions.builder() .dependsOn(key1Member) .build()); } } ``` ## Import Channel can be imported using any of these accepted formats ```sh $ pulumi import gcp:eventarc/channel:Channel default projects/{{project}}/locations/{{location}}/channels/{{name}} ``` ```sh $ pulumi import gcp:eventarc/channel:Channel default {{project}}/{{location}}/{{name}} ``` ```sh $ pulumi import gcp:eventarc/channel:Channel default {{location}}/{{name}} ```ChannelArgs ChannelArgs.Builder GoogleChannelConfig The Eventarc GoogleChannelConfig resource ## Example Usage ### Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.kms.KmsFunctions; import com.pulumi.gcp.kms.inputs.GetKMSKeyRingArgs; import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyArgs; import com.pulumi.gcp.kms.CryptoKeyIAMMember; import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs; import com.pulumi.gcp.eventarc.GoogleChannelConfig; import com.pulumi.gcp.eventarc.GoogleChannelConfigArgs; import com.pulumi.resources.CustomResourceOptions; 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) { final var testProject = OrganizationsFunctions.getProject(GetProjectArgs.builder() .projectId("my-project-name") .build()); final var testKeyRing = KmsFunctions.getKMSKeyRing(GetKMSKeyRingArgs.builder() .name("keyring") .location("us-west1") .build()); final var key = KmsFunctions.getKMSCryptoKey(GetKMSCryptoKeyArgs.builder() .name("key") .keyRing(testKeyRing.applyValue(getKMSKeyRingResult -> getKMSKeyRingResult.id())) .build()); var key1Member = new CryptoKeyIAMMember("key1Member", CryptoKeyIAMMemberArgs.builder() .cryptoKeyId(data.google_kms_crypto_key().key1().id()) .role("roles/cloudkms.cryptoKeyEncrypterDecrypter") .member(String.format("serviceAccount:service-%[email protected]", testProject.applyValue(getProjectResult -> getProjectResult.number()))) .build()); var primary = new GoogleChannelConfig("primary", GoogleChannelConfigArgs.builder() .location("us-west1") .project(testProject.applyValue(getProjectResult -> getProjectResult.projectId())) .cryptoKeyName(data.google_kms_crypto_key().key1().id()) .build(), CustomResourceOptions.builder() .dependsOn(key1Member) .build()); } } ``` ## Import GoogleChannelConfig can be imported using any of these accepted formats ```sh $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default projects/{{project}}/locations/{{location}}/googleChannelConfig ``` ```sh $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{project}}/{{location}} ``` ```sh $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{location}} ```GoogleChannelConfigArgs GoogleChannelConfigArgs.Builder Trigger The Eventarc Trigger resource ## Example Usage ### Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.cloudrun.Service; import com.pulumi.gcp.cloudrun.ServiceArgs; import com.pulumi.gcp.cloudrun.inputs.ServiceMetadataArgs; import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateArgs; import com.pulumi.gcp.cloudrun.inputs.ServiceTemplateSpecArgs; import com.pulumi.gcp.cloudrun.inputs.ServiceTrafficArgs; import com.pulumi.gcp.eventarc.Trigger; import com.pulumi.gcp.eventarc.TriggerArgs; import com.pulumi.gcp.eventarc.inputs.TriggerMatchingCriteriaArgs; import com.pulumi.gcp.eventarc.inputs.TriggerDestinationArgs; import com.pulumi.gcp.eventarc.inputs.TriggerDestinationCloudRunServiceArgs; import com.pulumi.gcp.pubsub.Topic; 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 default_ = new Service("default", ServiceArgs.builder() .location("europe-west1") .metadata(ServiceMetadataArgs.builder() .namespace("my-project-name") .build()) .template(ServiceTemplateArgs.builder() .spec(ServiceTemplateSpecArgs.builder() .containers(ServiceTemplateSpecContainerArgs.builder() .image("gcr.io/cloudrun/hello") .ports(ServiceTemplateSpecContainerPortArgs.builder() .containerPort(8080) .build()) .build()) .containerConcurrency(50) .timeoutSeconds(100) .build()) .build()) .traffics(ServiceTrafficArgs.builder() .percent(100) .latestRevision(true) .build()) .build()); var primary = new Trigger("primary", TriggerArgs.builder() .location("europe-west1") .matchingCriterias(TriggerMatchingCriteriaArgs.builder() .attribute("type") .value("google.cloud.pubsub.topic.v1.messagePublished") .build()) .destination(TriggerDestinationArgs.builder() .cloudRunService(TriggerDestinationCloudRunServiceArgs.builder() .service(default_.name()) .region("europe-west1") .build()) .build()) .labels(Map.of("foo", "bar")) .build()); var foo = new Topic("foo"); } } ``` ## Import Trigger can be imported using any of these accepted formats ```sh $ pulumi import gcp:eventarc/trigger:Trigger default projects/{{project}}/locations/{{location}}/triggers/{{name}} ``` ```sh $ pulumi import gcp:eventarc/trigger:Trigger default {{project}}/{{location}}/{{name}} ``` ```sh $ pulumi import gcp:eventarc/trigger:Trigger default {{location}}/{{name}} ```TriggerArgs TriggerArgs.Builder