Skip to content

Commit a292302

Browse files
authored
Merge pull request #44333 from hashicorp/b-appsync-graphql-tags-tests
AppSync tests
2 parents 8ccc059 + 04a8514 commit a292302

File tree

9 files changed

+98
-237
lines changed

9 files changed

+98
-237
lines changed

internal/service/appsync/appsync_test.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,60 +18,6 @@ func TestAccAppSync_serial(t *testing.T) {
1818
"description": testAccAPIKey_description,
1919
"expires": testAccAPIKey_expires,
2020
},
21-
"DataSource": {
22-
acctest.CtBasic: testAccDataSource_basic,
23-
"description": testAccDataSource_description,
24-
"DynamoDB_region": testAccDataSource_DynamoDB_region,
25-
"DynamoDB_useCallerCredentials": testAccDataSource_DynamoDB_useCallerCredentials,
26-
"HTTP_endpoint": testAccDataSource_HTTP_endpoint,
27-
"type": testAccDataSource_type,
28-
"Type_dynamoDB": testAccDataSource_Type_dynamoDB,
29-
"Type_http": testAccDataSource_Type_http,
30-
"Type_http_auth": testAccDataSource_Type_httpAuth,
31-
"Type_lambda": testAccDataSource_Type_lambda,
32-
"Type_none": testAccDataSource_Type_none,
33-
"Type_rdbms": testAccDataSource_Type_relationalDatabase,
34-
"Type_rdbms_options": testAccDataSource_Type_relationalDatabaseWithOptions,
35-
"Type_eventBridge": testAccDataSource_Type_eventBridge,
36-
},
37-
"GraphQLAPI": {
38-
acctest.CtBasic: testAccGraphQLAPI_basic,
39-
acctest.CtDisappears: testAccGraphQLAPI_disappears,
40-
"tags": testAccGraphQLAPI_tags,
41-
"schema": testAccGraphQLAPI_schema,
42-
"apiType": testAccGraphQLAPI_apiType,
43-
"authenticationType": testAccGraphQLAPI_authenticationType,
44-
"AuthenticationType_apiKey": testAccGraphQLAPI_AuthenticationType_apiKey,
45-
"AuthenticationType_awsIAM": testAccGraphQLAPI_AuthenticationType_iam,
46-
"AuthenticationType_amazonCognitoUserPools": testAccGraphQLAPI_AuthenticationType_amazonCognitoUserPools,
47-
"AuthenticationType_openIDConnect": testAccGraphQLAPI_AuthenticationType_openIDConnect,
48-
"AuthenticationType_awsLambda": testAccGraphQLAPI_AuthenticationType_lambda,
49-
"enhancedMetricsConfig": testAccGraphQLAPI_enhancedMetricsConfig,
50-
"log": testAccGraphQLAPI_log,
51-
"Log_fieldLogLevel": testAccGraphQLAPI_Log_fieldLogLevel,
52-
"Log_excludeVerboseContent": testAccGraphQLAPI_Log_excludeVerboseContent,
53-
"OpenIDConnect_authTTL": testAccGraphQLAPI_OpenIDConnect_authTTL,
54-
"OpenIDConnect_clientID": testAccGraphQLAPI_OpenIDConnect_clientID,
55-
"OpenIDConnect_iatTTL": testAccGraphQLAPI_OpenIDConnect_iatTTL,
56-
"OpenIDConnect_issuer": testAccGraphQLAPI_OpenIDConnect_issuer,
57-
acctest.CtName: testAccGraphQLAPI_name,
58-
"UserPool_awsRegion": testAccGraphQLAPI_UserPool_region,
59-
"UserPool_defaultAction": testAccGraphQLAPI_UserPool_defaultAction,
60-
"LambdaAuthorizerConfig_authorizerUri": testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerURI,
61-
"LambdaAuthorizerConfig_identityValidationExpression": testAccGraphQLAPI_LambdaAuthorizerConfig_identityValidationExpression,
62-
"LambdaAuthorizerConfig_authorizerResultTtlInSeconds": testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerResultTTLInSeconds,
63-
"AdditionalAuthentication_apiKey": testAccGraphQLAPI_AdditionalAuthentication_apiKey,
64-
"AdditionalAuthentication_awsIAM": testAccGraphQLAPI_AdditionalAuthentication_iam,
65-
"AdditionalAuthentication_cognitoUserPools": testAccGraphQLAPI_AdditionalAuthentication_cognitoUserPools,
66-
"AdditionalAuthentication_openIDConnect": testAccGraphQLAPI_AdditionalAuthentication_openIDConnect,
67-
"AdditionalAuthentication_awsLambda": testAccGraphQLAPI_AdditionalAuthentication_lambda,
68-
"AdditionalAuthentication_multiple": testAccGraphQLAPI_AdditionalAuthentication_multiple,
69-
"xrayEnabled": testAccGraphQLAPI_xrayEnabled,
70-
"visibility": testAccGraphQLAPI_visibility,
71-
"introspectionConfig": testAccGraphQLAPI_introspectionConfig,
72-
"queryDepthLimit": testAccGraphQLAPI_queryDepthLimit,
73-
"resolverCountLimit": testAccGraphQLAPI_resolverCountLimit,
74-
},
7521
"Function": {
7622
acctest.CtBasic: testAccFunction_basic,
7723
"code": testAccFunction_code,

internal/service/appsync/datasource_test.go

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import (
2020
"github.com/hashicorp/terraform-provider-aws/names"
2121
)
2222

23-
func testAccDataSource_basic(t *testing.T) {
23+
func TestAccAppSyncDataSource_basic(t *testing.T) {
2424
ctx := acctest.Context(t)
2525
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
2626
resourceName := "aws_appsync_datasource.test"
2727

28-
resource.Test(t, resource.TestCase{
28+
acctest.ParallelTest(ctx, t, resource.TestCase{
2929
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
3030
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
3131
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -57,12 +57,12 @@ func testAccDataSource_basic(t *testing.T) {
5757
})
5858
}
5959

60-
func testAccDataSource_description(t *testing.T) {
60+
func TestAccAppSyncDataSource_description(t *testing.T) {
6161
ctx := acctest.Context(t)
6262
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
6363
resourceName := "aws_appsync_datasource.test"
6464

65-
resource.Test(t, resource.TestCase{
65+
acctest.ParallelTest(ctx, t, resource.TestCase{
6666
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
6767
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
6868
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -91,12 +91,12 @@ func testAccDataSource_description(t *testing.T) {
9191
})
9292
}
9393

94-
func testAccDataSource_DynamoDB_region(t *testing.T) {
94+
func TestAccAppSyncDataSource_DynamoDB_region(t *testing.T) {
9595
ctx := acctest.Context(t)
9696
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
9797
resourceName := "aws_appsync_datasource.test"
9898

99-
resource.Test(t, resource.TestCase{
99+
acctest.ParallelTest(ctx, t, resource.TestCase{
100100
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
101101
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
102102
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -127,12 +127,12 @@ func testAccDataSource_DynamoDB_region(t *testing.T) {
127127
})
128128
}
129129

130-
func testAccDataSource_DynamoDB_useCallerCredentials(t *testing.T) {
130+
func TestAccAppSyncDataSource_DynamoDB_useCallerCredentials(t *testing.T) {
131131
ctx := acctest.Context(t)
132132
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
133133
resourceName := "aws_appsync_datasource.test"
134134

135-
resource.Test(t, resource.TestCase{
135+
acctest.ParallelTest(ctx, t, resource.TestCase{
136136
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
137137
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
138138
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -237,12 +237,12 @@ func TestAccAppSyncDataSource_OpenSearchService_region(t *testing.T) {
237237
})
238238
}
239239

240-
func testAccDataSource_HTTP_endpoint(t *testing.T) {
240+
func TestAccAppSyncDataSource_HTTP_endpoint(t *testing.T) {
241241
ctx := acctest.Context(t)
242242
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
243243
resourceName := "aws_appsync_datasource.test"
244244

245-
resource.Test(t, resource.TestCase{
245+
acctest.ParallelTest(ctx, t, resource.TestCase{
246246
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
247247
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
248248
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -275,12 +275,12 @@ func testAccDataSource_HTTP_endpoint(t *testing.T) {
275275
})
276276
}
277277

278-
func testAccDataSource_type(t *testing.T) {
278+
func TestAccAppSyncDataSource_type(t *testing.T) {
279279
ctx := acctest.Context(t)
280280
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
281281
resourceName := "aws_appsync_datasource.test"
282282

283-
resource.Test(t, resource.TestCase{
283+
acctest.ParallelTest(ctx, t, resource.TestCase{
284284
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
285285
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
286286
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -304,14 +304,14 @@ func testAccDataSource_type(t *testing.T) {
304304
})
305305
}
306306

307-
func testAccDataSource_Type_dynamoDB(t *testing.T) {
307+
func TestAccAppSyncDataSource_Type_dynamoDB(t *testing.T) {
308308
ctx := acctest.Context(t)
309309
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
310310
dynamodbTableResourceName := "aws_dynamodb_table.test"
311311
iamRoleResourceName := "aws_iam_role.test"
312312
resourceName := "aws_appsync_datasource.test"
313313

314-
resource.Test(t, resource.TestCase{
314+
acctest.ParallelTest(ctx, t, resource.TestCase{
315315
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
316316
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
317317
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -403,12 +403,12 @@ func TestAccAppSyncDataSource_Type_openSearchService(t *testing.T) {
403403
})
404404
}
405405

406-
func testAccDataSource_Type_http(t *testing.T) {
406+
func TestAccAppSyncDataSource_Type_http(t *testing.T) {
407407
ctx := acctest.Context(t)
408408
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
409409
resourceName := "aws_appsync_datasource.test"
410410

411-
resource.Test(t, resource.TestCase{
411+
acctest.ParallelTest(ctx, t, resource.TestCase{
412412
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
413413
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
414414
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -432,12 +432,12 @@ func testAccDataSource_Type_http(t *testing.T) {
432432
})
433433
}
434434

435-
func testAccDataSource_Type_httpAuth(t *testing.T) {
435+
func TestAccAppSyncDataSource_Type_httpAuth(t *testing.T) {
436436
ctx := acctest.Context(t)
437437
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
438438
resourceName := "aws_appsync_datasource.test"
439439

440-
resource.Test(t, resource.TestCase{
440+
acctest.ParallelTest(ctx, t, resource.TestCase{
441441
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
442442
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
443443
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -466,12 +466,12 @@ func testAccDataSource_Type_httpAuth(t *testing.T) {
466466
})
467467
}
468468

469-
func testAccDataSource_Type_relationalDatabase(t *testing.T) {
469+
func TestAccAppSyncDataSource_Type_relationalDatabase(t *testing.T) {
470470
ctx := acctest.Context(t)
471471
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
472472
resourceName := "aws_appsync_datasource.test"
473473

474-
resource.Test(t, resource.TestCase{
474+
acctest.ParallelTest(ctx, t, resource.TestCase{
475475
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
476476
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
477477
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -495,12 +495,12 @@ func testAccDataSource_Type_relationalDatabase(t *testing.T) {
495495
})
496496
}
497497

498-
func testAccDataSource_Type_relationalDatabaseWithOptions(t *testing.T) {
498+
func TestAccAppSyncDataSource_Type_relationalDatabaseWithOptions(t *testing.T) {
499499
ctx := acctest.Context(t)
500500
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
501501
resourceName := "aws_appsync_datasource.test"
502502

503-
resource.Test(t, resource.TestCase{
503+
acctest.ParallelTest(ctx, t, resource.TestCase{
504504
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
505505
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
506506
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -526,14 +526,14 @@ func testAccDataSource_Type_relationalDatabaseWithOptions(t *testing.T) {
526526
})
527527
}
528528

529-
func testAccDataSource_Type_lambda(t *testing.T) {
529+
func TestAccAppSyncDataSource_Type_lambda(t *testing.T) {
530530
ctx := acctest.Context(t)
531531
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
532532
iamRoleResourceName := "aws_iam_role.test"
533533
lambdaFunctionResourceName := "aws_lambda_function.test"
534534
resourceName := "aws_appsync_datasource.test"
535535

536-
resource.Test(t, resource.TestCase{
536+
acctest.ParallelTest(ctx, t, resource.TestCase{
537537
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
538538
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
539539
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -558,14 +558,14 @@ func testAccDataSource_Type_lambda(t *testing.T) {
558558
})
559559
}
560560

561-
func testAccDataSource_Type_eventBridge(t *testing.T) {
561+
func TestAccAppSyncDataSource_Type_eventBridge(t *testing.T) {
562562
ctx := acctest.Context(t)
563563
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
564564
iamRoleResourceName := "aws_iam_role.test"
565565
eventBusResourceName := "aws_cloudwatch_event_bus.test"
566566
resourceName := "aws_appsync_datasource.test"
567567

568-
resource.Test(t, resource.TestCase{
568+
acctest.ParallelTest(ctx, t, resource.TestCase{
569569
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
570570
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
571571
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -590,12 +590,12 @@ func testAccDataSource_Type_eventBridge(t *testing.T) {
590590
})
591591
}
592592

593-
func testAccDataSource_Type_none(t *testing.T) {
593+
func TestAccAppSyncDataSource_Type_none(t *testing.T) {
594594
ctx := acctest.Context(t)
595595
rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt())
596596
resourceName := "aws_appsync_datasource.test"
597597

598-
resource.Test(t, resource.TestCase{
598+
acctest.ParallelTest(ctx, t, resource.TestCase{
599599
PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(t, names.AppSyncEndpointID) },
600600
ErrorCheck: acctest.ErrorCheck(t, names.AppSyncServiceID),
601601
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
@@ -1223,16 +1223,10 @@ resource "aws_secretsmanager_secret_version" "test" {
12231223
resource "aws_rds_cluster" "test" {
12241224
cluster_identifier = %[1]q
12251225
engine = %[2]q
1226-
engine_mode = "serverless"
12271226
database_name = "mydb"
12281227
master_username = "foo"
12291228
master_password = "mustbeeightcharaters"
12301229
skip_final_snapshot = true
1231-
1232-
scaling_configuration {
1233-
min_capacity = 1
1234-
max_capacity = 2
1235-
}
12361230
}
12371231
12381232
resource "aws_iam_role" "test" {

0 commit comments

Comments
 (0)