AWS AppSync

2018/02/14 - AWS AppSync - 1 new 5 updated api methods

Changes  AWS AppSync now supports for None Data Source, CreateApiKey now supports setting expiration on API keys, new API UpdateApiKey supports updating expiration on API keys.

UpdateApiKey (new) Link ¶

Updates an API key.

See also: AWS API Documentation

Request Syntax

client.update_api_key(
    apiId='string',
    id='string',
    description='string',
    expires=123
)
type apiId

string

param apiId

[REQUIRED]

The ID for the GraphQL API

type id

string

param id

[REQUIRED]

The API key ID.

type description

string

param description

A description of the purpose of the API key.

type expires

integer

param expires

The time after which the API key expires. The date is represented as seconds since the epoch.

rtype

dict

returns

Response Syntax

{
    'apiKey': {
        'id': 'string',
        'description': 'string',
        'expires': 123
    }
}

Response Structure

  • (dict) --

    • apiKey (dict) --

      The API key.

      • id (string) --

        The API key ID.

      • description (string) --

        A description of the purpose of the API key.

      • expires (integer) --

        The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

CreateApiKey (updated) Link ¶
Changes (request)
{'expires': 'long'}

Creates a unique key that you can distribute to clients who are executing your API.

See also: AWS API Documentation

Request Syntax

client.create_api_key(
    apiId='string',
    description='string',
    expires=123
)
type apiId

string

param apiId

[REQUIRED]

The ID for your GraphQL API.

type description

string

param description

A description of the purpose of the API key.

type expires

integer

param expires

The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour. The default value for this parameter is 7 days from creation time.

rtype

dict

returns

Response Syntax

{
    'apiKey': {
        'id': 'string',
        'description': 'string',
        'expires': 123
    }
}

Response Structure

  • (dict) --

    • apiKey (dict) --

      The API key.

      • id (string) --

        The API key ID.

      • description (string) --

        A description of the purpose of the API key.

      • expires (integer) --

        The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

CreateDataSource (updated) Link ¶
Changes (request, response)
Request
{'type': {'NONE'}}
Response
{'dataSource': {'type': {'NONE'}}}

Creates a DataSource object.

See also: AWS API Documentation

Request Syntax

client.create_data_source(
    apiId='string',
    name='string',
    description='string',
    type='AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
    serviceRoleArn='string',
    dynamodbConfig={
        'tableName': 'string',
        'awsRegion': 'string',
        'useCallerCredentials': True|False
    },
    lambdaConfig={
        'lambdaFunctionArn': 'string'
    },
    elasticsearchConfig={
        'endpoint': 'string',
        'awsRegion': 'string'
    }
)
type apiId

string

param apiId

[REQUIRED]

The API ID for the GraphQL API for the DataSource .

type name

string

param name

[REQUIRED]

A user-supplied name for the DataSource .

type description

string

param description

A description of the DataSource .

type type

string

param type

[REQUIRED]

The type of the DataSource .

type serviceRoleArn

string

param serviceRoleArn

The IAM service role ARN for the data source. The system assumes this role when accessing the data source.

type dynamodbConfig

dict

param dynamodbConfig

DynamoDB settings.

  • tableName (string) -- [REQUIRED]

    The table name.

  • awsRegion (string) -- [REQUIRED]

    The AWS region.

  • useCallerCredentials (boolean) --

    Set to TRUE to use Amazon Cognito credentials with this data source.

type lambdaConfig

dict

param lambdaConfig

AWS Lambda settings.

  • lambdaFunctionArn (string) -- [REQUIRED]

    The ARN for the Lambda function.

type elasticsearchConfig

dict

param elasticsearchConfig

