Skip to content

Commit

Permalink
This PR adds support for the Dataproc on GDC Service Instance resourc…
Browse files Browse the repository at this point in the history
…e to the provider.

**Release Note Template for Downstream PRs (will be copied)**

```release-note:new-resource
`google_dataproc_gdc_service_instance`
  • Loading branch information
Jerry Ding committed Oct 21, 2024
1 parent 9dc28c8 commit a052996
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 0 deletions.
136 changes: 136 additions & 0 deletions mmv1/products/dataprocgdc/ServiceInstance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
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"
- name: "dataprocgdc_serviceinstance"
primary_resource_id: "service-instance"
vars:
service_instance_id: "tf-e2e-service-instance"
9 changes: 9 additions & 0 deletions mmv1/products/dataprocgdc/product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- !ruby/object:Api::Product
versions:
- !ruby/object:Api::Product::Version
base_url: https://dataprocgdc.googleapis.com/v1/
name: ga
name: DataprocGdc
display_name: Dataproc on GDC
scopes:
- https://www.googleapis.com/auth/cloud-platform
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "google_dataproc_gdc_service_instance" "{{$.PrimaryResourceId}}" {
service_instance_id = "{{index $.Vars "service_instance_id"}}"
location = "us-west2"
gdce_cluster {
gdce_cluster = "projects/gdce-cluster-monitoring/locations/us-west2/clusters/gdce-prism-prober-ord106"
}
display_name = "A service instance for a Terraform create test"
labels = {
"test-label": "label-value"
}
annotations = {
"an_annotation": "annotation_value"
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "google_dataproc_gdc_service_instance" "{{$.PrimaryResourceId}}" {
service_instance_id = "{{index $.Vars "service_instance_id"}}"
location = "us-west2"
gdce_cluster {
gdce_cluster = "projects/gdce-cluster-monitoring/locations/us-west2/clusters/gdce-prism-prober-ord106"
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ var ServicesListGa = mapOf(
"displayName" to "Dataproc",
"path" to "./google/services/dataproc"
),
"dataprocgdc" to mapOf(
"name" to "dataprocgdc",
"displayName" to "Dataproc on GDC",
"path" to "./google/services/dataprocgdc"
),
"dataprocmetastore" to mapOf(
"name" to "dataprocmetastore",
"displayName" to "Dataprocmetastore",
Expand Down

0 comments on commit a052996

Please sign in to comment.