@@ -77,6 +77,50 @@ func TestAccContainerAwsCluster_BasicHandWritten(t *testing.T) {
77
77
},
78
78
})
79
79
}
80
+ func TestAccContainerAwsCluster_BasicEnumHandWritten (t * testing.T ) {
81
+ t .Parallel ()
82
+
83
+ context := map [string ]interface {}{
84
+ "aws_acct_id" : "111111111111" ,
85
+ "aws_db_key" : "00000000-0000-0000-0000-17aad2f0f61f" ,
86
+ "aws_region" : "us-west-2" ,
87
+ "aws_sg" : "sg-0b3f63cb91b247628" ,
88
+ "aws_subnet" : "subnet-0b3f63cb91b247628" ,
89
+ "aws_vol_key" : "00000000-0000-0000-0000-17aad2f0f61f" ,
90
+ "aws_vpc" : "vpc-0b3f63cb91b247628" ,
91
+ "byo_prefix" : "mmv2" ,
92
+ "project_name" : envvar .GetTestProjectFromEnv (),
93
+ "project_number" : envvar .GetTestProjectNumberFromEnv (),
94
+ "service_acct" : envvar .GetTestServiceAccountFromEnv (t ),
95
+ "random_suffix" : acctest .RandString (t , 10 ),
96
+ }
97
+
98
+ acctest .VcrTest (t , resource.TestCase {
99
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
100
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
101
+ CheckDestroy : testAccCheckContainerAwsClusterDestroyProducer (t ),
102
+ Steps : []resource.TestStep {
103
+ {
104
+ Config : testAccContainerAwsCluster_BasicEnumHandWritten (context ),
105
+ },
106
+ {
107
+ ResourceName : "google_container_aws_cluster.primary" ,
108
+ ImportState : true ,
109
+ ImportStateVerify : true ,
110
+ ImportStateVerifyIgnore : []string {"fleet.0.project" },
111
+ },
112
+ {
113
+ Config : testAccContainerAwsCluster_BasicEnumHandWrittenUpdate0 (context ),
114
+ },
115
+ {
116
+ ResourceName : "google_container_aws_cluster.primary" ,
117
+ ImportState : true ,
118
+ ImportStateVerify : true ,
119
+ ImportStateVerifyIgnore : []string {"fleet.0.project" },
120
+ },
121
+ },
122
+ })
123
+ }
80
124
81
125
func testAccContainerAwsCluster_BasicHandWritten (context map [string ]interface {}) string {
82
126
return acctest .Nprintf (`
@@ -255,6 +299,186 @@ resource "google_container_aws_cluster" "primary" {
255
299
}
256
300
257
301
302
+ ` , context )
303
+ }
304
+
305
+ func testAccContainerAwsCluster_BasicEnumHandWritten (context map [string ]interface {}) string {
306
+ return acctest .Nprintf (`
307
+ data "google_container_aws_versions" "versions" {
308
+ project = "%{project_name}"
309
+ location = "us-west1"
310
+ }
311
+
312
+ resource "google_container_aws_cluster" "primary" {
313
+ authorization {
314
+ admin_users {
315
+ username = "%{service_acct}"
316
+ }
317
+ }
318
+
319
+ aws_region = "%{aws_region}"
320
+
321
+ control_plane {
322
+ aws_services_authentication {
323
+ role_arn = "arn:aws:iam::%{aws_acct_id}:role/%{byo_prefix}-1p-dev-oneplatform"
324
+ role_session_name = "%{byo_prefix}-1p-dev-session"
325
+ }
326
+
327
+ config_encryption {
328
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_db_key}"
329
+ }
330
+
331
+ database_encryption {
332
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_db_key}"
333
+ }
334
+
335
+ iam_instance_profile = "%{byo_prefix}-1p-dev-controlplane"
336
+ subnet_ids = ["%{aws_subnet}"]
337
+ version = "${data.google_container_aws_versions.versions.valid_versions[0]}"
338
+ instance_type = "t3.medium"
339
+
340
+ main_volume {
341
+ iops = 3000
342
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_vol_key}"
343
+ size_gib = 10
344
+ volume_type = "gp3"
345
+ }
346
+
347
+ proxy_config {
348
+ secret_arn = "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF"
349
+ secret_version = "12345678-ABCD-EFGH-IJKL-987654321098"
350
+ }
351
+
352
+ root_volume {
353
+ iops = 3000
354
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_vol_key}"
355
+ size_gib = 10
356
+ volume_type = "gp3"
357
+ }
358
+
359
+ security_group_ids = ["%{aws_sg}"]
360
+
361
+ ssh_config {
362
+ ec2_key_pair = "%{byo_prefix}-1p-dev-ssh"
363
+ }
364
+
365
+ tags = {
366
+ owner = "%{service_acct}"
367
+ }
368
+ }
369
+
370
+ fleet {
371
+ project = "%{project_number}"
372
+ }
373
+
374
+ location = "us-west1"
375
+ name = "tf-test-name%{random_suffix}"
376
+
377
+ networking {
378
+ pod_address_cidr_blocks = ["10.2.0.0/16"]
379
+ service_address_cidr_blocks = ["10.1.0.0/16"]
380
+ vpc_id = "%{aws_vpc}"
381
+ }
382
+
383
+ annotations = {
384
+ label-one = "value-one"
385
+ }
386
+
387
+ description = "A sample aws cluster"
388
+ project = "%{project_name}"
389
+ }
390
+
391
+
392
+ ` , context )
393
+ }
394
+
395
+ func testAccContainerAwsCluster_BasicEnumHandWrittenUpdate0 (context map [string ]interface {}) string {
396
+ return acctest .Nprintf (`
397
+ data "google_container_aws_versions" "versions" {
398
+ project = "%{project_name}"
399
+ location = "us-west1"
400
+ }
401
+
402
+ resource "google_container_aws_cluster" "primary" {
403
+ authorization {
404
+ admin_users {
405
+ username = "%{service_acct}"
406
+ }
407
+ }
408
+
409
+ aws_region = "%{aws_region}"
410
+
411
+ control_plane {
412
+ aws_services_authentication {
413
+ role_arn = "arn:aws:iam::%{aws_acct_id}:role/%{byo_prefix}-1p-dev-oneplatform"
414
+ role_session_name = "%{byo_prefix}-1p-dev-session"
415
+ }
416
+
417
+ config_encryption {
418
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_db_key}"
419
+ }
420
+
421
+ database_encryption {
422
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_db_key}"
423
+ }
424
+
425
+ iam_instance_profile = "%{byo_prefix}-1p-dev-controlplane"
426
+ subnet_ids = ["%{aws_subnet}"]
427
+ version = "${data.google_container_aws_versions.versions.valid_versions[0]}"
428
+ instance_type = "t3.medium"
429
+
430
+ main_volume {
431
+ iops = 3000
432
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_vol_key}"
433
+ size_gib = 10
434
+ volume_type = "gp3"
435
+ }
436
+
437
+ proxy_config {
438
+ secret_arn = "arn:aws:secretsmanager:us-west-2:126285863215:secret:proxy_config20210824150329476300000001-ABCDEF"
439
+ secret_version = "12345678-ABCD-EFGH-IJKL-987654321098"
440
+ }
441
+
442
+ root_volume {
443
+ iops = 3000
444
+ kms_key_arn = "arn:aws:kms:%{aws_region}:%{aws_acct_id}:key/%{aws_vol_key}"
445
+ size_gib = 10
446
+ volume_type = "gp3"
447
+ }
448
+
449
+ security_group_ids = ["%{aws_sg}"]
450
+
451
+ ssh_config {
452
+ ec2_key_pair = "%{byo_prefix}-1p-dev-ssh"
453
+ }
454
+
455
+ tags = {
456
+ owner = "%{service_acct}"
457
+ }
458
+ }
459
+
460
+ fleet {
461
+ project = "%{project_number}"
462
+ }
463
+
464
+ location = "us-west1"
465
+ name = "tf-test-name%{random_suffix}"
466
+
467
+ networking {
468
+ pod_address_cidr_blocks = ["10.2.0.0/16"]
469
+ service_address_cidr_blocks = ["10.1.0.0/16"]
470
+ vpc_id = "%{aws_vpc}"
471
+ }
472
+
473
+ annotations = {
474
+ label-two = "value-two"
475
+ }
476
+
477
+ description = "An updated sample aws cluster"
478
+ project = "%{project_name}"
479
+ }
480
+
481
+
258
482
` , context )
259
483
}
260
484
0 commit comments