Amazon Elasticsearch settings.

  • endpoint (string) -- [REQUIRED]

    The endpoint.

  • awsRegion (string) -- [REQUIRED]

    The AWS region.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'dataSourceArn': 'string',
        'name': 'string',
        'description': 'string',
        'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      The DataSource object.

      • dataSourceArn (string) --

        The data source ARN.

      • name (string) --

        The name of the data source.

      • description (string) --

        The description of the data source.

      • type (string) --

        The type of the data source.

        • AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.

        • AMAZON_ELASTICSEARCH : The data source is an Amazon Elasticsearch Service domain.

        • AWS_LAMBDA : The data source is an AWS Lambda function.

        • NONE : There is no data source. This type is used when the required information can be computed on the fly without connecting to a back-end data source.

      • serviceRoleArn (string) --

        The IAM service role ARN for the data source. The system assumes this role when accessing the data source.

      • dynamodbConfig (dict) --

        DynamoDB settings.

        • tableName (string) --

          The table name.

        • awsRegion (string) --

          The AWS region.

        • useCallerCredentials (boolean) --

          Set to TRUE to use Amazon Cognito credentials with this data source.

      • lambdaConfig (dict) --

        Lambda settings.

        • lambdaFunctionArn (string) --

          The ARN for the Lambda function.

      • elasticsearchConfig (dict) --

        Amazon Elasticsearch settings.

        • endpoint (string) --

          The endpoint.

        • awsRegion (string) --

          The AWS region.

GetDataSource (updated) Link ¶
Changes (response)
{'dataSource': {'type': {'NONE'}}}

Retrieves a DataSource object.

See also: AWS API Documentation

Request Syntax

