This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.

appsync

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

class pulumi_aws.appsync.ApiKey(resource_name, opts=None, api_id=None, description=None, expires=None, __props__=None, __name__=None, __opts__=None)

Provides an AppSync API Key.

import pulumi
import pulumi_aws as aws

example_graph_ql_api = aws.appsync.GraphQLApi("exampleGraphQLApi", authentication_type="API_KEY")
example_api_key = aws.appsync.ApiKey("exampleApiKey",
    api_id=example_graph_ql_api.id,
    expires="2018-05-03T04:00:00Z")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The ID of the associated AppSync API

  • description (pulumi.Input[str]) – The API key description. Defaults to “Managed by Pulumi”.

  • expires (pulumi.Input[str]) – RFC3339 string representation of the expiry date. Rounded down to nearest hour. By default, it is 7 days from the date of creation.

api_id: pulumi.Output[str] = None

The ID of the associated AppSync API

description: pulumi.Output[str] = None

The API key description. Defaults to “Managed by Pulumi”.

expires: pulumi.Output[str] = None

RFC3339 string representation of the expiry date. Rounded down to nearest hour. By default, it is 7 days from the date of creation.

key: pulumi.Output[str] = None

The API key

static get(resource_name, id, opts=None, api_id=None, description=None, expires=None, key=None)

Get an existing ApiKey resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The ID of the associated AppSync API

  • description (pulumi.Input[str]) – The API key description. Defaults to “Managed by Pulumi”.

  • expires (pulumi.Input[str]) – RFC3339 string representation of the expiry date. Rounded down to nearest hour. By default, it is 7 days from the date of creation.

  • key (pulumi.Input[str]) – The API key

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.appsync.DataSource(resource_name, opts=None, api_id=None, description=None, dynamodb_config=None, elasticsearch_config=None, http_config=None, lambda_config=None, name=None, service_role_arn=None, type=None, __props__=None, __name__=None, __opts__=None)

Provides an AppSync DataSource.

import pulumi
import pulumi_aws as aws

example_table = aws.dynamodb.Table("exampleTable",
    attributes=[{
        "name": "UserId",
        "type": "S",
    }],
    hash_key="UserId",
    read_capacity=1,
    write_capacity=1)
example_role = aws.iam.Role("exampleRole", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "appsync.amazonaws.com"
      },
      "Effect": "Allow"
    }
  ]
}

""")
example_role_policy = aws.iam.RolePolicy("exampleRolePolicy",
    policy=example_table.arn.apply(lambda arn: f"""{{
  "Version": "2012-10-17",
  "Statement": [
    {{
      "Action": [
        "dynamodb:*"
      ],
      "Effect": "Allow",
      "Resource": [
        "{arn}"
      ]
    }}
  ]
}}

