Skip to content

Commit 47b9394

Browse files
SSM: make ca_pool argument optional for private instances that use Google-managed trusted certificates. (#14900) (#24039)
[upstream:bf1af53e43bf453353a95b36229fb5adf1c8a0fe] Signed-off-by: Modular Magician <[email protected]>
1 parent 37babef commit 47b9394

File tree

4 files changed

+48
-7
lines changed

4 files changed

+48
-7
lines changed

.changelog/14900.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
ssm: make `ca_pool` argument optional for private instances that use Google-managed trusted certificates.` to `secure_source_manager` resource
3+
```

google/services/securesourcemanager/resource_secure_source_manager_instance.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@ Please refer to the field 'effective_labels' for all of the labels present on th
9292
MaxItems: 1,
9393
Elem: &schema.Resource{
9494
Schema: map[string]*schema.Schema{
95-
"ca_pool": {
96-
Type: schema.TypeString,
97-
Required: true,
98-
ForceNew: true,
99-
Description: `CA pool resource, resource must in the format of 'projects/{project}/locations/{location}/caPools/{ca_pool}'.`,
100-
},
10195
"is_private": {
10296
Type: schema.TypeBool,
10397
Required: true,
10498
ForceNew: true,
10599
Description: `'Indicate if it's private instance.'`,
106100
},
101+
"ca_pool": {
102+
Type: schema.TypeString,
103+
Optional: true,
104+
ForceNew: true,
105+
Description: `CA pool resource, resource must in the format of 'projects/{project}/locations/{location}/caPools/{ca_pool}'.`,
106+
},
107107
"http_service_attachment": {
108108
Type: schema.TypeString,
109109
Computed: true,

google/services/securesourcemanager/resource_secure_source_manager_instance_generated_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,44 @@ data "google_project" "project" {}
124124
`, context)
125125
}
126126

127+
func TestAccSecureSourceManagerInstance_secureSourceManagerInstancePrivateTrustedCertExample(t *testing.T) {
128+
t.Parallel()
129+
130+
context := map[string]interface{}{
131+
"random_suffix": acctest.RandString(t, 10),
132+
}
133+
134+
acctest.VcrTest(t, resource.TestCase{
135+
PreCheck: func() { acctest.AccTestPreCheck(t) },
136+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
137+
CheckDestroy: testAccCheckSecureSourceManagerInstanceDestroyProducer(t),
138+
Steps: []resource.TestStep{
139+
{
140+
Config: testAccSecureSourceManagerInstance_secureSourceManagerInstancePrivateTrustedCertExample(context),
141+
},
142+
{
143+
ResourceName: "google_secure_source_manager_instance.default",
144+
ImportState: true,
145+
ImportStateVerify: true,
146+
ImportStateVerifyIgnore: []string{"instance_id", "labels", "location", "terraform_labels", "update_time"},
147+
},
148+
},
149+
})
150+
}
151+
152+
func testAccSecureSourceManagerInstance_secureSourceManagerInstancePrivateTrustedCertExample(context map[string]interface{}) string {
153+
return acctest.Nprintf(`
154+
resource "google_secure_source_manager_instance" "default" {
155+
instance_id = "tf-test-my-instance%{random_suffix}"
156+
location = "us-central1"
157+
158+
private_config {
159+
is_private = true
160+
}
161+
}
162+
`, context)
163+
}
164+
127165
func TestAccSecureSourceManagerInstance_secureSourceManagerInstancePrivateExample(t *testing.T) {
128166
t.Parallel()
129167

website/docs/r/secure_source_manager_instance.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ Default is `DELETE`. Possible values are:
601601
'Indicate if it's private instance.'
602602

603603
* `ca_pool` -
604-
(Required)
604+
(Optional)
605605
CA pool resource, resource must in the format of `projects/{project}/locations/{location}/caPools/{ca_pool}`.
606606

607607
* `http_service_attachment` -

0 commit comments

Comments
 (0)