Skip to content

Commit 8efa907

Browse files
author
AWS
committed
AWS AppSync Update: AWS AppSync now supports a new authorization mode allowing you to define your own authorization logic using an AWS Lambda function.
1 parent f682bd8 commit 8efa907

File tree

2 files changed

+75
-28
lines changed

2 files changed

+75
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS AppSync",
4+
"contributor": "",
5+
"description": "AWS AppSync now supports a new authorization mode allowing you to define your own authorization logic using an AWS Lambda function."
6+
}

services/appsync/src/main/resources/codegen-resources/service-2.json

+69-28
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@
716716
"members":{
717717
"authenticationType":{
718718
"shape":"AuthenticationType",
719-
"documentation":"<p>The authentication type: API key, AWS IAM, OIDC, or Amazon Cognito user pools.</p>"
719+
"documentation":"<p>The authentication type: API key, Identity and Access Management, OIDC, or Amazon Cognito user pools.</p>"
720720
},
721721
"openIDConnectConfig":{
722722
"shape":"OpenIDConnectConfig",
@@ -725,6 +725,10 @@
725725
"userPoolConfig":{
726726
"shape":"CognitoUserPoolConfig",
727727
"documentation":"<p>The Amazon Cognito user pool configuration.</p>"
728+
},
729+
"lambdaAuthorizerConfig":{
730+
"shape":"LambdaAuthorizerConfig",
731+
"documentation":"<p>Configuration for AWS Lambda function authorization.</p>"
728732
}
729733
},
730734
"documentation":"<p>Describes an additional authentication provider.</p>"
@@ -820,7 +824,7 @@
820824
"documentation":"<p>The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.</p>"
821825
}
822826
},
823-
"documentation":"<p>Describes an API key.</p> <p>Customers invoke AWS AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:</p> <p> <b>da1</b>: This version was introduced at launch in November 2017. These keys always expire after 7 days. Key expiration is managed by Amazon DynamoDB TTL. The keys ceased to be valid after February 21, 2018 and should not be used after that date.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>UpdateApiKey</code> is not available for this key version.</p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in Amazon DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we will delete these keys from the table after February 21, 2018.</p> </li> </ul> <p> <b>da2</b>: This version was introduced in February 2018 when AppSync added support to extend key expiration.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time and deletion time in seconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds.</p> </li> <li> <p> <code>UpdateApiKey</code> returns the expiration time and and deletion time in seconds and accepts a user-provided expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. Key expiration time can be updated while the key is not deleted. </p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in Amazon DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. But the key can be reinstated before deletion.</p> </li> <li> <p>Deletion is stored in Amazon DynamoDB as seconds. The key will be deleted after deletion time. </p> </li> </ul>"
827+
"documentation":"<p>Describes an API key.</p> <p>Customers invoke AppSync GraphQL API operations with API keys as an identity mechanism. There are two key versions:</p> <p> <b>da1</b>: This version was introduced at launch in November 2017. These keys always expire after 7 days. Key expiration is managed by Amazon DynamoDB TTL. The keys ceased to be valid after February 21, 2018 and should not be used after that date.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time in milliseconds.</p> </li> <li> <p> <code>UpdateApiKey</code> is not available for this key version.</p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in Amazon DynamoDB as milliseconds. This results in a bug where keys are not automatically deleted because DynamoDB expects the TTL to be stored in seconds. As a one-time action, we will delete these keys from the table after February 21, 2018.</p> </li> </ul> <p> <b>da2</b>: This version was introduced in February 2018 when AppSync added support to extend key expiration.</p> <ul> <li> <p> <code>ListApiKeys</code> returns the expiration time and deletion time in seconds.</p> </li> <li> <p> <code>CreateApiKey</code> returns the expiration time and deletion time in seconds and accepts a user-provided expiration time in seconds.</p> </li> <li> <p> <code>UpdateApiKey</code> returns the expiration time and and deletion time in seconds and accepts a user-provided expiration time in seconds. Expired API keys are kept for 60 days after the expiration time. Key expiration time can be updated while the key is not deleted. </p> </li> <li> <p> <code>DeleteApiKey</code> deletes the item from the table.</p> </li> <li> <p>Expiration is stored in Amazon DynamoDB as seconds. After the expiration time, using the key to authenticate will fail. But the key can be reinstated before deletion.</p> </li> <li> <p>Deletion is stored in Amazon DynamoDB as seconds. The key will be deleted after deletion time. </p> </li> </ul>"
824828
},
825829
"ApiKeyLimitExceededException":{
826830
"type":"structure",
@@ -859,7 +863,8 @@
859863
"API_KEY",
860864
"AWS_IAM",
861865
"AMAZON_COGNITO_USER_POOLS",
862-
"OPENID_CONNECT"
866+
"OPENID_CONNECT",
867+
"AWS_LAMBDA"
863868
]
864869
},
865870
"AuthorizationConfig":{
@@ -872,7 +877,7 @@
872877
},
873878
"awsIamConfig":{
874879
"shape":"AwsIamConfig",
875-
"documentation":"<p>The AWS IAM settings.</p>"
880+
"documentation":"<p>The Identity and Access Management settings.</p>"
876881
}
877882
},
878883
"documentation":"<p>The authorization config in case the HTTP endpoint requires authorization.</p>"
@@ -886,14 +891,14 @@
886891
"members":{
887892
"signingRegion":{
888893
"shape":"String",
889-
"documentation":"<p>The signing region for AWS IAM authorization.</p>"
894+
"documentation":"<p>The signing region for Identity and Access Management authorization.</p>"
890895
},
891896
"signingServiceName":{
892897
"shape":"String",
893-
"documentation":"<p>The signing service name for AWS IAM authorization.</p>"
898+
"documentation":"<p>The signing service name for Identity and Access Management authorization.</p>"
894899
}
895900
},
896-
"documentation":"<p>The AWS IAM configuration.</p>"
901+
"documentation":"<p>The Identity and Access Management configuration.</p>"
897902
},
898903
"BadRequestException":{
899904
"type":"structure",
@@ -938,7 +943,7 @@
938943
},
939944
"awsRegion":{
940945
"shape":"String",
941-
"documentation":"<p>The AWS Region in which the user pool was created.</p>"
946+
"documentation":"<p>The Amazon Web Services Region in which the user pool was created.</p>"
942947
},
943948
"appIdClientRegex":{
944949
"shape":"String",
@@ -1077,15 +1082,15 @@
10771082
},
10781083
"serviceRoleArn":{
10791084
"shape":"String",
1080-
"documentation":"<p>The AWS IAM service role ARN for the data source. The system assumes this role when accessing the data source.</p>"
1085+
"documentation":"<p>The Identity and Access Management service role ARN for the data source. The system assumes this role when accessing the data source.</p>"
10811086
},
10821087
"dynamodbConfig":{
10831088
"shape":"DynamodbDataSourceConfig",
10841089
"documentation":"<p>Amazon DynamoDB settings.</p>"
10851090
},
10861091
"lambdaConfig":{
10871092
"shape":"LambdaDataSourceConfig",
1088-
"documentation":"<p>AWS Lambda settings.</p>"
1093+
"documentation":"<p>Amazon Web Services Lambda settings.</p>"
10891094
},
10901095
"elasticsearchConfig":{
10911096
"shape":"ElasticsearchDataSourceConfig",
@@ -1178,7 +1183,7 @@
11781183
},
11791184
"authenticationType":{
11801185
"shape":"AuthenticationType",
1181-
"documentation":"<p>The authentication type: API key, AWS IAM, OIDC, or Amazon Cognito user pools.</p>"
1186+
"documentation":"<p>The authentication type: API key, Identity and Access Management, OIDC, or Amazon Cognito user pools.</p>"
11821187
},
11831188
"userPoolConfig":{
11841189
"shape":"UserPoolConfig",
@@ -1199,6 +1204,10 @@
11991204
"xrayEnabled":{
12001205
"shape":"Boolean",
12011206
"documentation":"<p>A flag indicating whether to enable X-Ray tracing for the <code>GraphqlApi</code>.</p>"
1207+
},
1208+
"lambdaAuthorizerConfig":{
1209+
"shape":"LambdaAuthorizerConfig",
1210+
"documentation":"<p>Configuration for AWS Lambda function authorization.</p>"
12021211
}
12031212
}
12041213
},
@@ -1324,19 +1333,19 @@
13241333
},
13251334
"type":{
13261335
"shape":"DataSourceType",
1327-
"documentation":"<p>The type of the data source.</p> <ul> <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li> <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon Elasticsearch Service domain.</p> </li> <li> <p> <b>AWS_LAMBDA</b>: The data source is an AWS Lambda function.</p> </li> <li> <p> <b>NONE</b>: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.</p> </li> <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li> <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li> </ul>"
1336+
"documentation":"<p>The type of the data source.</p> <ul> <li> <p> <b>AMAZON_DYNAMODB</b>: The data source is an Amazon DynamoDB table.</p> </li> <li> <p> <b>AMAZON_ELASTICSEARCH</b>: The data source is an Amazon Elasticsearch Service domain.</p> </li> <li> <p> <b>AWS_LAMBDA</b>: The data source is an Amazon Web Services Lambda function.</p> </li> <li> <p> <b>NONE</b>: There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.</p> </li> <li> <p> <b>HTTP</b>: The data source is an HTTP endpoint.</p> </li> <li> <p> <b>RELATIONAL_DATABASE</b>: The data source is a relational database.</p> </li> </ul>"
13281337
},
13291338
"serviceRoleArn":{
13301339
"shape":"String",
1331-
"documentation":"<p>The AWS IAM service role ARN for the data source. The system assumes this role when accessing the data source.</p>"
1340+
"documentation":"<p>The Identity and Access Management service role ARN for the data source. The system assumes this role when accessing the data source.</p>"
13321341
},
13331342
"dynamodbConfig":{
13341343
"shape":"DynamodbDataSourceConfig",
13351344
"documentation":"<p>Amazon DynamoDB settings.</p>"
13361345
},
13371346
"lambdaConfig":{
13381347
"shape":"LambdaDataSourceConfig",
1339-
"documentation":"<p>AWS Lambda settings.</p>"
1348+
"documentation":"<p>Amazon Web Services Lambda settings.</p>"
13401349
},
13411350
"elasticsearchConfig":{
13421351
"shape":"ElasticsearchDataSourceConfig",
@@ -1579,7 +1588,7 @@
15791588
},
15801589
"awsRegion":{
15811590
"shape":"String",
1582-
"documentation":"<p>The AWS Region.</p>"
1591+
"documentation":"<p>The Amazon Web Services Region.</p>"
15831592
},
15841593
"useCallerCredentials":{
15851594
"shape":"Boolean",
@@ -1609,7 +1618,7 @@
16091618
},
16101619
"awsRegion":{
16111620
"shape":"String",
1612-
"documentation":"<p>The AWS Region.</p>"
1621+
"documentation":"<p>The Amazon Web Services Region.</p>"
16131622
}
16141623
},
16151624
"documentation":"<p>Describes an Elasticsearch data source configuration.</p>"
@@ -1987,7 +1996,11 @@
19871996
},
19881997
"wafWebAclArn":{
19891998
"shape":"String",
1990-
"documentation":"<p>The ARN of the AWS Web Application Firewall (WAF) ACL associated with this <code>GraphqlApi</code>, if one exists.</p>"
1999+
"documentation":"<p>The ARN of the WAF ACL associated with this <code>GraphqlApi</code>, if one exists.</p>"
2000+
},
2001+
"lambdaAuthorizerConfig":{
2002+
"shape":"LambdaAuthorizerConfig",
2003+
"documentation":"<p/> <p>Configuration for AWS Lambda function authorization.</p>"
19912004
}
19922005
},
19932006
"documentation":"<p>Describes a GraphQL API.</p>"
@@ -2001,7 +2014,7 @@
20012014
"members":{
20022015
"endpoint":{
20032016
"shape":"String",
2004-
"documentation":"<p>The HTTP URL endpoint. You can either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AWS AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>"
2017+
"documentation":"<p>The HTTP URL endpoint. You can either specify the domain name or IP, and port combination, and the URL scheme must be HTTP or HTTPS. If the port is not specified, AppSync uses the default port 80 for the HTTP endpoint and port 443 for HTTPS endpoints.</p>"
20052018
},
20062019
"authorizationConfig":{
20072020
"shape":"AuthorizationConfig",
@@ -2015,11 +2028,30 @@
20152028
"members":{
20162029
"message":{"shape":"String"}
20172030
},
2018-
"documentation":"<p>An internal AWS AppSync error occurred. Try your request again.</p>",
2031+
"documentation":"<p>An internal AppSync error occurred. Try your request again.</p>",
20192032
"error":{"httpStatusCode":500},
20202033
"exception":true,
20212034
"fault":true
20222035
},
2036+
"LambdaAuthorizerConfig":{
2037+
"type":"structure",
2038+
"required":["authorizerUri"],
2039+
"members":{
2040+
"authorizerResultTtlInSeconds":{
2041+
"shape":"TTL",
2042+
"documentation":"<p>The number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a <code>ttlOverride</code> key in its response. A value of 0 disables caching of responses.</p>"
2043+
},
2044+
"authorizerUri":{
2045+
"shape":"String",
2046+
"documentation":"<p>The ARN of the lambda function to be called for authorization. This may be a standard Lambda ARN, a version ARN (<code>.../v3</code>) or alias ARN. </p> <p> <i>Note</i>: This Lambda function must have the following resource-based policy assigned to it. When configuring Lambda authorizers in the Console, this is done for you. To do so with the AWS CLI, run the following:</p> <p> <code>aws lambda add-permission --function-name \"arn:aws:lambda:us-east-2:111122223333:function:my-function\" --statement-id \"appsync\" --principal appsync.amazonaws.com --action lambda:InvokeFunction</code> </p>"
2047+
},
2048+
"identityValidationExpression":{
2049+
"shape":"String",
2050+
"documentation":"<p>A regular expression for validation of tokens before the Lambda Function is called.</p>"
2051+
}
2052+
},
2053+
"documentation":"<p>A <code>LambdaAuthorizerConfig</code> holds configuration on how to authorize AppSync API access when using the <code>AWS_LAMBDA</code> authorizer mode. Be aware that an AppSync API may have only one Lambda authorizer configured at a time.</p>"
2054+
},
20232055
"LambdaConflictHandlerConfig":{
20242056
"type":"structure",
20252057
"members":{
@@ -2039,7 +2071,7 @@
20392071
"documentation":"<p>The ARN for the Lambda function.</p>"
20402072
}
20412073
},
2042-
"documentation":"<p>Describes an AWS Lambda data source configuration.</p>"
2074+
"documentation":"<p>Describes an Amazon Web Services Lambda data source configuration.</p>"
20432075
},
20442076
"LimitExceededException":{
20452077
"type":"structure",
@@ -2363,7 +2395,7 @@
23632395
},
23642396
"cloudWatchLogsRoleArn":{
23652397
"shape":"String",
2366-
"documentation":"<p>The service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account. </p>"
2398+
"documentation":"<p>The service role that AppSync will assume to publish to Amazon CloudWatch logs in your account. </p>"
23672399
},
23682400
"excludeVerboseContent":{
23692401
"shape":"Boolean",
@@ -2407,7 +2439,7 @@
24072439
},
24082440
"clientId":{
24092441
"shape":"String",
2410-
"documentation":"<p>The client identifier of the Relying party at the OpenID identity provider. This identifier is typically obtained when the Relying party is registered with the OpenID identity provider. You can specify a regular expression so the AWS AppSync can validate against multiple client identifiers at a time.</p>"
2442+
"documentation":"<p>The client identifier of the Relying party at the OpenID identity provider. This identifier is typically obtained when the Relying party is registered with the OpenID identity provider. You can specify a regular expression so the AppSync can validate against multiple client identifiers at a time.</p>"
24112443
},
24122444
"iatTTL":{
24132445
"shape":"Long",
@@ -2448,7 +2480,7 @@
24482480
"members":{
24492481
"awsRegion":{
24502482
"shape":"String",
2451-
"documentation":"<p>AWS Region for RDS HTTP endpoint.</p>"
2483+
"documentation":"<p>Amazon Web Services Region for RDS HTTP endpoint.</p>"
24522484
},
24532485
"dbClusterIdentifier":{
24542486
"shape":"String",
@@ -2464,7 +2496,7 @@
24642496
},
24652497
"awsSecretStoreArn":{
24662498
"shape":"String",
2467-
"documentation":"<p>AWS secret store ARN for database credentials.</p>"
2499+
"documentation":"<p>Amazon Web Services secret store ARN for database credentials.</p>"
24682500
}
24692501
},
24702502
"documentation":"<p>The Amazon RDS HTTP endpoint configuration.</p>"
@@ -2614,12 +2646,17 @@
26142646
},
26152647
"documentation":"<p>Describes a Sync configuration for a resolver.</p> <p>Contains information on which Conflict Detection as well as Resolution strategy should be performed when the resolver is invoked.</p>"
26162648
},
2649+
"TTL":{
2650+
"type":"integer",
2651+
"max":3600,
2652+
"min":0
2653+
},
26172654
"TagKey":{
26182655
"type":"string",
26192656
"documentation":"<p>The key for the tag.</p>",
26202657
"max":128,
26212658
"min":1,
2622-
"pattern":"^(?!aws:)[a-zA-Z+-=._:/]+$"
2659+
"pattern":"^(?!aws:)[ a-zA-Z+-=._:/]+$"
26232660
},
26242661
"TagKeyList":{
26252662
"type":"list",
@@ -2852,7 +2889,7 @@
28522889
},
28532890
"lambdaConfig":{
28542891
"shape":"LambdaDataSourceConfig",
2855-
"documentation":"<p>The new AWS Lambda configuration.</p>"
2892+
"documentation":"<p>The new Amazon Web Services Lambda configuration.</p>"
28562893
},
28572894
"elasticsearchConfig":{
28582895
"shape":"ElasticsearchDataSourceConfig",
@@ -2975,6 +3012,10 @@
29753012
"xrayEnabled":{
29763013
"shape":"Boolean",
29773014
"documentation":"<p>A flag indicating whether to enable X-Ray tracing for the <code>GraphqlApi</code>.</p>"
3015+
},
3016+
"lambdaAuthorizerConfig":{
3017+
"shape":"LambdaAuthorizerConfig",
3018+
"documentation":"<p>Configuration for AWS Lambda function authorization.</p>"
29783019
}
29793020
}
29803021
},
@@ -3105,7 +3146,7 @@
31053146
},
31063147
"awsRegion":{
31073148
"shape":"String",
3108-
"documentation":"<p>The AWS Region in which the user pool was created.</p>"
3149+
"documentation":"<p>The Amazon Web Services Region in which the user pool was created.</p>"
31093150
},
31103151
"defaultAction":{
31113152
"shape":"DefaultAction",
@@ -3119,5 +3160,5 @@
31193160
"documentation":"<p>Describes an Amazon Cognito user pool configuration.</p>"
31203161
}
31213162
},
3122-
"documentation":"<p>AWS AppSync provides API actions for creating and interacting with data sources using GraphQL from your application.</p>"
3163+
"documentation":"<p>AppSync provides API actions for creating and interacting with data sources using GraphQL from your application.</p>"
31233164
}

0 commit comments

Comments
 (0)