Skip to content

Commit

Permalink
alloydb: make psc_instance_config O+C in google_alloydb_instance (#11444
Browse files Browse the repository at this point in the history
)
  • Loading branch information
marblejenka authored Aug 14, 2024
1 parent f34f5c6 commit 69a0316
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mmv1/products/alloydb/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ examples:
- 'reconciling'
- 'update_time'
skip_docs: true
- !ruby/object:Provider::Terraform::Examples
name: 'alloydb_instance_psc_test'
primary_resource_id: 'default'
vars:
alloydb_cluster_name: 'alloydb-cluster'
alloydb_instance_name: 'alloydb-instance'
network_name: 'alloydb-network'
ignore_read_extra:
- 'reconciling'
- 'update_time'
skip_docs: true
parameters:
- !ruby/object:Api::Type::ResourceRef
name: 'cluster'
Expand Down Expand Up @@ -310,6 +321,7 @@ properties:
- :ALLOW_UNENCRYPTED_AND_ENCRYPTED
- !ruby/object:Api::Type::NestedObject
name: 'pscInstanceConfig'
default_from_api: true
description: |
Configuration for Private Service Connect (PSC) for the instance.
properties:
Expand Down
21 changes: 21 additions & 0 deletions mmv1/templates/terraform/examples/alloydb_instance_psc_test.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource "google_alloydb_instance" "<%= ctx[:primary_resource_id] %>" {
cluster = google_alloydb_cluster.<%= ctx[:primary_resource_id] %>.name
instance_id = "<%= ctx[:vars]['alloydb_instance_name'] %>"
instance_type = "PRIMARY"

machine_config {
cpu_count = 2
}
}

resource "google_alloydb_cluster" "<%= ctx[:primary_resource_id] %>" {
cluster_id = "<%= ctx[:vars]['alloydb_cluster_name'] %>"
location = "us-central1"

initial_user {
password = "<%= ctx[:vars]['alloydb_cluster_name'] %>"
}
psc_config {
psc_enabled = true
}
}

0 comments on commit 69a0316

Please sign in to comment.