1. Registry
  2. Packages
  3. Google Cloud (GCP)
  4. API Docs
  5. dataform
  6. Config
Viewing docs for Google Cloud v10.5.0
published on Wednesday, Nov 18, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v10.5.0
published on Wednesday, Nov 18, 2026 by Pulumi

    Config is a singleton resource used to configure the default Dataform settings for a specified location.

    To get more information about Config, see:

    Example Usage

    Dataform Config With Kms Key

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const project = gcp.organizations.getProject({});
    const keyring = new gcp.kms.KeyRing("keyring", {
        name: "example-key-ring",
        location: "us-east1",
    });
    const exampleKey = new gcp.kms.CryptoKey("example_key", {
        name: "example-crypto-key-name",
        keyRing: keyring.id,
    });
    // Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
    const cryptoKeyBinding = new gcp.kms.CryptoKeyIAMMember("crypto_key_binding", {
        cryptoKeyId: exampleKey.id,
        role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
        member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-dataform.iam.gserviceaccount.com`),
    });
    // Config with KMS key provided
    const config = new gcp.dataform.Config("config", {
        region: "us-east1",
        defaultKmsKeyName: exampleKey.id,
    }, {
        dependsOn: [cryptoKeyBinding],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    project = gcp.organizations.get_project()
    keyring = gcp.kms.KeyRing("keyring",
        name="example-key-ring",
        location="us-east1")
    example_key = gcp.kms.CryptoKey("example_key",
        name="example-crypto-key-name",
        key_ring=keyring.id)
    # Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
    crypto_key_binding = gcp.kms.CryptoKeyIAMMember("crypto_key_binding",
        crypto_key_id=example_key.id,
        role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
        member=f"serviceAccount:service-{project.number}@gcp-sa-dataform.iam.gserviceaccount.com")
    # Config with KMS key provided
    config = gcp.dataform.Config("config",
        region="us-east1",
        default_kms_key_name=example_key.id,
        opts = pulumi.ResourceOptions(depends_on=[crypto_key_binding]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/dataform"
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/kms"
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		keyring, err := kms.NewKeyRing(ctx, "keyring", &kms.KeyRingArgs{
    			Name:     pulumi.String("example-key-ring"),
    			Location: pulumi.String("us-east1"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleKey, err := kms.NewCryptoKey(ctx, "example_key", &kms.CryptoKeyArgs{
    			Name:    pulumi.String("example-crypto-key-name"),
    			KeyRing: keyring.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		// Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
    		cryptoKeyBinding, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key_binding", &kms.CryptoKeyIAMMemberArgs{
    			CryptoKeyId: exampleKey.ID(),
    			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
    			Member:      pulumi.Sprintf("serviceAccount:service-%v@gcp-sa-dataform.iam.gserviceaccount.com", project.Number),
    		})
    		if err != nil {
    			return err
    		}
    		// Config with KMS key provided
    		_, err = dataform.NewConfig(ctx, "config", &dataform.ConfigArgs{
    			Region:            pulumi.String("us-east1"),
    			DefaultKmsKeyName: exampleKey.ID(),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			cryptoKeyBinding,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var project = Gcp.Organizations.GetProject.Invoke();
    
        var keyring = new Gcp.Kms.KeyRing("keyring", new()
        {
            Name = "example-key-ring",
            Location = "us-east1",
        });
    
        var exampleKey = new Gcp.Kms.CryptoKey("example_key", new()
        {
            Name = "example-crypto-key-name",
            KeyRing = keyring.Id,
        });
    
        // Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
        var cryptoKeyBinding = new Gcp.Kms.CryptoKeyIAMMember("crypto_key_binding", new()
        {
            CryptoKeyId = exampleKey.Id,
            Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
            Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-dataform.iam.gserviceaccount.com",
        });
    
        // Config with KMS key provided
        var config = new Gcp.Dataform.Config("config", new()
        {
            Region = "us-east1",
            DefaultKmsKeyName = exampleKey.Id,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                cryptoKeyBinding,
            },
        });
    
    });
    
    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.KeyRing;
    import com.pulumi.gcp.kms.KeyRingArgs;
    import com.pulumi.gcp.kms.CryptoKey;
    import com.pulumi.gcp.kms.CryptoKeyArgs;
    import com.pulumi.gcp.kms.CryptoKeyIAMMember;
    import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
    import com.pulumi.gcp.dataform.Config;
    import com.pulumi.gcp.dataform.ConfigArgs;
    import com.pulumi.resources.CustomResourceOptions;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
                .build());
    
            var keyring = new KeyRing("keyring", KeyRingArgs.builder()
                .name("example-key-ring")
                .location("us-east1")
                .build());
    
            var exampleKey = new CryptoKey("exampleKey", CryptoKeyArgs.builder()
                .name("example-crypto-key-name")
                .keyRing(keyring.id())
                .build());
    
            // Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
            var cryptoKeyBinding = new CryptoKeyIAMMember("cryptoKeyBinding", CryptoKeyIAMMemberArgs.builder()
                .cryptoKeyId(exampleKey.id())
                .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
                .member(String.format("serviceAccount:service-%s@gcp-sa-dataform.iam.gserviceaccount.com", project.number()))
                .build());
    
            // Config with KMS key provided
            var config = new Config("config", ConfigArgs.builder()
                .region("us-east1")
                .defaultKmsKeyName(exampleKey.id())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(cryptoKeyBinding)
                    .build());
    
        }
    }
    
    resources:
      keyring:
        type: gcp:kms:KeyRing
        properties:
          name: example-key-ring
          location: us-east1
      exampleKey:
        type: gcp:kms:CryptoKey
        name: example_key
        properties:
          name: example-crypto-key-name
          keyRing: ${keyring.id}
      # Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
      cryptoKeyBinding:
        type: gcp:kms:CryptoKeyIAMMember
        name: crypto_key_binding
        properties:
          cryptoKeyId: ${exampleKey.id}
          role: roles/cloudkms.cryptoKeyEncrypterDecrypter
          member: serviceAccount:service-${project.number}@gcp-sa-dataform.iam.gserviceaccount.com
      # Config with KMS key provided
      config:
        type: gcp:dataform:Config
        properties:
          region: us-east1
          defaultKmsKeyName: ${exampleKey.id}
        options:
          dependsOn:
            - ${cryptoKeyBinding}
    variables:
      project:
        fn::invoke:
          function: gcp:organizations:getProject
          arguments: {}
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_organizations_project" "project" {
    }
    
    resource "gcp_kms_key_ring" "keyring" {
      lifecycle {
        create_before_destroy = true
      }
      name     = "example-key-ring"
      location = "us-east1"
    }
    resource "gcp_kms_crypto_key" "example_key" {
      lifecycle {
        create_before_destroy = true
      }
      name     = "example-crypto-key-name"
      key_ring = gcp_kms_key_ring.keyring.id
    }
    # Grant the Encrypter/Decrypter role to the Dataform service agent on the KMS key
    resource "gcp_kms_crypto_key_i_a_m_member" "crypto_key_binding" {
      lifecycle {
        create_before_destroy = true
      }
      crypto_key_id = gcp_kms_crypto_key.example_key.id
      role          = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
      member        ="serviceAccount:service-${data.gcp_organizations_project.project.number}@gcp-sa-dataform.iam.gserviceaccount.com"
    }
    # Config with KMS key provided
    resource "gcp_dataform_config" "config" {
      depends_on = [gcp_kms_crypto_key_i_a_m_member.crypto_key_binding]
      lifecycle {
        create_before_destroy = true
      }
      region               = "us-east1"
      default_kms_key_name = gcp_kms_crypto_key.example_key.id
    }
    

    Dataform Config Without Kms Key

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    // Config without KMS key provided
    const config = new gcp.dataform.Config("config", {region: "us-west1"});
    
    import pulumi
    import pulumi_gcp as gcp
    
    # Config without KMS key provided
    config = gcp.dataform.Config("config", region="us-west1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/dataform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Config without KMS key provided
    		_, err := dataform.NewConfig(ctx, "config", &dataform.ConfigArgs{
    			Region: pulumi.String("us-west1"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        // Config without KMS key provided
        var config = new Gcp.Dataform.Config("config", new()
        {
            Region = "us-west1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.dataform.Config;
    import com.pulumi.gcp.dataform.ConfigArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            // Config without KMS key provided
            var config = new Config("config", ConfigArgs.builder()
                .region("us-west1")
                .build());
    
        }
    }
    
    resources:
      # Config without KMS key provided
      config:
        type: gcp:dataform:Config
        properties:
          region: us-west1
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    # Config without KMS key provided
    resource "gcp_dataform_config" "config" {
      lifecycle {
        create_before_destroy = true
      }
      region = "us-west1"
    }
    

    Create Config Resource

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

    Constructor syntax

    new Config(name: string, args: ConfigArgs, opts?: CustomResourceOptions);
    @overload
    def Config(resource_name: str,
               args: ConfigArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Config(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               region: Optional[str] = None,
               default_kms_key_name: Optional[str] = None,
               project: Optional[str] = None)
    func NewConfig(ctx *Context, name string, args ConfigArgs, opts ...ResourceOption) (*Config, error)
    public Config(string name, ConfigArgs args, CustomResourceOptions? opts = null)
    public Config(String name, ConfigArgs args)
    public Config(String name, ConfigArgs args, CustomResourceOptions options)
    
    type: gcp:dataform:Config
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "gcp_dataform_config" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConfigArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConfigArgs
    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 configResource = new Gcp.Dataform.Config("configResource", new()
    {
        Region = "string",
        DefaultKmsKeyName = "string",
        Project = "string",
    });
    
    example, err := dataform.NewConfig(ctx, "configResource", &dataform.ConfigArgs{
    	Region:            pulumi.String("string"),
    	DefaultKmsKeyName: pulumi.String("string"),
    	Project:           pulumi.String("string"),
    })
    
    resource "gcp_dataform_config" "configResource" {
      lifecycle {
        create_before_destroy = true
      }
      region               = "string"
      default_kms_key_name = "string"
      project              = "string"
    }
    
    var configResource = new com.pulumi.gcp.dataform.Config("configResource", com.pulumi.gcp.dataform.ConfigArgs.builder()
        .region("string")
        .defaultKmsKeyName("string")
        .project("string")
        .build());
    
    config_resource = gcp.dataform.Config("configResource",
        region="string",
        default_kms_key_name="string",
        project="string")
    
    const configResource = new gcp.dataform.Config("configResource", {
        region: "string",
        defaultKmsKeyName: "string",
        project: "string",
    });
    
    type: gcp:dataform:Config
    properties:
        defaultKmsKeyName: string
        project: string
        region: string
    

    Config 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 Config resource accepts the following input properties:

    Region string
    A reference to the region
    DefaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A reference to the region
    DefaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A reference to the region
    default_kms_key_name string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region
    defaultKmsKeyName String
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A reference to the region
    defaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    A reference to the region
    default_kms_key_name str
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region
    defaultKmsKeyName String
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project 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 Config resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Config Resource

    Get an existing Config 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?: ConfigState, opts?: CustomResourceOptions): Config
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            default_kms_key_name: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None) -> Config
    func GetConfig(ctx *Context, name string, id IDInput, state *ConfigState, opts ...ResourceOption) (*Config, error)
    public static Config Get(string name, Input<string> id, ConfigState? state, CustomResourceOptions? opts = null)
    public static Config get(String name, Output<String> id, ConfigState state, CustomResourceOptions options)
    resources:  existingConfig:    type: gcp:dataform:Config    get:      id: ${id}
    import {
      to = gcp_dataform_config.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state ConfigState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state ConfigState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state ConfigState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state ConfigState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    DefaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A reference to the region
    DefaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A reference to the region
    default_kms_key_name string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A reference to the region
    defaultKmsKeyName String
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region
    defaultKmsKeyName string
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A reference to the region
    default_kms_key_name str
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    A reference to the region
    defaultKmsKeyName String
    Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region

    Import

    Config can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{region}}/config
    • {{project}}/{{region}}
    • {{region}}

    When using the pulumi import command, Config can be imported using one of the formats above. For example:

    $ pulumi import gcp:dataform/config:Config default projects/{{project}}/locations/{{region}}/config
    $ pulumi import gcp:dataform/config:Config default {{project}}/{{region}}
    $ pulumi import gcp:dataform/config:Config default {{region}}
    

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

    Package Details

    Repository
    Google Cloud (GCP) pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v10.5.0
    published on Wednesday, Nov 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial