AWS AppSync

2018/07/12 - AWS AppSync - 4 updated api methods

Changes  This release adds support for configuring HTTP endpoints as data sources for your AWS AppSync GraphQL API.

CreateDataSource (updated) Link ¶
Changes (request, response)
Request
{'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}
Response
{'dataSource': {'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}}

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'|'HTTP',
    serviceRoleArn='string',
    dynamodbConfig={
        'tableName': 'string',
        'awsRegion': 'string',
        'useCallerCredentials': True|False
    },
    lambdaConfig={
        'lambdaFunctionArn': 'string'
    },
    elasticsearchConfig={
        'endpoint': 'string',
        'awsRegion': 'string'
    },
    httpConfig={
        'endpoint': '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.

type httpConfig

dict

param httpConfig

Http endpoint settings.

  • endpoint (string) --

    The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'dataSourceArn': 'string',
        'name': 'string',
        'description': 'string',
        'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        },
        'httpConfig': {
            'endpoint': '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 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.

        • HTTP : The data source is an HTTP endpoint.

      • 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.

      • httpConfig (dict) --

        Http endpoint settings.

        • endpoint (string) --

          The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.

GetDataSource (updated) Link ¶
Changes (response)
{'dataSource': {'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}}

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'|'HTTP',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        },
        'httpConfig': {
            'endpoint': '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 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.

        • HTTP : The data source is an HTTP endpoint.

      • 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.

      • httpConfig (dict) --

        Http endpoint settings.

        • endpoint (string) --

          The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.

ListDataSources (updated) Link ¶
Changes (response)
{'dataSources': {'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}}

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'|'HTTP',
            'serviceRoleArn': 'string',
            'dynamodbConfig': {
                'tableName': 'string',
                'awsRegion': 'string',
                'useCallerCredentials': True|False
            },
            'lambdaConfig': {
                'lambdaFunctionArn': 'string'
            },
            'elasticsearchConfig': {
                'endpoint': 'string',
                'awsRegion': 'string'
            },
            'httpConfig': {
                'endpoint': '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 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.

          • HTTP : The data source is an HTTP endpoint.

        • 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.

        • httpConfig (dict) --

          Http endpoint settings.

          • endpoint (string) --

            The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.

    • 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
{'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}
Response
{'dataSource': {'httpConfig': {'endpoint': 'string'}, 'type': ['HTTP']}}

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'|'HTTP',
    serviceRoleArn='string',
    dynamodbConfig={
        'tableName': 'string',
        'awsRegion': 'string',
        'useCallerCredentials': True|False
    },
    lambdaConfig={
        'lambdaFunctionArn': 'string'
    },
    elasticsearchConfig={
        'endpoint': 'string',
        'awsRegion': 'string'
    },
    httpConfig={
        'endpoint': '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.

type httpConfig

dict

param httpConfig

The new http endpoint configuration

  • endpoint (string) --

    The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.

rtype

dict

returns

Response Syntax

{
    'dataSource': {
        'dataSourceArn': 'string',
        'name': 'string',
        'description': 'string',
        'type': 'AWS_LAMBDA'|'AMAZON_DYNAMODB'|'AMAZON_ELASTICSEARCH'|'NONE'|'HTTP',
        'serviceRoleArn': 'string',
        'dynamodbConfig': {
            'tableName': 'string',
            'awsRegion': 'string',
            'useCallerCredentials': True|False
        },
        'lambdaConfig': {
            'lambdaFunctionArn': 'string'
        },
        'elasticsearchConfig': {
            'endpoint': 'string',
            'awsRegion': 'string'
        },
        'httpConfig': {
            'endpoint': '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 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.

        • HTTP : The data source is an HTTP endpoint.

      • 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.

      • httpConfig (dict) --

        Http endpoint settings.

        • endpoint (string) --

          The Http url endpoint. You can either specify the domain name or ip and port combination and the url scheme must be http(s). If the port is not specified, AWS AppSync will use the default port 80 for http endpoint and port 443 for https endpoints.