Skip to content

Commit 09127da

Browse files
authored
Remove immutable property from MulticastDomain.yaml (#15900)
1 parent 943d9d6 commit 09127da

File tree

2 files changed

+113
-4
lines changed

2 files changed

+113
-4
lines changed

mmv1/products/networkservices/MulticastDomain.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
---
1515
name: MulticastDomain
1616
description: Create a multicast domain in the current project.
17+
references:
18+
guides:
19+
'Create Multicast Domain': 'https://docs.cloud.google.com/vpc/docs/multicast/create-domains#create-domain'
20+
api: 'https://docs.cloud.google.com/vpc/docs/multicast/reference/rest/v1/projects.locations.multicastDomains'
1721
base_url: projects/{{project}}/locations/{{location}}/multicastDomains
1822
update_mask: true
1923
self_link:
2024
projects/{{project}}/locations/{{location}}/multicastDomains/{{multicast_domain_id}}
2125
create_url:
2226
projects/{{project}}/locations/{{location}}/multicastDomains?multicastDomainId={{multicast_domain_id}}
27+
update_verb: PATCH
2328
import_format:
2429
- projects/{{project}}/locations/{{location}}/multicastDomains/{{multicast_domain_id}}
2530
examples:
@@ -29,7 +34,6 @@ examples:
2934
network_name: test-md-network
3035
domain_name: test-md-domain
3136
autogen_async: true
32-
immutable: true
3337
async:
3438
operation:
3539
timeouts:
@@ -100,7 +104,7 @@ properties:
100104
immutable: true
101105
- name: createTime
102106
type: String
103-
description: '[Output only] The timestamp when the multicast domain was created.'
107+
description: 'The timestamp when the multicast domain was created.'
104108
output: true
105109
- name: description
106110
type: String
@@ -125,14 +129,32 @@ properties:
125129
- name: uniqueId
126130
type: String
127131
description: |-
128-
[Output only] The Google-generated UUID for the resource. This value is
132+
The Google-generated UUID for the resource. This value is
129133
unique across all multicast domain resources. If a domain is deleted and
130134
another with the same name is created, the new domain is assigned a
131135
different unique_id.
132136
output: true
137+
- name: state
138+
type: NestedObject
139+
description: The multicast resource's state.
140+
output: true
141+
properties:
142+
- name: state
143+
type: String
144+
description: |-
145+
The state of the multicast resource.
146+
Possible values:
147+
CREATING
148+
ACTIVE
149+
DELETING
150+
DELETE_FAILED
151+
UPDATING
152+
UPDATE_FAILED
153+
INACTIVE
154+
output: true
133155
- name: updateTime
134156
type: String
135157
description: |-
136-
[Output only] The timestamp when the multicast domain was most recently
158+
The timestamp when the multicast domain was most recently
137159
updated.
138160
output: true
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
package networkservices_test
2+
3+
import (
4+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
5+
"github.com/hashicorp/terraform-plugin-testing/plancheck"
6+
"github.com/hashicorp/terraform-provider-google/google/acctest"
7+
"testing"
8+
)
9+
10+
func TestAccNetworkServicesMulticastDomain_networkServicesMulticastDomainUpdateExample(t *testing.T) {
11+
t.Parallel()
12+
13+
context := map[string]interface{}{
14+
"random_suffix": acctest.RandString(t, 10),
15+
}
16+
17+
acctest.VcrTest(t, resource.TestCase{
18+
PreCheck: func() { acctest.AccTestPreCheck(t) },
19+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
20+
CheckDestroy: testAccCheckNetworkServicesMulticastDomainDestroyProducer(t),
21+
Steps: []resource.TestStep{
22+
{
23+
Config: testAccNetworkServicesMulticastDomain_networkServicesMulticastDomainUpdateExample_full(context),
24+
},
25+
{
26+
ResourceName: "google_network_services_multicast_domain.md_test",
27+
ImportState: true,
28+
ImportStateVerify: true,
29+
ImportStateVerifyIgnore: []string{"labels", "location", "multicast_domain_id", "terraform_labels"},
30+
},
31+
{
32+
Config: testAccNetworkServicesMulticastDomain_networkServicesMulticastDomainUpdateExample_diff(context),
33+
ConfigPlanChecks: resource.ConfigPlanChecks{
34+
PreApply: []plancheck.PlanCheck{
35+
plancheck.ExpectResourceAction("google_network_services_multicast_domain.md_test", plancheck.ResourceActionUpdate),
36+
},
37+
},
38+
},
39+
{
40+
ResourceName: "google_network_services_multicast_domain.md_test",
41+
ImportState: true,
42+
ImportStateVerify: true,
43+
ImportStateVerifyIgnore: []string{"labels", "location", "multicast_domain_id", "terraform_labels"},
44+
},
45+
},
46+
})
47+
}
48+
49+
func testAccNetworkServicesMulticastDomain_networkServicesMulticastDomainUpdateExample_full(context map[string]interface{}) string {
50+
return acctest.Nprintf(`
51+
resource "google_compute_network" "network" {
52+
name = "tf-test-test-md-network%{random_suffix}"
53+
auto_create_subnetworks = false
54+
}
55+
resource "google_network_services_multicast_domain" md_test {
56+
multicast_domain_id = "tf-test-test-md-domain%{random_suffix}"
57+
location = "global"
58+
admin_network = google_compute_network.network.id
59+
connection_config {
60+
connection_type="SAME_VPC"
61+
}
62+
depends_on = [google_compute_network.network]
63+
}
64+
`, context)
65+
}
66+
67+
func testAccNetworkServicesMulticastDomain_networkServicesMulticastDomainUpdateExample_diff(context map[string]interface{}) string {
68+
return acctest.Nprintf(`
69+
resource "google_compute_network" "network" {
70+
name = "tf-test-test-md-network%{random_suffix}"
71+
auto_create_subnetworks = false
72+
}
73+
resource "google_network_services_multicast_domain" md_test {
74+
multicast_domain_id = "tf-test-test-md-domain%{random_suffix}"
75+
location = "global"
76+
description = "A sample domain"
77+
labels = {
78+
label-one = "value-one"
79+
}
80+
admin_network = google_compute_network.network.id
81+
connection_config {
82+
connection_type="SAME_VPC"
83+
}
84+
depends_on = [google_compute_network.network]
85+
}
86+
`, context)
87+
}

0 commit comments

Comments
 (0)