"""),
    role=example_role.id)
example_graph_ql_api = aws.appsync.GraphQLApi("exampleGraphQLApi", authentication_type="API_KEY")
example_data_source = aws.appsync.DataSource("exampleDataSource",
    api_id=example_graph_ql_api.id,
    dynamodb_config={
        "table_name": example_table.name,
    },
    service_role_arn=example_role.arn,
    type="AMAZON_DYNAMODB")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The API ID for the GraphQL API for the DataSource.

  • description (pulumi.Input[str]) – A description of the DataSource.

  • dynamodb_config (pulumi.Input[dict]) – DynamoDB settings. See below

  • elasticsearch_config (pulumi.Input[dict]) – Amazon Elasticsearch settings. See below

  • http_config (pulumi.Input[dict]) – HTTP settings. See below

  • lambda_config (pulumi.Input[dict]) – AWS Lambda settings. See below

  • name (pulumi.Input[str]) – A user-supplied name for the DataSource.

  • service_role_arn (pulumi.Input[str]) – The IAM service role ARN for the data source.

  • type (pulumi.Input[str]) – The type of the DataSource. Valid values: AWS_LAMBDA, AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, HTTP, NONE.

The dynamodb_config object supports the following:

  • region (pulumi.Input[str]) - AWS region of Elasticsearch domain. Defaults to current region.

  • table_name (pulumi.Input[str]) - Name of the DynamoDB table.

  • useCallerCredentials (pulumi.Input[bool]) - Set to true to use Amazon Cognito credentials with this data source.

The elasticsearch_config object supports the following:

  • endpoint (pulumi.Input[str]) - HTTP URL.

  • region (pulumi.Input[str]) - AWS region of Elasticsearch domain. Defaults to current region.

The http_config object supports the following:

  • endpoint (pulumi.Input[str]) - HTTP URL.

The lambda_config object supports the following:

  • function_arn (pulumi.Input[str]) - The ARN for the Lambda function.

api_id: pulumi.Output[str] = None

The API ID for the GraphQL API for the DataSource.

arn: pulumi.Output[str] = None

The ARN

description: pulumi.Output[str] = None

A description of the DataSource.

dynamodb_config: pulumi.Output[dict] = None

DynamoDB settings. See below

  • region (str) - AWS region of Elasticsearch domain. Defaults to current region.

  • table_name (str) - Name of the DynamoDB table.

  • useCallerCredentials (bool) - Set to true to use Amazon Cognito credentials with this data source.

elasticsearch_config: pulumi.Output[dict] = None

Amazon Elasticsearch settings. See below

  • endpoint (str) - HTTP URL.

  • region (str) - AWS region of Elasticsearch domain. Defaults to current region.

http_config: pulumi.Output[dict] = None

HTTP settings. See below

  • endpoint (str) - HTTP URL.

lambda_config: pulumi.Output[dict] = None

AWS Lambda settings. See below

  • function_arn (str) - The ARN for the Lambda function.

name: pulumi.Output[str] = None

A user-supplied name for the DataSource.

service_role_arn: pulumi.Output[str] = None

The IAM service role ARN for the data source.

type: pulumi.Output[str] = None

The type of the DataSource. Valid values: AWS_LAMBDA, AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, HTTP, NONE.

static get(resource_name, id, opts=None, api_id=None, arn=None, description=None, dynamodb_config=None, elasticsearch_config=None, http_config=None, lambda_config=None, name=None, service_role_arn=None, type=None)

Get an existing DataSource resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The API ID for the GraphQL API for the DataSource.

  • arn (pulumi.Input[str]) – The ARN

  • description (pulumi.Input[str]) – A description of the DataSource.

  • dynamodb_config (pulumi.Input[dict]) – DynamoDB settings. See below

  • elasticsearch_config (pulumi.Input[dict]) – Amazon Elasticsearch settings. See below

  • http_config (pulumi.Input[dict]) – HTTP settings. See below

  • lambda_config (pulumi.Input[dict]) – AWS Lambda settings. See below

  • name (pulumi.Input[str]) – A user-supplied name for the DataSource.

  • service_role_arn (pulumi.Input[str]) – The IAM service role ARN for the data source.

  • type (pulumi.Input[str]) – The type of the DataSource. Valid values: AWS_LAMBDA, AMAZON_DYNAMODB, AMAZON_ELASTICSEARCH, HTTP, NONE.

The dynamodb_config object supports the following:

  • region (pulumi.Input[str]) - AWS region of Elasticsearch domain. Defaults to current region.

  • table_name (pulumi.Input[str]) - Name of the DynamoDB table.

  • useCallerCredentials (pulumi.Input[bool]) - Set to true to use Amazon Cognito credentials with this data source.

The elasticsearch_config object supports the following:

  • endpoint (pulumi.Input[str]) - HTTP URL.

  • region (pulumi.Input[str]) - AWS region of Elasticsearch domain. Defaults to current region.

The http_config object supports the following:

  • endpoint (pulumi.Input[str]) - HTTP URL.

The lambda_config object supports the following:

  • function_arn (pulumi.Input[str]) - The ARN for the Lambda function.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.appsync.Function(resource_name, opts=None, api_id=None, data_source=None, description=None, function_version=None, name=None, request_mapping_template=None, response_mapping_template=None, __props__=None, __name__=None, __opts__=None)

Provides an AppSync Function.

import pulumi
import pulumi_aws as aws

test_graph_ql_api = aws.appsync.GraphQLApi("testGraphQLApi",
    authentication_type="API_KEY",
    schema="""type Mutation {
    putPost(id: ID!, title: String!): Post
}

