Skip to content

Commit

Permalink
add autoscaling to DPMS terraform provider
Browse files Browse the repository at this point in the history
add autoscaling to DPMS terraform provider

Update mmv1/templates/terraform/examples/go/dataproc_metastore_service_autoscaling_max_scaling_factor.tf.tmpl

Co-authored-by: Nick Elliot <nickelliot@google.com>

Update mmv1/templates/terraform/examples/go/dataproc_metastore_service_autoscaling_min_and_max_scaling_factor.tf.tmpl

Co-authored-by: Nick Elliot <nickelliot@google.com>

Update mmv1/templates/terraform/examples/go/dataproc_metastore_service_autoscaling_no_limit_config.tf.tmpl

Co-authored-by: Nick Elliot <nickelliot@google.com>

Update mmv1/templates/terraform/examples/go/dataproc_metastore_service_autoscaling_min_scaling_factor.tf.tmpl

Co-authored-by: Nick Elliot <nickelliot@google.com>

Fixes GITHUB_ISSUE_LINK
  • Loading branch information
brandon-m-hansen committed May 13, 2024
1 parent ce618c8 commit 13f6eab
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
47 changes: 47 additions & 0 deletions mmv1/products/metastore/Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,26 @@ examples:
primary_resource_id: 'backup'
vars:
metastore_service_name: 'backup'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_max_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_min_and_max_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_min_scaling_factor'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
- !ruby/object:Provider::Terraform::Examples
name: 'dataproc_metastore_service_autoscaling_no_limit_config'
primary_resource_id: 'test_resource'
vars:
metastore_service_name: 'test-service'
parameters:
- !ruby/object:Api::Type::String
name: 'serviceId'
Expand Down Expand Up @@ -228,6 +248,7 @@ properties:
exactly_one_of:
- scaling_config.0.instance_size
- scaling_config.0.scaling_factor
- scaling_config.0.autoscaling_config
conflicts:
- tier
values:
Expand All @@ -241,6 +262,32 @@ properties:
description: |
Scaling factor, in increments of 0.1 for values less than 1.0, and increments of 1.0 for values greater than 1.0.
required: false
- !ruby/object:Api::Type::NestedObject
name: 'autoscalingConfig'
min_version: beta
description: |
Represents the autoscaling configuration of a metastore service.
required: false
properties:
- !ruby/object:Api::Type::Boolean
name: 'autoscalingEnabled'
description: |
Defines whether autoscaling is enabled. The default value is false.
- !ruby/object:Api::Type::NestedObject
name: 'limitConfig'
description: |
Represents the limit configuration of a metastore service.
properties:
- !ruby/object:Api::Type::Double
name: 'minScalingFactor'
description: |
The minimum scaling factor that the service will autoscale to. The default value is 0.1.
default_from_api: true
- !ruby/object:Api::Type::Double
name: 'maxScalingFactor'
description: |
The maximum scaling factor that the service will autoscale to. The default value is 6.0.
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'scheduledBackup'
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
max_scaling_factor = "1.0"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = "0.1"
max_scaling_factor = "1.0"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
limit_config {
min_scaling_factor = "0.1"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_dataproc_metastore_service" "{{$.PrimaryResourceId}}" {
service_id = "{{index $.Vars "metastore_service_name"}}"
location = "us-central1"

# DPMS 2 requires SPANNER database type, and does not require
# a maintenance window.
database_type = "SPANNER"

hive_metastore_config {
version = "3.1.2"
}

scaling_config {
autoscaling_config {
autoscaling_enabled = true
}
}
}

0 comments on commit 13f6eab

Please sign in to comment.