@@ -142,6 +142,52 @@ func TestAccNetworkRSNetworkPeering_basicGCP(t *testing.T) {
142
142
})
143
143
}
144
144
145
+ func TestAccNetworkRSNetworkPeering_updateBasicGCP (t * testing.T ) {
146
+ acc .SkipTestForCI (t ) // needs GCP configuration
147
+
148
+ var (
149
+ projectID = os .Getenv ("MONGODB_ATLAS_PROJECT_ID" )
150
+ providerName = "GCP"
151
+ gcpProjectID = os .Getenv ("GCP_PROJECT_ID" )
152
+ networkName = acc .RandomName ()
153
+ updatedNetworkName = acc .RandomName ()
154
+ )
155
+
156
+ resource .Test (t , resource.TestCase {
157
+ PreCheck : func () { acc .PreCheck (t ); acc .PreCheckPeeringEnvGCP (t ) },
158
+ ProtoV6ProviderFactories : acc .TestAccProviderV6Factories ,
159
+ CheckDestroy : acc .CheckDestroyNetworkPeering ,
160
+ Steps : []resource.TestStep {
161
+ {
162
+ Config : configGCP (projectID , providerName , gcpProjectID , networkName ),
163
+ Check : resource .ComposeTestCheckFunc (
164
+ checkExists (resourceName ),
165
+ resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
166
+ resource .TestCheckResourceAttrSet (resourceName , "container_id" ),
167
+ resource .TestCheckResourceAttrSet (resourceName , "network_name" ),
168
+
169
+ resource .TestCheckResourceAttr (resourceName , "provider_name" , providerName ),
170
+ resource .TestCheckResourceAttr (resourceName , "gcp_project_id" , gcpProjectID ),
171
+ resource .TestCheckResourceAttr (resourceName , "network_name" , networkName ),
172
+ ),
173
+ },
174
+ {
175
+ Config : configGCP (projectID , providerName , gcpProjectID , updatedNetworkName ),
176
+ Check : resource .ComposeTestCheckFunc (
177
+ checkExists (resourceName ),
178
+ resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
179
+ resource .TestCheckResourceAttrSet (resourceName , "container_id" ),
180
+ resource .TestCheckResourceAttrSet (resourceName , "network_name" ),
181
+
182
+ resource .TestCheckResourceAttr (resourceName , "provider_name" , providerName ),
183
+ resource .TestCheckResourceAttr (resourceName , "gcp_project_id" , gcpProjectID ),
184
+ resource .TestCheckResourceAttr (resourceName , "network_name" , updatedNetworkName ),
185
+ ),
186
+ },
187
+ },
188
+ })
189
+ }
190
+
145
191
func TestAccNetworkRSNetworkPeering_AWSDifferentRegionName (t * testing.T ) {
146
192
var (
147
193
vpcID = os .Getenv ("AWS_VPC_ID" )
0 commit comments