UNPKG

@pulumi/gcp

Version:

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

191 lines 6.99 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages Cloud Observability settings for a folder. * * > **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. * * ## Example Usage * * ### Observability Folder Settings Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const testFolder = new gcp.organizations.Folder("test_folder", { * displayName: "tf-test-_76273", * parent: "organizations/123456789", * deletionProtection: false, * }); * // Wait for the folder to be created and recognized by the Observability API * const waitForSettingsPropagation = new time.Sleep("wait_for_settings_propagation", {createDuration: "90s"}, { * dependsOn: [testFolder], * }); * const settingsData = gcp.observability.getFolderSettingsOutput({ * folder: testFolder.folderId, * location: "us", * }); * // Add a delay to allow the service account to propagate * const waitForSaPropagation = new time.Sleep("wait_for_sa_propagation", {createDuration: "90s"}, { * dependsOn: [settingsData], * }); * const iam = new gcp.kms.CryptoKeyIAMMember("iam", { * cryptoKeyId: "example-key", * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: settingsData.apply(settingsData => `serviceAccount:${settingsData.serviceAccountId}`), * }, { * dependsOn: [waitForSaPropagation], * }); * const primary = new gcp.observability.FolderSettings("primary", { * location: "us", * folder: testFolder.folderId, * kmsKeyName: "example-key", * }, { * dependsOn: [iam], * }); * ``` * ### Observability Folder Settings Basic Global * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const testFolder = new gcp.organizations.Folder("test_folder", { * displayName: "tf-test-_25601", * parent: "organizations/123456789", * deletionProtection: false, * }); * // Wait for the folder to be created and recognized by the Observability API * const waitForFolder = new time.Sleep("wait_for_folder", {createDuration: "90s"}, { * dependsOn: [testFolder], * }); * const settingsData = gcp.observability.getFolderSettingsOutput({ * folder: testFolder.folderId, * location: "global", * }); * const primaryGlobal = new gcp.observability.FolderSettings("primary_global", { * location: "global", * folder: testFolder.folderId, * defaultStorageLocation: "us", * }, { * dependsOn: [settingsData], * }); * ``` * * ## Import * * FolderSettings can be imported using any of these accepted formats: * * * `folders/{{folder}}/locations/{{location}}/settings` * * `{{folder}}/{{location}}` * * When using the `pulumi import` command, FolderSettings can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:observability/folderSettings:FolderSettings default folders/{{folder}}/locations/{{location}}/settings * $ pulumi import gcp:observability/folderSettings:FolderSettings default {{folder}}/{{location}} * ``` */ export declare class FolderSettings extends pulumi.CustomResource { /** * Get an existing FolderSettings 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?: FolderSettingsState, opts?: pulumi.CustomResourceOptions): FolderSettings; /** * Returns true if the given object is an instance of FolderSettings. 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 FolderSettings; /** * The default storage location for new resources, e.g. buckets. Only valid for global location. */ readonly defaultStorageLocation: pulumi.Output<string | undefined>; /** * The folder ID. */ readonly folder: pulumi.Output<string>; /** * The default Cloud KMS key to use for new resources. Only valid for regional locations. */ readonly kmsKeyName: pulumi.Output<string | undefined>; /** * The location of the settings. */ readonly location: pulumi.Output<string>; /** * The resource name of the settings. */ readonly name: pulumi.Output<string>; /** * The service account used by Cloud Observability for this folder. */ readonly serviceAccountId: pulumi.Output<string>; /** * Create a FolderSettings 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: FolderSettingsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FolderSettings resources. */ export interface FolderSettingsState { /** * The default storage location for new resources, e.g. buckets. Only valid for global location. */ defaultStorageLocation?: pulumi.Input<string | undefined>; /** * The folder ID. */ folder?: pulumi.Input<string | undefined>; /** * The default Cloud KMS key to use for new resources. Only valid for regional locations. */ kmsKeyName?: pulumi.Input<string | undefined>; /** * The location of the settings. */ location?: pulumi.Input<string | undefined>; /** * The resource name of the settings. */ name?: pulumi.Input<string | undefined>; /** * The service account used by Cloud Observability for this folder. */ serviceAccountId?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a FolderSettings resource. */ export interface FolderSettingsArgs { /** * The default storage location for new resources, e.g. buckets. Only valid for global location. */ defaultStorageLocation?: pulumi.Input<string | undefined>; /** * The folder ID. */ folder: pulumi.Input<string>; /** * The default Cloud KMS key to use for new resources. Only valid for regional locations. */ kmsKeyName?: pulumi.Input<string | undefined>; /** * The location of the settings. */ location: pulumi.Input<string>; } //# sourceMappingURL=folderSettings.d.ts.map