Skip to content

Commit

Permalink
[DataprocGdc] Add Terraform support for Dataproc on GDC resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry Ding committed Oct 21, 2024
1 parent 9dc28c8 commit 5066214
Show file tree
Hide file tree
Showing 10 changed files with 714 additions and 0 deletions.
110 changes: 110 additions & 0 deletions mmv1/products/dataprocgdc/ApplicationEnvironment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
base_url: projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments
create_url: projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments?applicationEnvironmentId={{application_environment_id}}
self_link: projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments/{{application_environment_id}}
id_format: projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments/{{application_environment_id}}
import_format:
- projects/{{project}}/locations/{{location}}/serviceInstances/{{serviceinstance}}/applicationEnvironments/{{application_environment_id}}
name: ApplicationEnvironment
description: An ApplicationEnvironment contains shared configuration that may be referenced by multiple SparkApplications.
update_verb: PATCH
update_mask: true
autogen_async: false
properties:
- name: name
type: String
description: "Identifier. Fields 1-6 should exist for all declarative friendly resources
per\naip.dev/148 The name of the application environment.\nFormat:\nprojects/{project}/locations/{location}/serviceInstances/{service_instance}/applicationEnvironments/{application_environment_id} "
output: true
- name: uid
type: String
description: "Output only. System generated unique identifier for this application
environment,\nformatted as UUID4. "
output: true
- name: displayName
type: String
description: 'Optional. User-provided human-readable name to be used in user interfaces. '
- name: createTime
type: String
description: 'Output only. The timestamp when the resource was created. '
output: true
- name: updateTime
type: String
description: 'Output only. The timestamp when the resource was most recently updated. '
output: true
- name: labels
type: KeyValueLabels
output:
api_name:
description: "Optional. The labels to associate with this application environment.
Labels may be\nused for filtering and billing tracking. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
- name: annotations
type: KeyValueAnnotations
output:
api_name:
description: "Optional. The annotations to associate with this application environment.
Annotations\nmay be used to store client information, but are not used by the
server. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
- name: sparkApplicationEnvironmentConfig
type: NestedObject
properties:
- name: defaultProperties
type: KeyValuePairs
output:
api_name:
description: "Optional. A map of default Spark properties to apply to workloads
in this application\nenvironment. These defaults may be overridden by per-application\nproperties. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
- name: defaultVersion
type: String
description: "Optional. The default Dataproc version to use for applications submitted
to this\napplication environment "
description: 'Represents the SparkApplicationEnvironmentConfig. '
- name: namespace
type: String
description: "Optional. The name of the namespace in which to create this ApplicationEnvironment.\nThis
namespace must already exist in the cluster "
parameters:
- name: location
type: String
description: 'Resource ID segment making up resource `name`. It identifies the resource
within its parent collection as described in https://google.aip.dev/122. See documentation
for resource type `dataprocgdc.googleapis.com/ApplicationEnvironment`. '
url_param_only: true
required: true
immutable: true
- name: serviceinstance
type: String
description: 'Resource ID segment making up resource `name`. It identifies the resource
within its parent collection as described in https://google.aip.dev/122. See documentation
for resource type `dataprocgdc.googleapis.com/ApplicationEnvironment`. '
url_param_only: true
required: true
immutable: true
- name: applicationEnvironmentId
type: String
description: 'Optional. The id of the application environment '
url_param_only: true
immutable: true
examples:
- name: "dataprocgdc_applicationenvironment_basic"
primary_resource_id: "application-environment"
vars:
application_environment_id: "dp-tf-e2e-application-environment-basic"
- name: "dataprocgdc_applicationenvironment"
primary_resource_id: "application-environment"
vars:
application_environment_id: "dp-tf-e2e-application-environment"
132 changes: 132 additions & 0 deletions mmv1/products/dataprocgdc/ServiceInstance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
base_url: projects/{{project}}/locations/{{location}}/serviceInstances
create_url: projects/{{project}}/locations/{{location}}/serviceInstances?serviceInstanceId={{service_instance_id}}
self_link: projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
id_format: projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
import_format:
- projects/{{project}}/locations/{{location}}/serviceInstances/{{service_instance_id}}
name: ServiceInstance
description: A service instance is an instance of the Dataproc operator running on a GDC cluster.
autogen_async: true
properties:
- name: gdceCluster
type: NestedObject
properties:
- name: gdceCluster
type: String
description: 'Required. Gdce cluster resource id. '
required: true
description: 'Gdce cluster information. '
- name: name
type: String
description: 'Identifier. The name of the service instance. '
output: true
- name: uid
type: String
description: "Output only. System generated unique identifier for this service instance,
formatted as\nUUID4. "
output: true
- name: displayName
type: String
description: 'Optional. User-provided human-readable name to be used in user interfaces. '
- name: createTime
type: String
description: 'Output only. The timestamp when the resource was created. '
output: true
- name: updateTime
type: String
description: 'Output only. The timestamp when the resource was most recently updated. '
output: true
- name: requestedState
type: String
description: "Output only. The intended state to which the service instance is reconciling.
\n Possible values:\n STATE_UNSPECIFIED\nCREATING\nACTIVE\nDISCONNECTED\nDELETING\nSTOPPING\nSTOPPED\nSTARTING\nUPDATING\nFAILED"
output: true
- name: state
type: String
description: "Output only. The current state. \n Possible values:\n STATE_UNSPECIFIED\nCREATING\nACTIVE\nDISCONNECTED\nDELETING\nSTOPPING\nSTOPPED\nSTARTING\nUPDATING\nFAILED"
output: true
- name: reconciling
type: Boolean
description: "Output only. Whether the service instance is currently reconciling.\nTrue
if the current state of the resource does not match the\nintended state, and the
system is working to reconcile them, whether\nor not the change was user initiated.\nRequired
by aip.dev/128#reconciliation "
output: true
- name: labels
type: KeyValueLabels
output:
api_name:
description: "Optional. The labels to associate with this service instance. Labels
may be used for\nfiltering and billing tracking. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
- name: annotations
type: KeyValueAnnotations
output:
api_name:
description: "Optional. The annotations to associate with this service instance.
Annotations may be\nused to store client information, but are not used by the
server. "
min_version:
ignore_write:
update_verb:
update_url:
immutable:
- name: sparkServiceInstanceConfig
type: NestedObject
properties: []
description: 'Spark-specific service instance configuration. '
- name: stateMessage
type: String
description: 'Output only. A message explaining the current state. '
output: true
- name: serviceAccount
type: String
description: 'Optional. Requested service account to associate with ServiceInstance. '
- name: effectiveServiceAccount
type: String
description: "Output only. Effective service account associated with ServiceInstance.
This will be\nthe service_account if specified. Otherwise, it will be an automatically\ncreated
per-resource P4SA that also automatically has Fleet Workload\nIdentity bindings
applied. "
output: true
parameters:
- name: location
type: String
description: 'Resource ID segment making up resource `name`. It identifies the resource
within its parent collection as described in https://google.aip.dev/122. See documentation
for resource type `dataprocgdc.googleapis.com/SparkApplication`. '
url_param_only: true
required: true
immutable: true
- name: serviceInstanceId
type: String
description: "Required. Id of the requesting object\nIf auto-generating Id server-side,
remove this field and\nservice_instance_id from the method_signature of Create
RPC "
url_param_only: true
required: true
immutable: true
async:
actions: ['create', 'delete']
type: OpAsync
operation:
path: name
base_url: "{{op_id}}"
wait_ms: 1000
timeouts:
result:
path: response
resource_inside_response: false
error:
path: error
message: message
immutable: true
examples:
- name: "dataprocgdc_serviceinstance_basic"
primary_resource_id: "service-instance"
vars:
service_instance_id: "tf-e2e-service-instance-basic"
Loading

0 comments on commit 5066214

Please sign in to comment.