import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Dataproc Serverless session template defines the configuration settings for * creating one or more Dataproc Serverless interactive sessions. * * To get more information about SessionTemplate, see: * * * [API documentation](https://cloud.google.com/dataproc-serverless/docs/reference/rest/v1/projects.locations.sessionTemplates) * * How-to Guides * * [Dataproc Serverless Session Templates](https://cloud.google.com/dataproc-serverless/docs/guides/create-serverless-sessions-templates#create-dataproc-serverless-session-template) * * ## Example Usage * * ### Dataproc Session Templates Jupyter * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const exampleSessionTemplatesJupyter = new gcp.dataproc.SessionTemplate("example_session_templates_jupyter", { * name: "projects/my-project-name/locations/us-central1/sessionTemplates/jupyter-session-template", * location: "us-central1", * labels: { * session_template_test: "terraform", * }, * runtimeConfig: { * properties: { * "spark.dynamicAllocation.enabled": "false", * "spark.executor.instances": "2", * }, * }, * environmentConfig: { * executionConfig: { * subnetworkUri: "default", * idleTtl: "3600s", * networkTags: ["tag1"], * authenticationConfig: { * userWorkloadAuthenticationType: "END_USER_CREDENTIALS", * }, * }, * }, * jupyterSession: { * kernel: "PYTHON", * displayName: "tf python kernel", * }, * }); * ``` * ### Dataproc Session Templates Jupyter Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const gcsAccount = gcp.storage.getProjectServiceAccount({}); * const bucket = new gcp.storage.Bucket("bucket", { * uniformBucketLevelAccess: true, * name: "dataproc-bucket", * location: "US", * forceDestroy: true, * }); * const cryptoKeyMember1 = new gcp.kms.CryptoKeyIAMMember("crypto_key_member_1", { * cryptoKeyId: "example-key", * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: project.then(project => `serviceAccount:service-${project.number}@dataproc-accounts.iam.gserviceaccount.com`), * }); * const ms = new gcp.dataproc.MetastoreService("ms", { * serviceId: "jupyter-session-template", * location: "us-central1", * port: 9080, * tier: "DEVELOPER", * maintenanceWindow: { * hourOfDay: 2, * dayOfWeek: "SUNDAY", * }, * hiveMetastoreConfig: { * version: "3.1.2", * }, * networkConfig: { * consumers: [{ * subnetwork: "projects/my-project-name/regions/us-central1/subnetworks/default", * }], * }, * }); * const basic = new gcp.dataproc.Cluster("basic", { * name: "jupyter-session-template", * region: "us-central1", * clusterConfig: { * softwareConfig: { * overrideProperties: { * "dataproc:dataproc.allow.zero.workers": "true", * "spark:spark.history.fs.logDirectory": pulumi.interpolate`gs://${bucket.name}/*/spark-job-history`, * }, * }, * gceClusterConfig: { * subnetwork: "default", * }, * endpointConfig: { * enableHttpPortAccess: true, * }, * masterConfig: { * numInstances: 1, * machineType: "e2-standard-2", * diskConfig: { * bootDiskSizeGb: 35, * }, * }, * metastoreConfig: { * dataprocMetastoreService: ms.name, * }, * }, * }); * const dataprocSessionTemplatesJupyterFull = new gcp.dataproc.SessionTemplate("dataproc_session_templates_jupyter_full", { * name: "projects/my-project-name/locations/us-central1/sessionTemplates/jupyter-session-template", * location: "us-central1", * labels: { * session_template_test: "terraform", * }, * runtimeConfig: { * properties: { * "spark.dynamicAllocation.enabled": "false", * "spark.executor.instances": "2", * }, * version: "2.2", * containerImage: "us-docker.pkg.dev/my-project-name/s8s-spark-test-images/s8s-spark:latest", * }, * environmentConfig: { * executionConfig: { * ttl: "3600s", * networkTags: ["tag1"], * kmsKey: "example-key", * subnetworkUri: "default", * serviceAccount: project.then(project => `${project.number}-compute@developer.gserviceaccount.com`), * stagingBucket: bucket.name, * authenticationConfig: { * userWorkloadAuthenticationType: "SERVICE_ACCOUNT", * }, * }, * peripheralsConfig: { * metastoreService: ms.name, * sparkHistoryServerConfig: { * dataprocCluster: basic.id, * }, * }, * }, * jupyterSession: { * kernel: "PYTHON", * displayName: "tf python kernel", * }, * }, { * dependsOn: [cryptoKeyMember1], * }); * ``` * ### Dataproc Session Templates Spark Connect * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const exampleSessionTemplatesSparkConnect = new gcp.dataproc.SessionTemplate("example_session_templates_spark_connect", { * name: "projects/my-project-name/locations/us-central1/sessionTemplates/sc-session-template", * location: "us-central1", * labels: { * session_template_test: "terraform", * }, * runtimeConfig: { * properties: { * "spark.dynamicAllocation.enabled": "false", * "spark.executor.instances": "2", * }, * }, * environmentConfig: { * executionConfig: { * subnetworkUri: "default", * ttl: "3600s", * networkTags: ["tag1"], * }, * }, * }); * ``` * * ## Import * * SessionTemplate can be imported using any of these accepted formats: * * * `{{name}}` * * When using the `pulumi import` command, SessionTemplate can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataproc/sessionTemplate:SessionTemplate default {{name}} * ``` */ export declare class SessionTemplate extends pulumi.CustomResource { /** * Get an existing SessionTemplate 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, state?: SessionTemplateState, opts?: pulumi.CustomResourceOptions): SessionTemplate; /** * Returns true if the given object is an instance of SessionTemplate. 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 SessionTemplate; /** * The time when the session template was created. */ readonly createTime: pulumi.Output; /** * The email address of the user who created the session template. */ readonly creator: pulumi.Output; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Environment configuration for the session execution. * Structure is documented below. */ readonly environmentConfig: pulumi.Output; /** * Jupyter configuration for an interactive session. * Structure is documented below. */ readonly jupyterSession: pulumi.Output; /** * The labels to associate with this session template. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The location in which the session template will be created in. */ readonly location: pulumi.Output; /** * The resource name of the session template in the following format: * projects/{project}/locations/{location}/sessionTemplates/{template_id} */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Runtime configuration for the session template. * Structure is documented below. */ readonly runtimeConfig: pulumi.Output; /** * Spark connect configuration for an interactive session. */ readonly sparkConnectSession: pulumi.Output; /** * The time when the session template was updated. */ readonly updateTime: pulumi.Output; /** * A session template UUID (Unique Universal Identifier). The service generates this value when it creates the session template. */ readonly uuid: pulumi.Output; /** * Create a SessionTemplate 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?: SessionTemplateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SessionTemplate resources. */ export interface SessionTemplateState { /** * The time when the session template was created. */ createTime?: pulumi.Input; /** * The email address of the user who created the session template. */ creator?: pulumi.Input; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Environment configuration for the session execution. * Structure is documented below. */ environmentConfig?: pulumi.Input; /** * Jupyter configuration for an interactive session. * Structure is documented below. */ jupyterSession?: pulumi.Input; /** * The labels to associate with this session template. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The location in which the session template will be created in. */ location?: pulumi.Input; /** * The resource name of the session template in the following format: * projects/{project}/locations/{location}/sessionTemplates/{template_id} */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Runtime configuration for the session template. * Structure is documented below. */ runtimeConfig?: pulumi.Input; /** * Spark connect configuration for an interactive session. */ sparkConnectSession?: pulumi.Input; /** * The time when the session template was updated. */ updateTime?: pulumi.Input; /** * A session template UUID (Unique Universal Identifier). The service generates this value when it creates the session template. */ uuid?: pulumi.Input; } /** * The set of arguments for constructing a SessionTemplate resource. */ export interface SessionTemplateArgs { /** * Environment configuration for the session execution. * Structure is documented below. */ environmentConfig?: pulumi.Input; /** * Jupyter configuration for an interactive session. * Structure is documented below. */ jupyterSession?: pulumi.Input; /** * The labels to associate with this session template. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The location in which the session template will be created in. */ location?: pulumi.Input; /** * The resource name of the session template in the following format: * projects/{project}/locations/{location}/sessionTemplates/{template_id} */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * Runtime configuration for the session template. * Structure is documented below. */ runtimeConfig?: pulumi.Input; /** * Spark connect configuration for an interactive session. */ sparkConnectSession?: pulumi.Input; }