1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. eventarc
  5. GoogleChannelConfig
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.eventarc.GoogleChannelConfig

Explore with Pulumi AI

The Eventarc GoogleChannelConfig resource

To get more information about GoogleChannelConfig, see:

Example Usage

Eventarc Google Channel Config With Cmek

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-centra1",
});
const key = testKeyRing.then(testKeyRing => gcp.kms.getKMSCryptoKey({
    name: "key",
    keyRing: testKeyRing.id,
}));
const keyMember = new gcp.kms.CryptoKeyIAMMember("key_member", {
    cryptoKeyId: key.then(key => key.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-central1",
    name: "googleChannelConfig",
    cryptoKeyName: key.then(key => key.id),
}, {
    dependsOn: [keyMember],
});
Copy
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-centra1")
key = gcp.kms.get_kms_crypto_key(name="key",
    key_ring=test_key_ring.id)
key_member = gcp.kms.CryptoKeyIAMMember("key_member",
    crypto_key_id=key.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-central1",
    name="googleChannelConfig",
    crypto_key_name=key.id,
    opts = pulumi.ResourceOptions(depends_on=[key_member]))
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/eventarc"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi-gcp/sdk/v8/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-centra1",
		}, nil)
		if err != nil {
			return err
		}
		key, err := kms.GetKMSCryptoKey(ctx, &kms.GetKMSCryptoKeyArgs{
			Name:    "key",
			KeyRing: testKeyRing.Id,
		}, nil)
		if err != nil {
			return err
		}
		keyMember, err := kms.NewCryptoKeyIAMMember(ctx, "key_member", &kms.CryptoKeyIAMMemberArgs{
			CryptoKeyId: pulumi.String(key.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-central1"),
			Name:          pulumi.String("googleChannelConfig"),
			CryptoKeyName: pulumi.String(key.Id),
		}, pulumi.DependsOn([]pulumi.Resource{
			keyMember,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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-centra1",
    });

    var key = Gcp.Kms.GetKMSCryptoKey.Invoke(new()
    {
        Name = "key",
        KeyRing = testKeyRing.Apply(getKMSKeyRingResult => getKMSKeyRingResult.Id),
    });

    var keyMember = new Gcp.Kms.CryptoKeyIAMMember("key_member", new()
    {
        CryptoKeyId = key.Apply(getKMSCryptoKeyResult => getKMSCryptoKeyResult.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-central1",
        Name = "googleChannelConfig",
        CryptoKeyName = key.Apply(getKMSCryptoKeyResult => getKMSCryptoKeyResult.Id),
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            keyMember,
        },
    });

});
Copy
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-centra1")
            .build());

        final var key = KmsFunctions.getKMSCryptoKey(GetKMSCryptoKeyArgs.builder()
            .name("key")
            .keyRing(testKeyRing.id())
            .build());

        var keyMember = new CryptoKeyIAMMember("keyMember", CryptoKeyIAMMemberArgs.builder()
            .cryptoKeyId(key.id())
            .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
            .member(String.format("serviceAccount:service-%s@gcp-sa-eventarc.iam.gserviceaccount.com", testProject.number()))
            .build());

        var primary = new GoogleChannelConfig("primary", GoogleChannelConfigArgs.builder()
            .location("us-central1")
            .name("googleChannelConfig")
            .cryptoKeyName(key.id())
            .build(), CustomResourceOptions.builder()
                .dependsOn(keyMember)
                .build());

    }
}
Copy
resources:
  keyMember:
    type: gcp:kms:CryptoKeyIAMMember
    name: key_member
    properties:
      cryptoKeyId: ${key.id}
      role: roles/cloudkms.cryptoKeyEncrypterDecrypter
      member: serviceAccount:service-${testProject.number}@gcp-sa-eventarc.iam.gserviceaccount.com
  primary:
    type: gcp:eventarc:GoogleChannelConfig
    properties:
      location: us-central1
      name: googleChannelConfig
      cryptoKeyName: ${key.id}
    options:
      dependsOn:
        - ${keyMember}
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-centra1
  key:
    fn::invoke:
      function: gcp:kms:getKMSCryptoKey
      arguments:
        name: key
        keyRing: ${testKeyRing.id}
Copy

