@@ -138,3 +138,73 @@ resource "google_bigquery_connection" "connection" {
138138}
139139` , context )
140140}
141+
142+ func TestAccBigqueryConnectionConnection_bigqueryConnectionAwsUpdate (t * testing.T ) {
143+ t .Parallel ()
144+
145+ context := map [string ]interface {}{
146+ "random_suffix" : randString (t , 10 ),
147+ }
148+
149+ vcrTest (t , resource.TestCase {
150+ PreCheck : func () { testAccPreCheck (t ) },
151+ Providers : testAccProviders ,
152+ ExternalProviders : map [string ]resource.ExternalProvider {
153+ "random" : {},
154+ "time" : {},
155+ },
156+ CheckDestroy : testAccCheckBigqueryConnectionConnectionDestroyProducer (t ),
157+ Steps : []resource.TestStep {
158+ {
159+ Config : testAccBigqueryConnectionConnection_bigqueryConnectionAws (context ),
160+ },
161+ {
162+ ResourceName : "google_bigquery_connection.connection" ,
163+ ImportState : true ,
164+ ImportStateVerify : true ,
165+ ImportStateVerifyIgnore : []string {"location" },
166+ },
167+ {
168+ Config : testAccBigqueryConnectionConnection_bigqueryConnectionAwsUpdate (context ),
169+ },
170+ {
171+ ResourceName : "google_bigquery_connection.connection" ,
172+ ImportState : true ,
173+ ImportStateVerify : true ,
174+ ImportStateVerifyIgnore : []string {"location" },
175+ },
176+ },
177+ })
178+ }
179+
180+ func testAccBigqueryConnectionConnection_bigqueryConnectionAws (context map [string ]interface {}) string {
181+ return Nprintf (`
182+ resource "google_bigquery_connection" "connection" {
183+ connection_id = "tf-test-my-connection%{random_suffix}"
184+ location = "aws-us-east-1"
185+ friendly_name = "👋"
186+ description = "a riveting description"
187+ aws {
188+ access_role {
189+ iam_role_id = "arn:aws:iam::999999999999:role/omnirole%{random_suffix}"
190+ }
191+ }
192+ }
193+ ` , context )
194+ }
195+
196+ func testAccBigqueryConnectionConnection_bigqueryConnectionAwsUpdate (context map [string ]interface {}) string {
197+ return Nprintf (`
198+ resource "google_bigquery_connection" "connection" {
199+ connection_id = "tf-test-my-connection%{random_suffix}"
200+ location = "aws-us-east-1"
201+ friendly_name = "👋"
202+ description = "a riveting description"
203+ aws {
204+ access_role {
205+ iam_role_id = "arn:aws:iam::999999999999:role/omnirole%{random_suffix}update"
206+ }
207+ }
208+ }
209+ ` , context )
210+ }
0 commit comments