2024/10/30 - AWS AppSync - 10 new api methods
Changes This release adds support for AppSync Event APIs.
Updates an Api.
See also: AWS API Documentation
Request Syntax
client.update_api( apiId='string', name='string', ownerContact='string', eventConfig={ 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } )
string
[REQUIRED]
The Api ID.
string
[REQUIRED]
The name of the Api.
string
The owner contact information for the Api.
dict
The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) -- [REQUIRED]
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) -- [REQUIRED]
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
defaultPublishAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
defaultSubscribeAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) -- [REQUIRED]
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) -- [REQUIRED]
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
dict
Response Syntax
{ 'api': { 'apiId': 'string', 'name': 'string', 'ownerContact': 'string', 'tags': { 'string': 'string' }, 'dns': { 'string': 'string' }, 'apiArn': 'string', 'created': datetime(2015, 1, 1), 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'eventConfig': { 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } } }
Response Structure
(dict) --
api (dict) --
The Api object.
apiId (string) --
The Api ID.
name (string) --
The name of the Api.
ownerContact (string) --
The owner contact information for the Api
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dns (dict) --
The DNS records for the API. This will include an HTTP and a real-time endpoint.
(string) --
(string) --
apiArn (string) --
The Amazon Resource Name (ARN) for the Api.
created (datetime) --
The date and time that the Api was created.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this Api.
wafWebAclArn (string) --
The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists.
eventConfig (dict) --
The Event API configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) --
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) --
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) --
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultPublishAuthModes (list) --
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultSubscribeAuthModes (list) --
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) --
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) --
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
Lists the channel namespaces for a specified Api.
ListChannelNamespaces returns only high level details for the channel namespace. To retrieve code handlers, use GetChannelNamespace.
See also: AWS API Documentation
Request Syntax
client.list_channel_namespaces( apiId='string', nextToken='string', maxResults=123 )
string
[REQUIRED]
The Api ID.
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
dict
Response Syntax
{ 'channelNamespaces': [ { 'apiId': 'string', 'name': 'string', 'subscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'publishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'codeHandlers': 'string', 'tags': { 'string': 'string' }, 'channelNamespaceArn': 'string', 'created': datetime(2015, 1, 1), 'lastModified': datetime(2015, 1, 1) }, ], 'nextToken': 'string' }
Response Structure
(dict) --
channelNamespaces (list) --
The ChannelNamespace objects.
(dict) --
Describes a channel namespace associated with an Api. The ChannelNamespace contains the definitions for code handlers for the Api.
apiId (string) --
The Api ID.
name (string) --
The name of the channel namespace. This name must be unique within the Api.
subscribeAuthModes (list) --
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
publishAuthModes (list) --
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
codeHandlers (string) --
The event handler functions that run custom business logic to process published events and subscribe requests.
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
channelNamespaceArn (string) --
The Amazon Resource Name (ARN) for the ChannelNamespace.
created (datetime) --
The date and time that the ChannelNamespace was created.
lastModified (datetime) --
The date and time that the ChannelNamespace was last changed.
nextToken (string) --
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
Retrieves an Api object.
See also: AWS API Documentation
Request Syntax
client.get_api( apiId='string' )
string
[REQUIRED]
The Api ID.
dict
Response Syntax
{ 'api': { 'apiId': 'string', 'name': 'string', 'ownerContact': 'string', 'tags': { 'string': 'string' }, 'dns': { 'string': 'string' }, 'apiArn': 'string', 'created': datetime(2015, 1, 1), 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'eventConfig': { 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } } }
Response Structure
(dict) --
api (dict) --
The Api object.
apiId (string) --
The Api ID.
name (string) --
The name of the Api.
ownerContact (string) --
The owner contact information for the Api
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dns (dict) --
The DNS records for the API. This will include an HTTP and a real-time endpoint.
(string) --
(string) --
apiArn (string) --
The Amazon Resource Name (ARN) for the Api.
created (datetime) --
The date and time that the Api was created.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this Api.
wafWebAclArn (string) --
The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists.
eventConfig (dict) --
The Event API configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) --
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) --
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) --
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultPublishAuthModes (list) --
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultSubscribeAuthModes (list) --
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) --
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) --
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
Creates a ChannelNamespace for an Api.
See also: AWS API Documentation
Request Syntax
client.create_channel_namespace( apiId='string', name='string', subscribeAuthModes=[ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], publishAuthModes=[ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], codeHandlers='string', tags={ 'string': 'string' } )
string
[REQUIRED]
The Api ID.
string
[REQUIRED]
The name of the ChannelNamespace. This name must be unique within the Api
list
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Api authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
list
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Api authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
string
The event handler functions that run custom business logic to process published events and subscribe requests.
dict
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dict
Response Syntax
{ 'channelNamespace': { 'apiId': 'string', 'name': 'string', 'subscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'publishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'codeHandlers': 'string', 'tags': { 'string': 'string' }, 'channelNamespaceArn': 'string', 'created': datetime(2015, 1, 1), 'lastModified': datetime(2015, 1, 1) } }
Response Structure
(dict) --
channelNamespace (dict) --
The ChannelNamespace object.
apiId (string) --
The Api ID.
name (string) --
The name of the channel namespace. This name must be unique within the Api.
subscribeAuthModes (list) --
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
publishAuthModes (list) --
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
codeHandlers (string) --
The event handler functions that run custom business logic to process published events and subscribe requests.
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
channelNamespaceArn (string) --
The Amazon Resource Name (ARN) for the ChannelNamespace.
created (datetime) --
The date and time that the ChannelNamespace was created.
lastModified (datetime) --
The date and time that the ChannelNamespace was last changed.
Retrieves the channel namespace for a specified Api.
See also: AWS API Documentation
Request Syntax
client.get_channel_namespace( apiId='string', name='string' )
string
[REQUIRED]
The Api ID.
string
[REQUIRED]
The name of the ChannelNamespace.
dict
Response Syntax
{ 'channelNamespace': { 'apiId': 'string', 'name': 'string', 'subscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'publishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'codeHandlers': 'string', 'tags': { 'string': 'string' }, 'channelNamespaceArn': 'string', 'created': datetime(2015, 1, 1), 'lastModified': datetime(2015, 1, 1) } }
Response Structure
(dict) --
channelNamespace (dict) --
The ChannelNamespace object.
apiId (string) --
The Api ID.
name (string) --
The name of the channel namespace. This name must be unique within the Api.
subscribeAuthModes (list) --
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
publishAuthModes (list) --
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
codeHandlers (string) --
The event handler functions that run custom business logic to process published events and subscribe requests.
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
channelNamespaceArn (string) --
The Amazon Resource Name (ARN) for the ChannelNamespace.
created (datetime) --
The date and time that the ChannelNamespace was created.
lastModified (datetime) --
The date and time that the ChannelNamespace was last changed.
Updates a ChannelNamespace associated with an Api.
See also: AWS API Documentation
Request Syntax
client.update_channel_namespace( apiId='string', name='string', subscribeAuthModes=[ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], publishAuthModes=[ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], codeHandlers='string' )
string
[REQUIRED]
The Api ID.
string
[REQUIRED]
The name of the ChannelNamespace.
list
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default Api authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
list
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default Api authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
string
The event handler functions that run custom business logic to process published events and subscribe requests.
dict
Response Syntax
{ 'channelNamespace': { 'apiId': 'string', 'name': 'string', 'subscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'publishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'codeHandlers': 'string', 'tags': { 'string': 'string' }, 'channelNamespaceArn': 'string', 'created': datetime(2015, 1, 1), 'lastModified': datetime(2015, 1, 1) } }
Response Structure
(dict) --
channelNamespace (dict) --
The ChannelNamespace object.
apiId (string) --
The Api ID.
name (string) --
The name of the channel namespace. This name must be unique within the Api.
subscribeAuthModes (list) --
The authorization mode to use for subscribing to messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
publishAuthModes (list) --
The authorization mode to use for publishing messages on the channel namespace. This configuration overrides the default ``Api``authorization configuration.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
codeHandlers (string) --
The event handler functions that run custom business logic to process published events and subscribe requests.
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
channelNamespaceArn (string) --
The Amazon Resource Name (ARN) for the ChannelNamespace.
created (datetime) --
The date and time that the ChannelNamespace was created.
lastModified (datetime) --
The date and time that the ChannelNamespace was last changed.
Deletes a ChannelNamespace.
See also: AWS API Documentation
Request Syntax
client.delete_channel_namespace( apiId='string', name='string' )
string
[REQUIRED]
The ID of the Api associated with the ChannelNamespace.
string
[REQUIRED]
The name of the ChannelNamespace.
dict
Response Syntax
{}
Response Structure
(dict) --
Creates an Api object. Use this operation to create an AppSync API with your preferred configuration, such as an Event API that provides real-time message publishing and message subscriptions over WebSockets.
See also: AWS API Documentation
Request Syntax
client.create_api( name='string', ownerContact='string', tags={ 'string': 'string' }, eventConfig={ 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } )
string
[REQUIRED]
The name for the Api.
string
The owner contact information for the Api.
dict
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dict
The Event API configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) -- [REQUIRED]
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) -- [REQUIRED]
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) -- [REQUIRED]
The user pool ID.
awsRegion (string) -- [REQUIRED]
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) -- [REQUIRED]
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
defaultPublishAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
defaultSubscribeAuthModes (list) -- [REQUIRED]
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) -- [REQUIRED]
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) -- [REQUIRED]
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) -- [REQUIRED]
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
dict
Response Syntax
{ 'api': { 'apiId': 'string', 'name': 'string', 'ownerContact': 'string', 'tags': { 'string': 'string' }, 'dns': { 'string': 'string' }, 'apiArn': 'string', 'created': datetime(2015, 1, 1), 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'eventConfig': { 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } } }
Response Structure
(dict) --
api (dict) --
The Api object.
apiId (string) --
The Api ID.
name (string) --
The name of the Api.
ownerContact (string) --
The owner contact information for the Api
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dns (dict) --
The DNS records for the API. This will include an HTTP and a real-time endpoint.
(string) --
(string) --
apiArn (string) --
The Amazon Resource Name (ARN) for the Api.
created (datetime) --
The date and time that the Api was created.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this Api.
wafWebAclArn (string) --
The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists.
eventConfig (dict) --
The Event API configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) --
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) --
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) --
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultPublishAuthModes (list) --
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultSubscribeAuthModes (list) --
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) --
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) --
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
Lists the APIs in your AppSync account.
ListApis returns only the high level API details. For more detailed information about an API, use GetApi.
See also: AWS API Documentation
Request Syntax
client.list_apis( nextToken='string', maxResults=123 )
string
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
integer
The maximum number of results that you want the request to return.
dict
Response Syntax
{ 'apis': [ { 'apiId': 'string', 'name': 'string', 'ownerContact': 'string', 'tags': { 'string': 'string' }, 'dns': { 'string': 'string' }, 'apiArn': 'string', 'created': datetime(2015, 1, 1), 'xrayEnabled': True|False, 'wafWebAclArn': 'string', 'eventConfig': { 'authProviders': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA', 'cognitoConfig': { 'userPoolId': 'string', 'awsRegion': 'string', 'appIdClientRegex': 'string' }, 'openIDConnectConfig': { 'issuer': 'string', 'clientId': 'string', 'iatTTL': 123, 'authTTL': 123 }, 'lambdaAuthorizerConfig': { 'authorizerResultTtlInSeconds': 123, 'authorizerUri': 'string', 'identityValidationExpression': 'string' } }, ], 'connectionAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultPublishAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'defaultSubscribeAuthModes': [ { 'authType': 'API_KEY'|'AWS_IAM'|'AMAZON_COGNITO_USER_POOLS'|'OPENID_CONNECT'|'AWS_LAMBDA' }, ], 'logConfig': { 'logLevel': 'NONE'|'ERROR'|'ALL'|'INFO'|'DEBUG', 'cloudWatchLogsRoleArn': 'string' } } }, ], 'nextToken': 'string' }
Response Structure
(dict) --
apis (list) --
The Api objects.
(dict) --
Describes an AppSync API. You can use Api for an AppSync API with your preferred configuration, such as an Event API that provides real-time message publishing and message subscriptions over WebSockets.
apiId (string) --
The Api ID.
name (string) --
The name of the Api.
ownerContact (string) --
The owner contact information for the Api
tags (dict) --
A map with keys of TagKey objects and values of TagValue objects.
(string) --
The key for the tag.
(string) --
The value for the tag.
dns (dict) --
The DNS records for the API. This will include an HTTP and a real-time endpoint.
(string) --
(string) --
apiArn (string) --
The Amazon Resource Name (ARN) for the Api.
created (datetime) --
The date and time that the Api was created.
xrayEnabled (boolean) --
A flag indicating whether to use X-Ray tracing for this Api.
wafWebAclArn (string) --
The Amazon Resource Name (ARN) of the WAF web access control list (web ACL) associated with this Api, if one exists.
eventConfig (dict) --
The Event API configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.
authProviders (list) --
A list of authorization providers.
(dict) --
Describes an authorization provider.
authType (string) --
The authorization type.
cognitoConfig (dict) --
Describes an Amazon Cognito user pool configuration.
userPoolId (string) --
The user pool ID.
awsRegion (string) --
The Amazon Web Services Region in which the user pool was created.
appIdClientRegex (string) --
A regular expression for validating the incoming Amazon Cognito user pool app client ID. If this value isn't set, no filtering is applied.
openIDConnectConfig (dict) --
Describes an OpenID Connect (OIDC) configuration.
issuer (string) --
The issuer for the OIDC configuration. The issuer returned by discovery must exactly match the value of iss in the ID token.
clientId (string) --
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 that AppSync can validate against multiple client identifiers at a time.
iatTTL (integer) --
The number of milliseconds that a token is valid after it's issued to a user.
authTTL (integer) --
The number of milliseconds that a token is valid after being authenticated.
lambdaAuthorizerConfig (dict) --
A LambdaAuthorizerConfig specifies how to authorize AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an AppSync API can have only one Lambda authorizer configured at a time.
authorizerResultTtlInSeconds (integer) --
The number of seconds a response should be cached for. The default is 0 seconds, which disables caching. If you don't specify a value for authorizerResultTtlInSeconds, the default value is used. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.
authorizerUri (string) --
The Amazon Resource Name (ARN) of the Lambda function to be called for authorization. This can be a standard Lambda ARN, a version ARN ( .../v3), or an alias ARN.
Note: 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 use the Command Line Interface (CLI), run the following:
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
identityValidationExpression (string) --
A regular expression for validation of tokens before the Lambda function is called.
connectionAuthModes (list) --
A list of valid authorization modes for the Event API connections.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultPublishAuthModes (list) --
A list of valid authorization modes for the Event API publishing.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
defaultSubscribeAuthModes (list) --
A list of valid authorization modes for the Event API subscriptions.
(dict) --
Describes an authorization configuration. Use AuthMode to specify the publishing and subscription authorization configuration for an Event API.
authType (string) --
The authorization type.
logConfig (dict) --
The CloudWatch Logs configuration for the Event API.
logLevel (string) --
The type of information to log for the Event API.
cloudWatchLogsRoleArn (string) --
The IAM service role that AppSync assumes to publish CloudWatch Logs in your account.
nextToken (string) --
An identifier that was returned from the previous call to this operation, which you can use to return the next set of items in the list.
Deletes an Api object
See also: AWS API Documentation
Request Syntax
client.delete_api( apiId='string' )
string
[REQUIRED]
The Api ID.
dict
Response Syntax
{}
Response Structure
(dict) --