client.get_data_source(
    apiId='string',
    name='string'
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type name

string

param name

[REQUIRED]

The name of the data source.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'dataSourceArn': 'string',
        'name': 'string',
        'description': 'string',
        'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      The DataSource object.

      • dataSourceArn (string) --

        The data source ARN.

      • name (string) --

        The name of the data source.

      • description (string) --

        The description of the data source.

      • type (string) --

        The type of the data source.

        • AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.

        • AMAZON_ELASTICSEARCH : The data source is an Amazon Elasticsearch Service domain.

        • AWS_LAMBDA : The data source is an AWS Lambda function.

        • NONE : There is no data source. This type is used when the required information can be computed on the fly without connecting to a back-end data source.

      • serviceRoleArn (string) --

        The IAM service role ARN for the data source. The system assumes this role when accessing the data source.

      • dynamodbConfig (dict) --

        DynamoDB settings.

        • tableName (string) --

          The table name.

        • awsRegion (string) --

          The AWS region.

        • useCallerCredentials (boolean) --

          Set to TRUE to use Amazon Cognito credentials with this data source.

      • lambdaConfig (dict) --

        Lambda settings.

        • lambdaFunctionArn (string) --

          The ARN for the Lambda function.

      • elasticsearchConfig (dict) --

        Amazon Elasticsearch settings.

        • endpoint (string) --

          The endpoint.

        • awsRegion (string) --

          The AWS region.

ListDataSources (updated) Link ¶
Changes (response)
{'dataSources': {'type': {'NONE'}}}

Lists the data sources for a given API.

See also: AWS API Documentation

Request Syntax

client.list_data_sources(
    apiId='string',
    nextToken='string',
    maxResults=123
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type nextToken

string

param nextToken

An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

type maxResults

integer

param maxResults

The maximum number of results you want the request to return.

rtype

dict

returns

Response Syntax

{
    'dataSources': [
        {
            'dataSourceArn': 'string',
            'name': 'string',
            'description': 'string',
            'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
            'serviceRoleArn': 'string',
            'dynamodbConfig': {
                'tableName': 'string',
                'awsRegion': 'string',
                'useCallerCredentials': True|False
            },
            'lambdaConfig': {
                'lambdaFunctionArn': 'string'
            },
            'elasticsearchConfig': {
                'endpoint': 'string',
                'awsRegion': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • dataSources (list) --

      The DataSource objects.

      • (dict) --

        Describes a data source.

        • dataSourceArn (string) --

          The data source ARN.

        • name (string) --

          The name of the data source.

        • description (string) --

          The description of the data source.

        • type (string) --

          The type of the data source.

          • AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.

          • AMAZON_ELASTICSEARCH : The data source is an Amazon Elasticsearch Service domain.

          • AWS_LAMBDA : The data source is an AWS Lambda function.

          • NONE : There is no data source. This type is used when the required information can be computed on the fly without connecting to a back-end data source.

        • serviceRoleArn (string) --

          The IAM service role ARN for the data source. The system assumes this role when accessing the data source.

        • dynamodbConfig (dict) --

          DynamoDB settings.

          • tableName (string) --

            The table name.

          • awsRegion (string) --

            The AWS region.

          • useCallerCredentials (boolean) --

            Set to TRUE to use Amazon Cognito credentials with this data source.

        • lambdaConfig (dict) --

          Lambda settings.

          • lambdaFunctionArn (string) --

            The ARN for the Lambda function.

        • elasticsearchConfig (dict) --

          Amazon Elasticsearch settings.

          • endpoint (string) --

            The endpoint.

          • awsRegion (string) --

            The AWS region.

    • nextToken (string) --

      An identifier to be passed in the next request to this operation to return the next set of items in the list.

UpdateDataSource (updated) Link ¶
Changes (request, response)
Request
{'type': {'NONE'}}
Response
{'dataSource': {'type': {'NONE'}}}

Updates a DataSource object.

See also: AWS API Documentation

Request Syntax

client.update_data_source(
    apiId='string',
    name='string',
    description='string',
    type='AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
    serviceRoleArn='string',
    dynamodbConfig={
        'tableName': 'string',
        'awsRegion': 'string',
        'useCallerCredentials': True|False
    },
    lambdaConfig={
        'lambdaFunctionArn': 'string'
    },
    elasticsearchConfig={
        'endpoint': 'string',
        'awsRegion': 'string'
    }
)
type apiId

string

param apiId

[REQUIRED]

The API ID.

type name

string

param name

[REQUIRED]

The new name for the data source.

type description

string

param description

The new description for the data source.

type type

string

param type

[REQUIRED]

The new data source type.

type serviceRoleArn

string

param serviceRoleArn

The new service role ARN for the data source.

type dynamodbConfig

dict

param dynamodbConfig

The new DynamoDB configuration.

  • tableName (string) -- [REQUIRED]

    The table name.

  • awsRegion (string) -- [REQUIRED]

    The AWS region.

  • useCallerCredentials (boolean) --

    Set to TRUE to use Amazon Cognito credentials with this data source.

type lambdaConfig

dict

param lambdaConfig

The new Lambda configuration.

  • lambdaFunctionArn (string) -- [REQUIRED]

    The ARN for the Lambda function.

type elasticsearchConfig

dict

param elasticsearchConfig

The new Elasticsearch configuration.

  • endpoint (string) -- [REQUIRED]

    The endpoint.

  • awsRegion (string) -- [REQUIRED]

    The AWS region.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'dataSourceArn': 'string',
        'name': 'string',
        'description': 'string',
        'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • dataSource (dict) --

      The updated DataSource object.

      • dataSourceArn (string) --

        The data source ARN.

      • name (string) --

        The name of the data source.

      • description (string) --

        The description of the data source.

      • type (string) --

        The type of the data source.

        • AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.

        • AMAZON_ELASTICSEARCH : The data source is an Amazon Elasticsearch Service domain.

        • AWS_LAMBDA : The data source is an AWS Lambda function.

        • NONE : There is no data source. This type is used when the required information can be computed on the fly without connecting to a back-end data source.

      • serviceRoleArn (string) --

        The IAM service role ARN for the data source. The system assumes this role when accessing the data source.

      • dynamodbConfig (dict) --

        DynamoDB settings.

        • tableName (string) --

          The table name.

        • awsRegion (string) --

          The AWS region.

        • useCallerCredentials (boolean) --

          Set to TRUE to use Amazon Cognito credentials with this data source.

      • lambdaConfig (dict) --

        Lambda settings.

        • lambdaFunctionArn (string) --

          The ARN for the Lambda function.

      • elasticsearchConfig (dict) --

        Amazon Elasticsearch settings.

        • endpoint (string) --

          The endpoint.

        • awsRegion (string) --

          The AWS region.