Create GoogleChannelConfig Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GoogleChannelConfig(name: string, args: GoogleChannelConfigArgs, opts?: CustomResourceOptions);
@overload
def GoogleChannelConfig(resource_name: str,
                        args: GoogleChannelConfigArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def GoogleChannelConfig(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        location: Optional[str] = None,
                        crypto_key_name: Optional[str] = None,
                        name: Optional[str] = None,
                        project: Optional[str] = None)
func NewGoogleChannelConfig(ctx *Context, name string, args GoogleChannelConfigArgs, opts ...ResourceOption) (*GoogleChannelConfig, error)
public GoogleChannelConfig(string name, GoogleChannelConfigArgs args, CustomResourceOptions? opts = null)
public GoogleChannelConfig(String name, GoogleChannelConfigArgs args)
public GoogleChannelConfig(String name, GoogleChannelConfigArgs args, CustomResourceOptions options)
type: gcp:eventarc:GoogleChannelConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GoogleChannelConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GoogleChannelConfigArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GoogleChannelConfigArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GoogleChannelConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GoogleChannelConfigArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var googleChannelConfigResource = new Gcp.Eventarc.GoogleChannelConfig("googleChannelConfigResource", new()
{
    Location = "string",
    CryptoKeyName = "string",
    Name = "string",
    Project = "string",
});
Copy
example, err := eventarc.NewGoogleChannelConfig(ctx, "googleChannelConfigResource", &eventarc.GoogleChannelConfigArgs{
	Location:      pulumi.String("string"),
	CryptoKeyName: pulumi.String("string"),
	Name:          pulumi.String("string"),
	Project:       pulumi.String("string"),
})
Copy
var googleChannelConfigResource = new GoogleChannelConfig("googleChannelConfigResource", GoogleChannelConfigArgs.builder()
    .location("string")
    .cryptoKeyName("string")
    .name("string")
    .project("string")
    .build());
Copy
google_channel_config_resource = gcp.eventarc.GoogleChannelConfig("googleChannelConfigResource",
    location="string",
    crypto_key_name="string",
    name="string",
    project="string")
Copy
const googleChannelConfigResource = new gcp.eventarc.GoogleChannelConfig("googleChannelConfigResource", {
    location: "string",
    cryptoKeyName: "string",
    name: "string",
    project: "string",
});
Copy
type: gcp:eventarc:GoogleChannelConfig
properties:
    cryptoKeyName: string
    location: string
    name: string
    project: string
Copy

GoogleChannelConfig Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GoogleChannelConfig resource accepts the following input properties:

Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource


CryptoKeyName string
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/*.
Name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource


CryptoKeyName string
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/*.
Name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
String
The location for the resource


cryptoKeyName String
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/*.
name Changes to this property will trigger replacement. String
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource


cryptoKeyName string
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/*.
name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
str
The location for the resource


crypto_key_name str
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/*.
name Changes to this property will trigger replacement. str
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
location
This property is required.
Changes to this property will trigger replacement.
String
The location for the resource


cryptoKeyName String
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/*.
name Changes to this property will trigger replacement. String
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the GoogleChannelConfig resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string
Output only. The last-modified time.
Id string
The provider-assigned unique ID for this managed resource.
UpdateTime string
Output only. The last-modified time.
id String
The provider-assigned unique ID for this managed resource.
updateTime String
Output only. The last-modified time.
id string
The provider-assigned unique ID for this managed resource.
updateTime string
Output only. The last-modified time.
id str
The provider-assigned unique ID for this managed resource.
update_time str
Output only. The last-modified time.
id String
The provider-assigned unique ID for this managed resource.
updateTime String
Output only. The last-modified time.

Look up Existing GoogleChannelConfig Resource

Get an existing GoogleChannelConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GoogleChannelConfigState, opts?: CustomResourceOptions): GoogleChannelConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        crypto_key_name: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        update_time: Optional[str] = None) -> GoogleChannelConfig
func GetGoogleChannelConfig(ctx *Context, name string, id IDInput, state *GoogleChannelConfigState, opts ...ResourceOption) (*GoogleChannelConfig, error)
public static GoogleChannelConfig Get(string name, Input<string> id, GoogleChannelConfigState? state, CustomResourceOptions? opts = null)
public static GoogleChannelConfig get(String name, Output<String> id, GoogleChannelConfigState state, CustomResourceOptions options)
resources:  _:    type: gcp:eventarc:GoogleChannelConfig    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CryptoKeyName string
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/*.
Location Changes to this property will trigger replacement. string
The location for the resource


Name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
UpdateTime string
Output only. The last-modified time.
CryptoKeyName string
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/*.
Location Changes to this property will trigger replacement. string
The location for the resource


Name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
UpdateTime string
Output only. The last-modified time.
cryptoKeyName String
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/*.
location Changes to this property will trigger replacement. String
The location for the resource


name Changes to this property will trigger replacement. String
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
updateTime String
Output only. The last-modified time.
cryptoKeyName string
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/*.
location Changes to this property will trigger replacement. string
The location for the resource


name Changes to this property will trigger replacement. string
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
updateTime string
Output only. The last-modified time.
crypto_key_name str
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/*.
location Changes to this property will trigger replacement. str
The location for the resource


name Changes to this property will trigger replacement. str
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
update_time str
Output only. The last-modified time.
cryptoKeyName String
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/*.
location Changes to this property will trigger replacement. String
The location for the resource


name Changes to this property will trigger replacement. String
Required. The resource name of the config. Must be in the format of, projects/{project}/locations/{location}/googleChannelConfig.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
updateTime String
Output only. The last-modified time.

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
Copy
$ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{project}}/{{location}}
Copy
$ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{location}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.