Skip to content

Commit

Permalink
tests/resource/aws_appsync_graphql_api: Changes from hashicorp#20000
Browse files Browse the repository at this point in the history
  • Loading branch information
Pharb committed Nov 23, 2021
1 parent 61d1b32 commit 3bbd9a0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 54 deletions.
5 changes: 5 additions & 0 deletions internal/service/appsync/appsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestAccAppSync_serial(t *testing.T) {
"AuthenticationType_awsIAM": testAccAppSyncGraphQLAPI_AuthenticationType_awsIAM,
"AuthenticationType_amazonCognitoUserPools": testAccAppSyncGraphQLAPI_AuthenticationType_amazonCognitoUserPools,
"AuthenticationType_openIDConnect": testAccAppSyncGraphQLAPI_AuthenticationType_openIDConnect,
"AuthenticationType_awsLambda": testAccAppSyncGraphQLAPI_AuthenticationType_awsLambda,
"log": testAccAppSyncGraphQLAPI_log,
"Log_fieldLogLevel": testAccAppSyncGraphQLAPI_Log_fieldLogLevel,
"Log_excludeVerboseContent": testAccAppSyncGraphQLAPI_Log_excludeVerboseContent,
Expand All @@ -42,11 +43,15 @@ func TestAccAppSync_serial(t *testing.T) {
"name": testAccAppSyncGraphQLAPI_name,
"UserPool_awsRegion": testAccAppSyncGraphQLAPI_UserPool_awsRegion,
"UserPool_defaultAction": testAccAppSyncGraphQLAPI_UserPool_defaultAction,
"LambdaAuthorizerConfig_authorizerUri": testAccAppSyncGraphQLAPI_LambdaAuthorizerConfig_authorizerUri,
"LambdaAuthorizerConfig_identityValidationExpression": testAccAppSyncGraphQLAPI_LambdaAuthorizerConfig_identityValidationExpression,
"LambdaAuthorizerConfig_authorizerResultTtlInSeconds": testAccAppSyncGraphQLAPI_LambdaAuthorizerConfig_authorizerResultTtlInSeconds,
"tags": testAccAppSyncGraphQLAPI_tags,
"AdditionalAuthentication_apiKey": testAccAppSyncGraphQLAPI_AdditionalAuthentication_apiKey,
"AdditionalAuthentication_awsIAM": testAccAppSyncGraphQLAPI_AdditionalAuthentication_awsIAM,
"AdditionalAuthentication_cognitoUserPools": testAccAppSyncGraphQLAPI_AdditionalAuthentication_cognitoUserPools,
"AdditionalAuthentication_openIDConnect": testAccAppSyncGraphQLAPI_AdditionalAuthentication_openIDConnect,
"AdditionalAuthentication_awsLambda": testAccAppSyncGraphQLAPI_AdditionalAuthentication_awsLambda,
"AdditionalAuthentication_multiple": testAccAppSyncGraphQLAPI_AdditionalAuthentication_multiple,
"xrayEnabled": testAccAppSyncGraphQLAPI_xrayEnabled,
},
Expand Down
8 changes: 4 additions & 4 deletions internal/service/appsync/graphql_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

var validateAuthorizerResultTtlInSeconds = validation.IntBetween(0, 3600)

const defaultAuthorizerResultTtlInSeconds = 300
const DefaultAuthorizerResultTtlInSeconds = 300

func ResourceGraphQLAPI() *schema.Resource {
return &schema.Resource{
Expand Down Expand Up @@ -98,7 +98,7 @@ func ResourceGraphQLAPI() *schema.Resource {
"authorizer_result_ttl_in_seconds": {
Type: schema.TypeInt,
Optional: true,
Default: defaultAuthorizerResultTtlInSeconds,
Default: DefaultAuthorizerResultTtlInSeconds,
ValidateFunc: validateAuthorizerResultTtlInSeconds,
},
"authorizer_uri": {
Expand Down Expand Up @@ -226,7 +226,7 @@ func ResourceGraphQLAPI() *schema.Resource {
"authorizer_result_ttl_in_seconds": {
Type: schema.TypeInt,
Optional: true,
Default: defaultAuthorizerResultTtlInSeconds,
Default: DefaultAuthorizerResultTtlInSeconds,
ValidateFunc: validateAuthorizerResultTtlInSeconds,
},
"authorizer_uri": {
Expand Down Expand Up @@ -655,7 +655,7 @@ func flattenAppsyncGraphqlApiLambdaAuthorizerConfig(lambdaAuthorizerConfig *apps
if lambdaAuthorizerConfig.AuthorizerResultTtlInSeconds != nil {
m["authorizer_result_ttl_in_seconds"] = aws.Int64Value(lambdaAuthorizerConfig.AuthorizerResultTtlInSeconds)
} else {
m["authorizer_result_ttl_in_seconds"] = defaultAuthorizerResultTtlInSeconds
m["authorizer_result_ttl_in_seconds"] = DefaultAuthorizerResultTtlInSeconds
}

if lambdaAuthorizerConfig.IdentityValidationExpression != nil {
Expand Down
Loading

0 comments on commit 3bbd9a0

Please sign in to comment.