type Post {
    id: ID!
    title: String!
}

type Query {
    singlePost(id: ID!): Post
}

schema {
    query: Query
    mutation: Mutation
}

""")
test_data_source = aws.appsync.DataSource("testDataSource",
    api_id=test_graph_ql_api.id,
    http_config={
        "endpoint": "http://example.com",
    },
    type="HTTP")
test_function = aws.appsync.Function("testFunction",
    api_id=test_graph_ql_api.id,
    data_source=test_data_source.name,
    name="tf_example",
    request_mapping_template="""{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}

""",
    response_mapping_template="""#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end

""")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The ID of the associated AppSync API.

  • data_source (pulumi.Input[str]) – The Function DataSource name.

  • description (pulumi.Input[str]) – The Function description.

  • function_version (pulumi.Input[str]) – The version of the request mapping template. Currently the supported value is 2018-05-29.

  • name (pulumi.Input[str]) – The Function name. The function name does not have to be unique.

  • request_mapping_template (pulumi.Input[str]) – The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

  • response_mapping_template (pulumi.Input[str]) – The Function response mapping template.

api_id: pulumi.Output[str] = None

The ID of the associated AppSync API.

arn: pulumi.Output[str] = None

The ARN of the Function object.

data_source: pulumi.Output[str] = None

The Function DataSource name.

description: pulumi.Output[str] = None

The Function description.

function_id: pulumi.Output[str] = None

A unique ID representing the Function object.

function_version: pulumi.Output[str] = None

The version of the request mapping template. Currently the supported value is 2018-05-29.

name: pulumi.Output[str] = None

The Function name. The function name does not have to be unique.

request_mapping_template: pulumi.Output[str] = None

The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

response_mapping_template: pulumi.Output[str] = None

The Function response mapping template.

static get(resource_name, id, opts=None, api_id=None, arn=None, data_source=None, description=None, function_id=None, function_version=None, name=None, request_mapping_template=None, response_mapping_template=None)

Get an existing Function resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The ID of the associated AppSync API.

  • arn (pulumi.Input[str]) – The ARN of the Function object.

  • data_source (pulumi.Input[str]) – The Function DataSource name.

  • description (pulumi.Input[str]) – The Function description.

  • function_id (pulumi.Input[str]) – A unique ID representing the Function object.

  • function_version (pulumi.Input[str]) – The version of the request mapping template. Currently the supported value is 2018-05-29.

  • name (pulumi.Input[str]) – The Function name. The function name does not have to be unique.

  • request_mapping_template (pulumi.Input[str]) – The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.

  • response_mapping_template (pulumi.Input[str]) – The Function response mapping template.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.appsync.GraphQLApi(resource_name, opts=None, additional_authentication_providers=None, authentication_type=None, log_config=None, name=None, openid_connect_config=None, schema=None, tags=None, user_pool_config=None, xray_enabled=None, __props__=None, __name__=None, __opts__=None)

Provides an AppSync GraphQL API.

import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example", authentication_type="API_KEY")
import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example",
    authentication_type="AMAZON_COGNITO_USER_POOLS",
    user_pool_config={
        "awsRegion": data["aws_region"]["current"]["name"],
        "default_action": "DENY",
        "user_pool_id": aws_cognito_user_pool["example"]["id"],
    })
import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example", authentication_type="AWS_IAM")
import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example",
    authentication_type="AWS_IAM",
    schema="""schema {
        query: Query
}
type Query {
  test: Int
}

