GoogleChannelConfigArgs

data class GoogleChannelConfigArgs(val cryptoKeyName: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null) : ConvertibleToJava<GoogleChannelConfigArgs>

The Eventarc GoogleChannelConfig resource

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const testProject = gcp.organizations.getProject({
projectId: "my-project-name",
});
const testKeyRing = gcp.kms.getKMSKeyRing({
name: "keyring",
location: "us-west1",
});
const key = testKeyRing.then(testKeyRing => gcp.kms.getKMSCryptoKey({
name: "key",
keyRing: testKeyRing.id,
}));
const key1Member = new gcp.kms.CryptoKeyIAMMember("key1_member", {
cryptoKeyId: key1.id,
role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
member: testProject.then(testProject => `serviceAccount:service-${testProject.number}@gcp-sa-eventarc.iam.gserviceaccount.com`),
});
const primary = new gcp.eventarc.GoogleChannelConfig("primary", {
location: "us-west1",
name: "channel",
project: testProject.then(testProject => testProject.projectId),
cryptoKeyName: key1.id,
}, {
dependsOn: [key1Member],
});
import pulumi
import pulumi_gcp as gcp
test_project = gcp.organizations.get_project(project_id="my-project-name")
test_key_ring = gcp.kms.get_kms_key_ring(name="keyring",
location="us-west1")
key = gcp.kms.get_kms_crypto_key(name="key",
key_ring=test_key_ring.id)
key1_member = gcp.kms.CryptoKeyIAMMember("key1_member",
crypto_key_id=key1["id"],
role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
member=f"serviceAccount:service-{test_project.number}@gcp-sa-eventarc.iam.gserviceaccount.com")
primary = gcp.eventarc.GoogleChannelConfig("primary",
location="us-west1",
name="channel",
project=test_project.project_id,
crypto_key_name=key1["id"],
opts = pulumi.ResourceOptions(depends_on=[key1_member]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var testProject = Gcp.Organizations.GetProject.Invoke(new()
{
ProjectId = "my-project-name",
});
var testKeyRing = Gcp.Kms.GetKMSKeyRing.Invoke(new()
{
Name = "keyring",
Location = "us-west1",
});
var key = Gcp.Kms.GetKMSCryptoKey.Invoke(new()
{
Name = "key",
KeyRing = testKeyRing.Apply(getKMSKeyRingResult => getKMSKeyRingResult.Id),
});
var key1Member = new Gcp.Kms.CryptoKeyIAMMember("key1_member", new()
{
CryptoKeyId = key1.Id,
Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
Member = $"serviceAccount:service-{testProject.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-eventarc.iam.gserviceaccount.com",
});
var primary = new Gcp.Eventarc.GoogleChannelConfig("primary", new()
{
Location = "us-west1",
Name = "channel",
Project = testProject.Apply(getProjectResult => getProjectResult.ProjectId),
CryptoKeyName = key1.Id,
}, new CustomResourceOptions
{
DependsOn =
{
key1Member,
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/eventarc"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testProject, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{
ProjectId: pulumi.StringRef("my-project-name"),
}, nil)
if err != nil {
return err
}
testKeyRing, err := kms.GetKMSKeyRing(ctx, &kms.GetKMSKeyRingArgs{
Name: "keyring",
Location: "us-west1",
}, nil)
if err != nil {
return err
}
_, err = kms.GetKMSCryptoKey(ctx, &kms.GetKMSCryptoKeyArgs{
Name: "key",
KeyRing: testKeyRing.Id,
}, nil)
if err != nil {
return err
}
key1Member, err := kms.NewCryptoKeyIAMMember(ctx, "key1_member", &kms.CryptoKeyIAMMemberArgs{
CryptoKeyId: pulumi.Any(key1.Id),
Role: pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
Member: pulumi.Sprintf("serviceAccount:service-%v@gcp-sa-eventarc.iam.gserviceaccount.com", testProject.Number),
})
if err != nil {
return err
}
_, err = eventarc.NewGoogleChannelConfig(ctx, "primary", &eventarc.GoogleChannelConfigArgs{
Location: pulumi.String("us-west1"),
Name: pulumi.String("channel"),
Project: pulumi.String(testProject.ProjectId),
CryptoKeyName: pulumi.Any(key1.Id),
}, pulumi.DependsOn([]pulumi.Resource{
key1Member,
}))
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.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(key1.id())
.role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
.member(String.format("serviceAccount:service-%s@gcp-sa-eventarc.iam.gserviceaccount.com", testProject.applyValue(getProjectResult -> getProjectResult.number())))
.build());
var primary = new GoogleChannelConfig("primary", GoogleChannelConfigArgs.builder()
.location("us-west1")
.name("channel")
.project(testProject.applyValue(getProjectResult -> getProjectResult.projectId()))
.cryptoKeyName(key1.id())
.build(), CustomResourceOptions.builder()
.dependsOn(key1Member)
.build());
}
}
resources:
key1Member:
type: gcp:kms:CryptoKeyIAMMember
name: key1_member
properties:
cryptoKeyId: ${key1.id}
role: roles/cloudkms.cryptoKeyEncrypterDecrypter
member: serviceAccount:service-${testProject.number}@gcp-sa-eventarc.iam.gserviceaccount.com
primary:
type: gcp:eventarc:GoogleChannelConfig
properties:
location: us-west1
name: channel
project: ${testProject.projectId}
cryptoKeyName: ${key1.id}
options:
dependson:
- ${key1Member}
variables:
testProject:
fn::invoke:
Function: gcp:organizations:getProject
Arguments:
projectId: my-project-name
testKeyRing:
fn::invoke:
Function: gcp:kms:getKMSKeyRing
Arguments:
name: keyring
location: us-west1
key:
fn::invoke:
Function: gcp:kms:getKMSCryptoKey
Arguments:
name: key
keyRing: ${testKeyRing.id}

Import

GoogleChannelConfig can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/googleChannelConfig

  • {{project}}/{{location}}

  • {{location}} When using the pulumi import command, GoogleChannelConfig can be imported using one of the formats above. For example:

$ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default projects/{{project}}/locations/{{location}}/googleChannelConfig
$ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{project}}/{{location}}
$ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{location}}

Constructors

Link copied to clipboard
constructor(cryptoKeyName: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val cryptoKeyName: Output<String>? = null

Optional. Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt their event data. It must match the pattern projects/*/locations/*/keyRings/*/cryptoKeys/*.

Link copied to clipboard
val location: Output<String>? = null

The location for the resource

Link copied to clipboard
val name: Output<String>? = null

Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.

Link copied to clipboard
val project: Output<String>? = null

The project for the resource ////

Functions

Link copied to clipboard
open override fun toJava(): GoogleChannelConfigArgs