UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

204 lines 7.45 kB
import * as pulumi from "@pulumi/pulumi"; /** * Config is a singleton resource used to configure the default Dataform settings for a specified location. * * > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. * See Provider Versions for more details on beta resources. * * To get more information about Config, see: * * * [API documentation](https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dataform/docs/) * * ## Example Usage * * ### Dataform Config With Kms Key * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const project = new gcp.organizations.Project("project", { * name: "project-1", * projectId: "project-1", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * // Enable Cloud Key KMS API * const cloudkmsApi = new gcp.projects.Service("cloudkms_api", { * project: project.projectId, * service: "cloudkms.googleapis.com", * disableOnDestroy: false, * }); * // Enable Dataform API * const dataformApi = new gcp.projects.Service("dataform_api", { * project: project.projectId, * service: "dataform.googleapis.com", * disableOnDestroy: false, * }, { * dependsOn: [cloudkmsApi], * }); * // Add a sleep to wait for IAM propagation after API enablement * const waitForDataformApi = new time.Sleep("wait_for_dataform_api", {createDuration: "30s"}, { * dependsOn: [dataformApi], * }); * // Retrieve the Dataform service identity * const dataformSa = new gcp.projects.ServiceIdentity("dataform_sa", { * project: project.projectId, * service: "dataform.googleapis.com", * }, { * dependsOn: [waitForDataformApi], * }); * const keyring = new gcp.kms.KeyRing("keyring", { * project: project.projectId, * name: "example-key-ring", * location: "us-central1", * }, { * dependsOn: [waitForDataformApi], * }); * 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: dataformSa.member, * }); * // Config with KMS key provided * const config = new gcp.dataform.Config("config", { * region: "us-central1", * defaultKmsKeyName: exampleKey.id, * project: project.projectId, * }, { * dependsOn: [cryptoKeyBinding], * }); * ``` * ### Dataform Config Without Kms Key * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const project = new gcp.organizations.Project("project", { * name: "project-1", * projectId: "project-1", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * // Enable Dataform API * const dataformApi = new gcp.projects.Service("dataform_api", { * project: project.projectId, * service: "dataform.googleapis.com", * disableOnDestroy: false, * }); * // Add a sleep to wait for IAM propagation after API enablement * const waitForDataformApi = new time.Sleep("wait_for_dataform_api", {createDuration: "30s"}, { * dependsOn: [dataformApi], * }); * // Config without KMS key provided * const config = new gcp.dataform.Config("config", { * region: "us-central1", * project: project.projectId, * }, { * dependsOn: [waitForDataformApi], * }); * ``` * * ## 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: * * ```sh * $ 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}} * ``` */ export declare class Config extends pulumi.CustomResource { /** * Get an existing Config resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ConfigState, opts?: pulumi.CustomResourceOptions): Config; /** * Returns true if the given object is an instance of Config. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Config; /** * Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data. */ readonly defaultKmsKeyName: pulumi.Output<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * A reference to the region */ readonly region: pulumi.Output<string>; /** * Create a Config resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Config resources. */ export interface ConfigState { /** * Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data. */ defaultKmsKeyName?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * A reference to the region */ region?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a Config resource. */ export interface ConfigArgs { /** * Optional. A reference to the customer-managed encryption key (CMEK) that will be used by default to encrypt user data. */ defaultKmsKeyName?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * A reference to the region */ region: pulumi.Input<string>; } //# sourceMappingURL=config.d.ts.map