""")
import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example",
    authentication_type="OPENID_CONNECT",
    openid_connect_config={
        "issuer": "https://example.com",
    })
import pulumi
import pulumi_aws as aws

example = aws.appsync.GraphQLApi("example",
    additional_authentication_providers=[{
        "authentication_type": "AWS_IAM",
    }],
    authentication_type="API_KEY")
import pulumi
import pulumi_aws as aws

example_role = aws.iam.Role("exampleRole", assume_role_policy="""{
    "Version": "2012-10-17",
    "Statement": [
        {
        "Effect": "Allow",
        "Principal": {
            "Service": "appsync.amazonaws.com"
        },
        "Action": "sts:AssumeRole"
        }
    ]
}

""")
example_role_policy_attachment = aws.iam.RolePolicyAttachment("exampleRolePolicyAttachment",
    policy_arn="arn:aws:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs",
    role=example_role.name)
example_graph_ql_api = aws.appsync.GraphQLApi("exampleGraphQLApi", log_config={
    "cloudwatchLogsRoleArn": example_role.arn,
    "fieldLogLevel": "ERROR",
})
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • additional_authentication_providers (pulumi.Input[list]) – One or more additional authentication providers for the GraphqlApi. Defined below.

  • authentication_type (pulumi.Input[str]) – The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

  • log_config (pulumi.Input[dict]) – Nested argument containing logging configuration. Defined below.

  • name (pulumi.Input[str]) – A user-supplied name for the GraphqlApi.

  • openid_connect_config (pulumi.Input[dict]) – Nested argument containing OpenID Connect configuration. Defined below.

  • schema (pulumi.Input[str]) – The schema definition, in GraphQL schema language format. This provider cannot perform drift detection of this configuration.

  • tags (pulumi.Input[dict]) – A map of tags to assign to the resource.

  • user_pool_config (pulumi.Input[dict]) – The Amazon Cognito User Pool configuration. Defined below.

  • xray_enabled (pulumi.Input[bool]) – Whether tracing with X-ray is enabled. Defaults to false.

The additional_authentication_providers object supports the following:

  • authentication_type (pulumi.Input[str]) - The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

  • openid_connect_config (pulumi.Input[dict]) - Nested argument containing OpenID Connect configuration. Defined below.

    • authTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being authenticated.

    • client_id (pulumi.Input[str]) - 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.

    • iatTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being issued to a user.

    • issuer (pulumi.Input[str]) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

  • user_pool_config (pulumi.Input[dict]) - The Amazon Cognito User Pool configuration. Defined below.

    • appIdClientRegex (pulumi.Input[str]) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

    • awsRegion (pulumi.Input[str]) - The AWS region in which the user pool was created.

    • user_pool_id (pulumi.Input[str]) - The user pool ID.

The log_config object supports the following:

  • cloudwatchLogsRoleArn (pulumi.Input[str]) - Amazon Resource Name of the service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account.

  • excludeVerboseContent (pulumi.Input[bool]) - Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level. Valid values: true, false. Default value: false

  • fieldLogLevel (pulumi.Input[str]) - Field logging level. Valid values: ALL, ERROR, NONE.

The openid_connect_config object supports the following:

  • authTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being authenticated.

  • client_id (pulumi.Input[str]) - 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.

  • iatTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being issued to a user.

  • issuer (pulumi.Input[str]) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

The user_pool_config object supports the following:

  • appIdClientRegex (pulumi.Input[str]) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

  • awsRegion (pulumi.Input[str]) - The AWS region in which the user pool was created.

  • default_action (pulumi.Input[str]) - The action that you want your GraphQL API to take when a request that uses Amazon Cognito User Pool authentication doesn’t match the Amazon Cognito User Pool configuration. Valid: ALLOW and DENY

  • user_pool_id (pulumi.Input[str]) - The user pool ID.

additional_authentication_providers: pulumi.Output[list] = None

One or more additional authentication providers for the GraphqlApi. Defined below.

  • authentication_type (str) - The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

  • openid_connect_config (dict) - Nested argument containing OpenID Connect configuration. Defined below.

    • authTtl (float) - Number of milliseconds a token is valid after being authenticated.

    • client_id (str) - 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.

    • iatTtl (float) - Number of milliseconds a token is valid after being issued to a user.

    • issuer (str) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

  • user_pool_config (dict) - The Amazon Cognito User Pool configuration. Defined below.

    • appIdClientRegex (str) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

    • awsRegion (str) - The AWS region in which the user pool was created.

    • user_pool_id (str) - The user pool ID.

arn: pulumi.Output[str] = None

The ARN

authentication_type: pulumi.Output[str] = None

The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

log_config: pulumi.Output[dict] = None

Nested argument containing logging configuration. Defined below.

  • cloudwatchLogsRoleArn (str) - Amazon Resource Name of the service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account.

  • excludeVerboseContent (bool) - Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level. Valid values: true, false. Default value: false

  • fieldLogLevel (str) - Field logging level. Valid values: ALL, ERROR, NONE.

name: pulumi.Output[str] = None

A user-supplied name for the GraphqlApi.

openid_connect_config: pulumi.Output[dict] = None

Nested argument containing OpenID Connect configuration. Defined below.

  • authTtl (float) - Number of milliseconds a token is valid after being authenticated.

  • client_id (str) - 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.

  • iatTtl (float) - Number of milliseconds a token is valid after being issued to a user.

  • issuer (str) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

schema: pulumi.Output[str] = None

The schema definition, in GraphQL schema language format. This provider cannot perform drift detection of this configuration.

tags: pulumi.Output[dict] = None

A map of tags to assign to the resource.

uris: pulumi.Output[dict] = None

Map of URIs associated with the API. e.g. uris["GRAPHQL"] = https://ID.appsync-api.REGION.amazonaws.com/graphql

user_pool_config: pulumi.Output[dict] = None

The Amazon Cognito User Pool configuration. Defined below.

  • appIdClientRegex (str) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

  • awsRegion (str) - The AWS region in which the user pool was created.

  • default_action (str) - The action that you want your GraphQL API to take when a request that uses Amazon Cognito User Pool authentication doesn’t match the Amazon Cognito User Pool configuration. Valid: ALLOW and DENY

  • user_pool_id (str) - The user pool ID.

xray_enabled: pulumi.Output[bool] = None

Whether tracing with X-ray is enabled. Defaults to false.

static get(resource_name, id, opts=None, additional_authentication_providers=None, arn=None, authentication_type=None, log_config=None, name=None, openid_connect_config=None, schema=None, tags=None, uris=None, user_pool_config=None, xray_enabled=None)

Get an existing GraphQLApi resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • additional_authentication_providers (pulumi.Input[list]) – One or more additional authentication providers for the GraphqlApi. Defined below.

  • arn (pulumi.Input[str]) – The ARN

  • authentication_type (pulumi.Input[str]) – The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

  • log_config (pulumi.Input[dict]) – Nested argument containing logging configuration. Defined below.

  • name (pulumi.Input[str]) – A user-supplied name for the GraphqlApi.

  • openid_connect_config (pulumi.Input[dict]) – Nested argument containing OpenID Connect configuration. Defined below.

  • schema (pulumi.Input[str]) – The schema definition, in GraphQL schema language format. This provider cannot perform drift detection of this configuration.

  • tags (pulumi.Input[dict]) – A map of tags to assign to the resource.

  • uris (pulumi.Input[dict]) – Map of URIs associated with the API. e.g. uris["GRAPHQL"] = https://ID.appsync-api.REGION.amazonaws.com/graphql

  • user_pool_config (pulumi.Input[dict]) – The Amazon Cognito User Pool configuration. Defined below.

  • xray_enabled (pulumi.Input[bool]) – Whether tracing with X-ray is enabled. Defaults to false.

The additional_authentication_providers object supports the following:

  • authentication_type (pulumi.Input[str]) - The authentication type. Valid values: API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT

  • openid_connect_config (pulumi.Input[dict]) - Nested argument containing OpenID Connect configuration. Defined below.

    • authTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being authenticated.

    • client_id (pulumi.Input[str]) - 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.

    • iatTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being issued to a user.

    • issuer (pulumi.Input[str]) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

  • user_pool_config (pulumi.Input[dict]) - The Amazon Cognito User Pool configuration. Defined below.

    • appIdClientRegex (pulumi.Input[str]) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

    • awsRegion (pulumi.Input[str]) - The AWS region in which the user pool was created.

    • user_pool_id (pulumi.Input[str]) - The user pool ID.

The log_config object supports the following:

  • cloudwatchLogsRoleArn (pulumi.Input[str]) - Amazon Resource Name of the service role that AWS AppSync will assume to publish to Amazon CloudWatch logs in your account.

  • excludeVerboseContent (pulumi.Input[bool]) - Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level. Valid values: true, false. Default value: false

  • fieldLogLevel (pulumi.Input[str]) - Field logging level. Valid values: ALL, ERROR, NONE.

The openid_connect_config object supports the following:

  • authTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being authenticated.

  • client_id (pulumi.Input[str]) - 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.

  • iatTtl (pulumi.Input[float]) - Number of milliseconds a token is valid after being issued to a user.

  • issuer (pulumi.Input[str]) - Issuer for the OpenID Connect configuration. The issuer returned by discovery MUST exactly match the value of iss in the ID Token.

The user_pool_config object supports the following:

  • appIdClientRegex (pulumi.Input[str]) - A regular expression for validating the incoming Amazon Cognito User Pool app client ID.

  • awsRegion (pulumi.Input[str]) - The AWS region in which the user pool was created.

  • default_action (pulumi.Input[str]) - The action that you want your GraphQL API to take when a request that uses Amazon Cognito User Pool authentication doesn’t match the Amazon Cognito User Pool configuration. Valid: ALLOW and DENY

  • user_pool_id (pulumi.Input[str]) - The user pool ID.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.appsync.Resolver(resource_name, opts=None, api_id=None, caching_config=None, data_source=None, field=None, kind=None, pipeline_config=None, request_template=None, response_template=None, type=None, __props__=None, __name__=None, __opts__=None)

Provides an AppSync Resolver.

import pulumi
import pulumi_aws as aws

test_graph_ql_api = aws.appsync.GraphQLApi("testGraphQLApi",
    authentication_type="API_KEY",
    schema="""type Mutation {
        putPost(id: ID!, title: String!): Post
}

type Post {
        id: ID!
        title: String!
}

type Query {
        singlePost(id: ID!): Post
}

schema {
        query: Query
        mutation: Mutation
}

""")
test_data_source = aws.appsync.DataSource("testDataSource",
    api_id=test_graph_ql_api.id,
    http_config={
        "endpoint": "http://example.com",
    },
    type="HTTP")
# UNIT type resolver (default)
test_resolver = aws.appsync.Resolver("testResolver",
    api_id=test_graph_ql_api.id,
    caching_config={
        "cachingKeys": [
            "$context.identity.sub",
            "$context.arguments.id",
        ],
        "ttl": 60,
    },
    data_source=test_data_source.name,
    field="singlePost",
    request_template="""{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}

""",
    response_template="""#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end

""",
    type="Query")
# PIPELINE type resolver
mutation_pipeline_test = aws.appsync.Resolver("mutationPipelineTest",
    api_id=test_graph_ql_api.id,
    field="pipelineTest",
    kind="PIPELINE",
    pipeline_config={
        "functions": [
            aws_appsync_function["test1"]["function_id"],
            aws_appsync_function["test2"]["function_id"],
            aws_appsync_function["test3"]["function_id"],
        ],
    },
    request_template="{}",
    response_template="$util.toJson($ctx.result)",
    type="Mutation")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The API ID for the GraphQL API.

  • caching_config (pulumi.Input[dict]) – The CachingConfig.

  • data_source (pulumi.Input[str]) – The DataSource name.

  • field (pulumi.Input[str]) – The field name from the schema defined in the GraphQL API.

  • kind (pulumi.Input[str]) – The resolver type. Valid values are UNIT and PIPELINE.

  • pipeline_config (pulumi.Input[dict]) – The PipelineConfig.

  • request_template (pulumi.Input[str]) – The request mapping template for UNIT resolver or ‘before mapping template’ for PIPELINE resolver.

  • response_template (pulumi.Input[str]) – The response mapping template for UNIT resolver or ‘after mapping template’ for PIPELINE resolver.

  • type (pulumi.Input[str]) – The type name from the schema defined in the GraphQL API.

The caching_config object supports the following:

  • cachingKeys (pulumi.Input[list]) - The list of caching key.

  • ttl (pulumi.Input[float]) - The TTL in seconds.

The pipeline_config object supports the following:

  • functions (pulumi.Input[list]) - The list of Function ID.

api_id: pulumi.Output[str] = None

The API ID for the GraphQL API.

arn: pulumi.Output[str] = None

The ARN

caching_config: pulumi.Output[dict] = None

The CachingConfig.

  • cachingKeys (list) - The list of caching key.

  • ttl (float) - The TTL in seconds.

data_source: pulumi.Output[str] = None

The DataSource name.

field: pulumi.Output[str] = None

The field name from the schema defined in the GraphQL API.

kind: pulumi.Output[str] = None

The resolver type. Valid values are UNIT and PIPELINE.

pipeline_config: pulumi.Output[dict] = None

The PipelineConfig.

  • functions (list) - The list of Function ID.

request_template: pulumi.Output[str] = None

The request mapping template for UNIT resolver or ‘before mapping template’ for PIPELINE resolver.

response_template: pulumi.Output[str] = None

The response mapping template for UNIT resolver or ‘after mapping template’ for PIPELINE resolver.

type: pulumi.Output[str] = None

The type name from the schema defined in the GraphQL API.

static get(resource_name, id, opts=None, api_id=None, arn=None, caching_config=None, data_source=None, field=None, kind=None, pipeline_config=None, request_template=None, response_template=None, type=None)

Get an existing Resolver resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • api_id (pulumi.Input[str]) – The API ID for the GraphQL API.

  • arn (pulumi.Input[str]) – The ARN

  • caching_config (pulumi.Input[dict]) – The CachingConfig.

  • data_source (pulumi.Input[str]) – The DataSource name.

  • field (pulumi.Input[str]) – The field name from the schema defined in the GraphQL API.

  • kind (pulumi.Input[str]) – The resolver type. Valid values are UNIT and PIPELINE.

  • pipeline_config (pulumi.Input[dict]) – The PipelineConfig.

  • request_template (pulumi.Input[str]) – The request mapping template for UNIT resolver or ‘before mapping template’ for PIPELINE resolver.

  • response_template (pulumi.Input[str]) – The response mapping template for UNIT resolver or ‘after mapping template’ for PIPELINE resolver.

  • type (pulumi.Input[str]) – The type name from the schema defined in the GraphQL API.

The caching_config object supports the following:

  • cachingKeys (pulumi.Input[list]) - The list of caching key.

  • ttl (pulumi.Input[float]) - The TTL in seconds.

The pipeline_config object supports the following:

  • functions (pulumi.Input[list]) - The list of Function ID.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str