awsappsync

package
v1.168.0-devpreview Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

README

AWS AppSync Construct Library

The @aws-cdk/aws-appsync package contains constructs for building flexible APIs that use GraphQL.

import appsync "github.com/aws/aws-cdk-go/awscdk"

Example

DynamoDB

Example of a GraphQL API with AWS_IAM authorization resolving into a DynamoDb backend data source.

GraphQL schema file schema.graphql:

type demo {
  id: String!
  version: String!
}
type Query {
  getDemos: [ demo! ]
}
input DemoInput {
  version: String!
}
type Mutation {
  addDemo(input: DemoInput!): demo
}

CDK stack file app-stack.ts:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})
Aurora Serverless

AppSync provides a data source for executing SQL commands against Amazon Aurora Serverless clusters. You can use AppSync resolvers to execute SQL statements against the Data API with GraphQL queries, mutations, and subscriptions.

// Build a data source for AppSync to access the database.
var api graphqlApi
// Create username and password secret for DB Cluster
secret := rds.NewDatabaseSecret(this, jsii.String("AuroraSecret"), &databaseSecretProps{
	username: jsii.String("clusteradmin"),
})

// The VPC to place the cluster in
vpc := ec2.NewVpc(this, jsii.String("AuroraVpc"))

// Create the serverless cluster, provide all values needed to customise the database.
cluster := rds.NewServerlessCluster(this, jsii.String("AuroraCluster"), &serverlessClusterProps{
	engine: rds.databaseClusterEngine_AURORA_MYSQL(),
	vpc: vpc,
	credentials: map[string]*string{
		"username": jsii.String("clusteradmin"),
	},
	clusterIdentifier: jsii.String("db-endpoint-test"),
	defaultDatabaseName: jsii.String("demos"),
})
rdsDS := api.addRdsDataSource(jsii.String("rds"), cluster, secret, jsii.String("demos"))

// Set up a resolver for an RDS query.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemosRds"),
	requestMappingTemplate: appsync.mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"SELECT * FROM demos\"\n    ]\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])\n  ")),
})

// Set up a resolver for an RDS mutation.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemoRds"),
	requestMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"INSERT INTO demos VALUES (:id, :version)\",\n      \"SELECT * WHERE id = :id\"\n    ],\n    \"variableMap\": {\n      \":id\": $util.toJson($util.autoId()),\n      \":version\": $util.toJson($ctx.args.version)\n    }\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])\n  ")),
})
HTTP Endpoints

GraphQL schema file schema.graphql:

type job {
  id: String!
  version: String!
}

input DemoInput {
  version: String!
}

type Mutation {
  callStepFunction(input: DemoInput!): job
}

GraphQL request mapping template request.vtl:

{
  "version": "2018-05-29",
  "method": "POST",
  "resourcePath": "/",
  "params": {
    "headers": {
      "content-type": "application/x-amz-json-1.0",
      "x-amz-target":"AWSStepFunctions.StartExecution"
    },
    "body": {
      "stateMachineArn": "<your step functions arn>",
      "input": "{ \"id\": \"$context.arguments.id\" }"
    }
  }
}

GraphQL response mapping template response.vtl:

{
  "id": "${context.result.id}"
}

CDK stack file app-stack.ts:

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
})

httpDs := api.addHttpDataSource(jsii.String("ds"), jsii.String("https://states.amazonaws.com"), &httpDataSourceOptions{
	name: jsii.String("httpDsWithStepF"),
	description: jsii.String("from appsync to StepFunctions Workflow"),
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("us-east-1"),
		signingServiceName: jsii.String("states"),
	},
})

httpDs.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("callStepFunction"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})
Amazon OpenSearch Service

AppSync has builtin support for Amazon OpenSearch Service (successor to Amazon Elasticsearch Service) from domains that are provisioned through your AWS account. You can use AppSync resolvers to perform GraphQL operations such as queries, mutations, and subscriptions.

import opensearch "github.com/aws/aws-cdk-go/awscdk"

var api graphqlApi


user := iam.NewUser(this, jsii.String("User"))
domain := opensearch.NewDomain(this, jsii.String("Domain"), &domainProps{
	version: opensearch.engineVersion_OPENSEARCH_1_2(),
	removalPolicy: awscdk.RemovalPolicy_DESTROY,
	fineGrainedAccessControl: &advancedSecurityOptions{
		masterUserArn: user.userArn,
	},
	encryptionAtRest: &encryptionAtRestOptions{
		enabled: jsii.Boolean(true),
	},
	nodeToNodeEncryption: jsii.Boolean(true),
	enforceHttps: jsii.Boolean(true),
})
ds := api.addOpenSearchDataSource(jsii.String("ds"), domain)

ds.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getTests"),
	requestMappingTemplate: appsync.mappingTemplate.fromString(jSON.stringify(map[string]interface{}{
		"version": jsii.String("2017-02-28"),
		"operation": jsii.String("GET"),
		"path": jsii.String("/id/post/_search"),
		"params": map[string]map[string]interface{}{
			"headers": map[string]interface{}{
			},
			"queryString": map[string]interface{}{
			},
			"body": map[string]*f64{
				"from": jsii.Number(0),
				"size": jsii.Number(50),
			},
		},
	})),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("[\n    #foreach($entry in $context.result.hits.hits)\n    #if( $velocityCount > 1 ) , #end\n    $utils.toJson($entry.get(\"_source\"))\n    #end\n  ]")),
})

Custom Domain Names

For many use cases you may want to associate a custom domain name with your GraphQL API. This can be done during the API creation.

import acm "github.com/aws/aws-cdk-go/awscdk"
import route53 "github.com/aws/aws-cdk-go/awscdk"

// hosted zone and route53 features
var hostedZoneId string
zoneName := "example.com"


myDomainName := "api.example.com"
certificate := acm.NewCertificate(this, jsii.String("cert"), &certificateProps{
	domainName: myDomainName,
})
api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("myApi"),
	domainName: &domainOptions{
		certificate: certificate,
		domainName: myDomainName,
	},
})

// hosted zone for adding appsync domain
zone := route53.hostedZone.fromHostedZoneAttributes(this, jsii.String("HostedZone"), &hostedZoneAttributes{
	hostedZoneId: jsii.String(hostedZoneId),
	zoneName: jsii.String(zoneName),
})

// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
route53.NewCnameRecord(this, jsii.String("CnameApiRecord"), &cnameRecordProps{
	recordName: jsii.String("api"),
	zone: zone,
	domainName: myDomainName,
})

Schema

Every GraphQL Api needs a schema to define the Api. CDK offers appsync.Schema for static convenience methods for various types of schema declaration: code-first or schema-first.

Code-First

When declaring your GraphQL Api, CDK defaults to a code-first approach if the schema property is not configured.

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("myApi"),
})

CDK will declare a Schema class that will give your Api access functions to define your schema code-first: addType, addToSchema, etc.

You can also declare your Schema class outside of your CDK stack, to define your schema externally.

schema := appsync.NewSchema()
schema.addType(appsync.NewObjectType(jsii.String("demo"), &objectTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.id(),
	},
}))
api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("myApi"),
	schema: schema,
})

See the code-first schema section for more details.

Schema-First

You can define your GraphQL Schema from a file on disk. For convenience, use the appsync.Schema.fromAsset to specify the file representing your schema.

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("myApi"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphl"))),
})

Imports

Any GraphQL Api that has been created outside the stack can be imported from another stack into your CDK app. Utilizing the fromXxx function, you have the ability to add data sources and resolvers through a IGraphqlApi interface.

var api graphqlApi
var table table

importedApi := appsync.graphqlApi.fromGraphqlApiAttributes(this, jsii.String("IApi"), &graphqlApiAttributes{
	graphqlApiId: api.apiId,
	graphqlApiArn: api.arn,
})
importedApi.addDynamoDbDataSource(jsii.String("TableDataSource"), table)

If you don't specify graphqlArn in fromXxxAttributes, CDK will autogenerate the expected arn for the imported api, given the apiId. For creating data sources and resolvers, an apiId is sufficient.

Authorization

There are multiple authorization types available for GraphQL API to cater to different access use cases. They are:

  • API Keys (AuthorizationType.API_KEY)
  • Amazon Cognito User Pools (AuthorizationType.USER_POOL)
  • OpenID Connect (AuthorizationType.OPENID_CONNECT)
  • AWS Identity and Access Management (AuthorizationType.AWS_IAM)
  • AWS Lambda (AuthorizationType.AWS_LAMBDA)

These types can be used simultaneously in a single API, allowing different types of clients to access data. When you specify an authorization type, you can also specify the corresponding authorization mode to finish defining your authorization. For example, this is a GraphQL API with AWS Lambda Authorization.

import lambda "github.com/aws/aws-cdk-go/awscdk"
var authFunction function


appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("appsync.test.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_LAMBDA,
			lambdaAuthorizerConfig: &lambdaAuthorizerConfig{
				handler: authFunction,
			},
		},
	},
})

Permissions

When using AWS_IAM as the authorization type for GraphQL API, an IAM Role with correct permissions must be used for access to API.

When configuring permissions, you can specify specific resources to only be accessible by IAM authorization. For example, if you want to only allow mutability for IAM authorized access you would configure the following.

In schema.graphql:

type Mutation {
  updateExample(...): ...
    @aws_iam
}

In IAM:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "appsync:GraphQL"
      ],
      "Resource": [
        "arn:aws:appsync:REGION:ACCOUNT_ID:apis/GRAPHQL_ID/types/Mutation/fields/updateExample"
      ]
    }
  ]
}

See documentation for more details.

To make this easier, CDK provides grant API.

Use the grant function for more granular authorization.

var api graphqlApi
role := iam.NewRole(this, jsii.String("Role"), &roleProps{
	assumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})

api.grant(role, appsync.iamResource.custom(jsii.String("types/Mutation/fields/updateExample")), jsii.String("appsync:GraphQL"))
IamResource

In order to use the grant functions, you need to use the class IamResource.

  • IamResource.custom(...arns) permits custom ARNs and requires an argument.
  • IamResouce.ofType(type, ...fields) permits ARNs for types and their fields.
  • IamResource.all() permits ALL resources.
Generic Permissions

Alternatively, you can use more generic grant functions to accomplish the same usage.

These include:

  • grantMutation (use to grant access to Mutation fields)
  • grantQuery (use to grant access to Query fields)
  • grantSubscription (use to grant access to Subscription fields)
var api graphqlApi
var role role


// For generic types
api.grantMutation(role, jsii.String("updateExample"))

// For custom types and granular design
api.grant(role, appsync.iamResource.ofType(jsii.String("Mutation"), jsii.String("updateExample")), jsii.String("appsync:GraphQL"))

Pipeline Resolvers and AppSync Functions

AppSync Functions are local functions that perform certain operations onto a backend data source. Developers can compose operations (Functions) and execute them in sequence with Pipeline Resolvers.

var api graphqlApi


appsyncFunction := appsync.NewAppsyncFunction(this, jsii.String("function"), &appsyncFunctionProps{
	name: jsii.String("appsync_function"),
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

AppSync Functions are used in tandem with pipeline resolvers to compose multiple operations.

var api graphqlApi
var appsyncFunction appsyncFunction


pipelineResolver := appsync.NewResolver(this, jsii.String("pipeline"), &resolverProps{
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	typeName: jsii.String("typeName"),
	fieldName: jsii.String("fieldName"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("beforeRequest.vtl")),
	pipelineConfig: []iAppsyncFunction{
		appsyncFunction,
	},
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("afterResponse.vtl")),
})

Learn more about Pipeline Resolvers and AppSync Functions here.

Code-First Schema

CDK offers the ability to generate your schema in a code-first approach. A code-first approach offers a developer workflow with:

  • modularity: organizing schema type definitions into different files
  • reusability: simplifying down boilerplate/repetitive code
  • consistency: resolvers and schema definition will always be synced

The code-first approach allows for dynamic schema generation. You can generate your schema based on variables and templates to reduce code duplication.

Code-First Example

To showcase the code-first approach. Let's try to model the following schema segment.

interface Node {
  id: String
}

type Query {
  allFilms(after: String, first: Int, before: String, last: Int): FilmConnection
}

type FilmNode implements Node {
  filmName: String
}

type FilmConnection {
  edges: [FilmEdge]
  films: [Film]
  totalCount: Int
}

type FilmEdge {
  node: Film
  cursor: String
}

Above we see a schema that allows for generating paginated responses. For example, we can query allFilms(first: 100) since FilmConnection acts as an intermediary for holding FilmEdges we can write a resolver to return the first 100 films.

In a separate file, we can declare our object types and related functions. We will call this file object-types.ts and we will have created it in a way that allows us to generate other XxxConnection and XxxEdges in the future.

import appsync "github.com/aws/aws-cdk-go/awscdk"
pluralize := require(jsii.String("pluralize"))

args := map[string]graphqlType{
	"after": appsync.graphqlType.string(),
	"first": appsync.graphqlType.int(),
	"before": appsync.graphqlType.string(),
	"last": appsync.graphqlType.int(),
}

node := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"id": appsync.*graphqlType.string(),
	},
})
filmNode := appsync.NewObjectType(jsii.String("FilmNode"), &objectTypeOptions{
	interfaceTypes: []interfaceType{
		*node,
	},
	definition: map[string]*iField{
		"filmName": appsync.*graphqlType.string(),
	},
})

func GenerateEdgeAndConnection(base *objectType) map[string]objectType {
	edge := appsync.NewObjectType(fmt.Sprintf("%vEdge", *base.name), &objectTypeOptions{
		definition: map[string]*iField{
			"node": base.attribute(),
			"cursor": appsync.*graphqlType.string(),
		},
	})
	connection := appsync.NewObjectType(fmt.Sprintf("%vConnection", *base.name), &objectTypeOptions{
		definition: map[string]*iField{
			"edges": edge.attribute(&BaseTypeOptions{
				"isList": jsii.Boolean(true),
			}),
			pluralize(base.name): base.attribute(&BaseTypeOptions{
				"isList": jsii.Boolean(true),
			}),
			"totalCount": appsync.*graphqlType.int(),
		},
	})
	return map[string]objectType{
		"edge": edge,
		"connection": connection,
	}
}

Finally, we will go to our cdk-stack and combine everything together to generate our schema.

var dummyRequest mappingTemplate
var dummyResponse mappingTemplate


api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
})

objectTypes := []interfaceType{
	node,
	filmNode,
}

filmConnections := generateEdgeAndConnection(filmNode)

api.addQuery(jsii.String("allFilms"), appsync.NewResolvableField(&resolvableFieldOptions{
	returnType: filmConnections.connection.attribute(),
	args: args,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: dummyRequest,
	responseMappingTemplate: dummyResponse,
}))

api.addType(node)
api.addType(filmNode)
api.addType(filmConnections.edge)
api.addType(filmConnections.connection)

Notice how we can utilize the generateEdgeAndConnection function to generate Object Types. In the future, if we wanted to create more Object Types, we can simply create the base Object Type (i.e. Film) and from there we can generate its respective Connections and Edges.

Check out a more in-depth example here.

GraphQL Types

One of the benefits of GraphQL is its strongly typed nature. We define the types within an object, query, mutation, interface, etc. as GraphQL Types.

GraphQL Types are the building blocks of types, whether they are scalar, objects, interfaces, etc. GraphQL Types can be:

  • Scalar Types: Id, Int, String, AWSDate, etc.
  • Object Types: types that you generate (i.e. demo from the example above)
  • Interface Types: abstract types that define the base implementation of other Intermediate Types

More concretely, GraphQL Types are simply the types appended to variables. Referencing the object type Demo in the previous example, the GraphQL Types is String! and is applied to both the names id and version.

Directives

Directives are attached to a field or type and affect the execution of queries, mutations, and types. With AppSync, we use Directives to configure authorization. CDK provides static functions to add directives to your Schema.

  • Directive.iam() sets a type or field's authorization to be validated through Iam

  • Directive.apiKey() sets a type or field's authorization to be validated through a Api Key

  • Directive.oidc() sets a type or field's authorization to be validated through OpenID Connect

  • Directive.cognito(...groups: string[]) sets a type or field's authorization to be validated through Cognito User Pools

    • groups the name of the cognito groups to give access

To learn more about authorization and directives, read these docs here.

Field and Resolvable Fields

While GraphqlType is a base implementation for GraphQL fields, we have abstractions on top of GraphqlType that provide finer grain support.

Field

Field extends GraphqlType and will allow you to define arguments. Interface Types are not resolvable and this class will allow you to define arguments, but not its resolvers.

For example, if we want to create the following type:

type Node {
  test(argument: string): String
}

The CDK code required would be:

field := appsync.NewField(&fieldOptions{
	returnType: appsync.graphqlType.string(),
	args: map[string]*graphqlType{
		"argument": appsync.*graphqlType.string(),
	},
})
type := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"test": field,
	},
})
Resolvable Fields

ResolvableField extends Field and will allow you to define arguments and its resolvers. Object Types can have fields that resolve and perform operations on your backend.

You can also create resolvable fields for object types.

type Info {
  node(id: String): String
}

The CDK code required would be:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

To nest resolvers, we can also create top level query types that call upon other types. Building off the previous example, if we want the following graphql type definition:

type Query {
  get(argument: string): Info
}

The CDK code required would be:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

query := appsync.NewObjectType(jsii.String("Query"), &objectTypeOptions{
	definition: map[string]iField{
		"get": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"argument": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Learn more about fields and resolvers here.

Intermediate Types

Intermediate Types are defined by Graphql Types and Fields. They have a set of defined fields, where each field corresponds to another type in the system. Intermediate Types will be the meat of your GraphQL Schema as they are the types defined by you.

Intermediate Types include:

Interface Types

Interface Types are abstract types that define the implementation of other intermediate types. They are useful for eliminating duplication and can be used to generate Object Types with less work.

You can create Interface Types externally.

node := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

To learn more about Interface Types, read the docs here.

Object Types

Object Types are types that you declare. For example, in the code-first example the demo variable is an Object Type. Object Types are defined by GraphQL Types and are only usable when linked to a GraphQL Api.

You can create Object Types in two ways:

  1. Object Types can be created externally.

    api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
    	name: jsii.String("demo"),
    })
    demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
    	definition: map[string]iField{
    		"id": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    		"version": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    	},
    })
    
    api.addType(demo)
    

    This method allows for reusability and modularity, ideal for larger projects. For example, imagine moving all Object Type definition outside the stack.

    object-types.ts - a file for object type definitions

    import appsync "github.com/aws/aws-cdk-go/awscdk"
    demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
    	definition: map[string]iField{
    		"id": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    		"version": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    	},
    })
    

    cdk-stack.ts - a file containing our cdk stack

    var api graphqlApi
    
    api.addType(demo)
    
  2. Object Types can be created externally from an Interface Type.

    node := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
    	definition: map[string]iField{
    		"id": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    	},
    })
    demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
    	interfaceTypes: []interfaceType{
    		node,
    	},
    	definition: map[string]*iField{
    		"version": appsync.GraphqlType.string(&BaseTypeOptions{
    			"isRequired": jsii.Boolean(true),
    		}),
    	},
    })
    

    This method allows for reusability and modularity, ideal for reducing code duplication.

To learn more about Object Types, read the docs here.

Enum Types

Enum Types are a special type of Intermediate Type. They restrict a particular set of allowed values for other Intermediate Types.

enum Episode {
  NEWHOPE
  EMPIRE
  JEDI
}

This means that wherever we use the type Episode in our schema, we expect it to be exactly one of NEWHOPE, EMPIRE, or JEDI.

The above GraphQL Enumeration Type can be expressed in CDK as the following:

var api graphqlApi

episode := appsync.NewEnumType(jsii.String("Episode"), &enumTypeOptions{
	definition: []*string{
		jsii.String("NEWHOPE"),
		jsii.String("EMPIRE"),
		jsii.String("JEDI"),
	},
})
api.addType(episode)

To learn more about Enum Types, read the docs here.

Input Types

Input Types are special types of Intermediate Types. They give users an easy way to pass complex objects for top level Mutation and Queries.

input Review {
  stars: Int!
  commentary: String
}

The above GraphQL Input Type can be expressed in CDK as the following:

var api graphqlApi

review := appsync.NewInputType(jsii.String("Review"), &intermediateTypeOptions{
	definition: map[string]iField{
		"stars": appsync.GraphqlType.int(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
		"commentary": appsync.GraphqlType.string(),
	},
})
api.addType(review)

To learn more about Input Types, read the docs here.

Union Types

Union Types are a special type of Intermediate Type. They are similar to Interface Types, but they cannot specify any common fields between types.

Note: the fields of a union type need to be Object Types. In other words, you can't create a union type out of interfaces, other unions, or inputs.

union Search = Human | Droid | Starship

The above GraphQL Union Type encompasses the Object Types of Human, Droid and Starship. It can be expressed in CDK as the following:

var api graphqlApi

string := appsync.graphqlType.string()
human := appsync.NewObjectType(jsii.String("Human"), &objectTypeOptions{
	definition: map[string]iField{
		"name": string,
	},
})
droid := appsync.NewObjectType(jsii.String("Droid"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
starship := appsync.NewObjectType(jsii.String("Starship"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
search := appsync.NewUnionType(jsii.String("Search"), &unionTypeOptions{
	definition: []iIntermediateType{
		human,
		droid,
		starship,
	},
})
api.addType(search)

To learn more about Union Types, read the docs here.

Query

Every schema requires a top level Query type. By default, the schema will look for the Object Type named Query. The top level Query is the only exposed type that users can access to perform GET operations on your Api.

To add fields for these queries, we can simply run the addQuery function to add to the schema's Query type.

var api graphqlApi
var filmConnection interfaceType
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate


string := appsync.graphqlType.string()
int := appsync.graphqlType.int()
api.addQuery(jsii.String("allFilms"), appsync.NewResolvableField(&resolvableFieldOptions{
	returnType: filmConnection.attribute(),
	args: map[string]*graphqlType{
		"after": string,
		"first": int,
		"before": string,
		"last": int,
	},
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: dummyRequest,
	responseMappingTemplate: dummyResponse,
}))

To learn more about top level operations, check out the docs here.

Mutation

Every schema can have a top level Mutation type. By default, the schema will look for the ObjectType named Mutation. The top level Mutation Type is the only exposed type that users can access to perform mutable operations on your Api.

To add fields for these mutations, we can simply run the addMutation function to add to the schema's Mutation type.

var api graphqlApi
var filmNode objectType
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate


string := appsync.graphqlType.string()
int := appsync.graphqlType.int()
api.addMutation(jsii.String("addFilm"), appsync.NewResolvableField(&resolvableFieldOptions{
	returnType: filmNode.attribute(),
	args: map[string]*graphqlType{
		"name": string,
		"film_number": int,
	},
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: dummyRequest,
	responseMappingTemplate: dummyResponse,
}))

To learn more about top level operations, check out the docs here.

Subscription

Every schema can have a top level Subscription type. The top level Subscription Type is the only exposed type that users can access to invoke a response to a mutation. Subscriptions notify users when a mutation specific mutation is called. This means you can make any data source real time by specify a GraphQL Schema directive on a mutation.

Note: The AWS AppSync client SDK automatically handles subscription connection management.

To add fields for these subscriptions, we can simply run the addSubscription function to add to the schema's Subscription type.

var api graphqlApi
var film interfaceType


api.addSubscription(jsii.String("addedFilm"), appsync.NewField(&fieldOptions{
	returnType: film.attribute(),
	args: map[string]graphqlType{
		"id": appsync.*graphqlType.id(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
	directives: []directive{
		appsync.*directive.subscribe(jsii.String("addFilm")),
	},
}))

To learn more about top level operations, check out the docs here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppsyncFunction_IsConstruct

func AppsyncFunction_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func AppsyncFunction_IsResource

func AppsyncFunction_IsResource(construct awscdk.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func BackedDataSource_IsConstruct

func BackedDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func BaseDataSource_IsConstruct

func BaseDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnApiCache_CFN_RESOURCE_TYPE_NAME

func CfnApiCache_CFN_RESOURCE_TYPE_NAME() *string

func CfnApiCache_IsCfnElement

func CfnApiCache_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnApiCache_IsCfnResource

func CfnApiCache_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnApiCache_IsConstruct

func CfnApiCache_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnApiKey_CFN_RESOURCE_TYPE_NAME

func CfnApiKey_CFN_RESOURCE_TYPE_NAME() *string

func CfnApiKey_IsCfnElement

func CfnApiKey_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnApiKey_IsCfnResource

func CfnApiKey_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnApiKey_IsConstruct

func CfnApiKey_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnDataSource_CFN_RESOURCE_TYPE_NAME

func CfnDataSource_CFN_RESOURCE_TYPE_NAME() *string

func CfnDataSource_IsCfnElement

func CfnDataSource_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnDataSource_IsCfnResource

func CfnDataSource_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnDataSource_IsConstruct

func CfnDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnDomainNameApiAssociation_CFN_RESOURCE_TYPE_NAME

func CfnDomainNameApiAssociation_CFN_RESOURCE_TYPE_NAME() *string

func CfnDomainNameApiAssociation_IsCfnElement

func CfnDomainNameApiAssociation_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnDomainNameApiAssociation_IsCfnResource

func CfnDomainNameApiAssociation_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnDomainNameApiAssociation_IsConstruct

func CfnDomainNameApiAssociation_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnDomainName_CFN_RESOURCE_TYPE_NAME

func CfnDomainName_CFN_RESOURCE_TYPE_NAME() *string

func CfnDomainName_IsCfnElement

func CfnDomainName_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnDomainName_IsCfnResource

func CfnDomainName_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnDomainName_IsConstruct

func CfnDomainName_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnFunctionConfiguration_CFN_RESOURCE_TYPE_NAME

func CfnFunctionConfiguration_CFN_RESOURCE_TYPE_NAME() *string

func CfnFunctionConfiguration_IsCfnElement

func CfnFunctionConfiguration_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnFunctionConfiguration_IsCfnResource

func CfnFunctionConfiguration_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnFunctionConfiguration_IsConstruct

func CfnFunctionConfiguration_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnGraphQLApi_CFN_RESOURCE_TYPE_NAME

func CfnGraphQLApi_CFN_RESOURCE_TYPE_NAME() *string

func CfnGraphQLApi_IsCfnElement

func CfnGraphQLApi_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnGraphQLApi_IsCfnResource

func CfnGraphQLApi_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnGraphQLApi_IsConstruct

func CfnGraphQLApi_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnGraphQLSchema_CFN_RESOURCE_TYPE_NAME

func CfnGraphQLSchema_CFN_RESOURCE_TYPE_NAME() *string

func CfnGraphQLSchema_IsCfnElement

func CfnGraphQLSchema_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnGraphQLSchema_IsCfnResource

func CfnGraphQLSchema_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnGraphQLSchema_IsConstruct

func CfnGraphQLSchema_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func CfnResolver_CFN_RESOURCE_TYPE_NAME

func CfnResolver_CFN_RESOURCE_TYPE_NAME() *string

func CfnResolver_IsCfnElement

func CfnResolver_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element. Experimental.

func CfnResolver_IsCfnResource

func CfnResolver_IsCfnResource(construct constructs.IConstruct) *bool

Check whether the given construct is a CfnResource. Experimental.

func CfnResolver_IsConstruct

func CfnResolver_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func DynamoDbDataSource_IsConstruct

func DynamoDbDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func ElasticsearchDataSource_IsConstruct

func ElasticsearchDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Deprecated: - use `OpenSearchDataSource`.

func GraphqlApiBase_IsConstruct

func GraphqlApiBase_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func GraphqlApiBase_IsResource

func GraphqlApiBase_IsResource(construct awscdk.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func GraphqlApi_IsConstruct

func GraphqlApi_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func GraphqlApi_IsResource

func GraphqlApi_IsResource(construct awscdk.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpDataSource_IsConstruct

func HttpDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func LambdaDataSource_IsConstruct

func LambdaDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func NewAppsyncFunction_Override

func NewAppsyncFunction_Override(a AppsyncFunction, scope constructs.Construct, id *string, props *AppsyncFunctionProps)

Experimental.

func NewAssign_Override

func NewAssign_Override(a Assign, attr *string, arg *string)

Experimental.

func NewAttributeValuesStep_Override

func NewAttributeValuesStep_Override(a AttributeValuesStep, attr *string, container *string, assignments *[]Assign)

Experimental.

func NewAttributeValues_Override

func NewAttributeValues_Override(a AttributeValues, container *string, assignments *[]Assign)

Experimental.

func NewBackedDataSource_Override

func NewBackedDataSource_Override(b BackedDataSource, scope constructs.Construct, id *string, props *BackedDataSourceProps, extended *ExtendedDataSourceProps)

Experimental.

func NewBaseDataSource_Override

func NewBaseDataSource_Override(b BaseDataSource, scope constructs.Construct, id *string, props *BackedDataSourceProps, extended *ExtendedDataSourceProps)

Experimental.

func NewCfnApiCache_Override

func NewCfnApiCache_Override(c CfnApiCache, scope awscdk.Construct, id *string, props *CfnApiCacheProps)

Create a new `AWS::AppSync::ApiCache`.

func NewCfnApiKey_Override

func NewCfnApiKey_Override(c CfnApiKey, scope awscdk.Construct, id *string, props *CfnApiKeyProps)

Create a new `AWS::AppSync::ApiKey`.

func NewCfnDataSource_Override

func NewCfnDataSource_Override(c CfnDataSource, scope awscdk.Construct, id *string, props *CfnDataSourceProps)

Create a new `AWS::AppSync::DataSource`.

func NewCfnDomainNameApiAssociation_Override

func NewCfnDomainNameApiAssociation_Override(c CfnDomainNameApiAssociation, scope awscdk.Construct, id *string, props *CfnDomainNameApiAssociationProps)

Create a new `AWS::AppSync::DomainNameApiAssociation`.

func NewCfnDomainName_Override

func NewCfnDomainName_Override(c CfnDomainName, scope awscdk.Construct, id *string, props *CfnDomainNameProps)

Create a new `AWS::AppSync::DomainName`.

func NewCfnFunctionConfiguration_Override

func NewCfnFunctionConfiguration_Override(c CfnFunctionConfiguration, scope awscdk.Construct, id *string, props *CfnFunctionConfigurationProps)

Create a new `AWS::AppSync::FunctionConfiguration`.

func NewCfnGraphQLApi_Override

func NewCfnGraphQLApi_Override(c CfnGraphQLApi, scope awscdk.Construct, id *string, props *CfnGraphQLApiProps)

Create a new `AWS::AppSync::GraphQLApi`.

func NewCfnGraphQLSchema_Override

func NewCfnGraphQLSchema_Override(c CfnGraphQLSchema, scope awscdk.Construct, id *string, props *CfnGraphQLSchemaProps)

Create a new `AWS::AppSync::GraphQLSchema`.

func NewCfnResolver_Override

func NewCfnResolver_Override(c CfnResolver, scope awscdk.Construct, id *string, props *CfnResolverProps)

Create a new `AWS::AppSync::Resolver`.

func NewDynamoDbDataSource_Override

func NewDynamoDbDataSource_Override(d DynamoDbDataSource, scope constructs.Construct, id *string, props *DynamoDbDataSourceProps)

Experimental.

func NewElasticsearchDataSource_Override deprecated

func NewElasticsearchDataSource_Override(e ElasticsearchDataSource, scope constructs.Construct, id *string, props *ElasticsearchDataSourceProps)

Deprecated: - use `OpenSearchDataSource`.

func NewEnumType_Override

func NewEnumType_Override(e EnumType, name *string, options *EnumTypeOptions)

Experimental.

func NewField_Override

func NewField_Override(f Field, options *FieldOptions)

Experimental.

func NewGraphqlApiBase_Override

func NewGraphqlApiBase_Override(g GraphqlApiBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewGraphqlApi_Override

func NewGraphqlApi_Override(g GraphqlApi, scope constructs.Construct, id *string, props *GraphqlApiProps)

Experimental.

func NewGraphqlType_Override

func NewGraphqlType_Override(g GraphqlType, type_ Type, options *GraphqlTypeOptions)

Experimental.

func NewHttpDataSource_Override

func NewHttpDataSource_Override(h HttpDataSource, scope constructs.Construct, id *string, props *HttpDataSourceProps)

Experimental.

func NewInputType_Override

func NewInputType_Override(i InputType, name *string, props *IntermediateTypeOptions)

Experimental.

func NewInterfaceType_Override

func NewInterfaceType_Override(i InterfaceType, name *string, props *IntermediateTypeOptions)

Experimental.

func NewLambdaDataSource_Override

func NewLambdaDataSource_Override(l LambdaDataSource, scope constructs.Construct, id *string, props *LambdaDataSourceProps)

Experimental.

func NewMappingTemplate_Override

func NewMappingTemplate_Override(m MappingTemplate)

Experimental.

func NewNoneDataSource_Override

func NewNoneDataSource_Override(n NoneDataSource, scope constructs.Construct, id *string, props *NoneDataSourceProps)

Experimental.

func NewObjectType_Override

func NewObjectType_Override(o ObjectType, name *string, props *ObjectTypeOptions)

Experimental.

func NewOpenSearchDataSource_Override

func NewOpenSearchDataSource_Override(o OpenSearchDataSource, scope constructs.Construct, id *string, props *OpenSearchDataSourceProps)

Experimental.

func NewPartitionKeyStep_Override

func NewPartitionKeyStep_Override(p PartitionKeyStep, key *string)

Experimental.

func NewPartitionKey_Override

func NewPartitionKey_Override(p PartitionKey, pkey Assign)

Experimental.

func NewPrimaryKey_Override

func NewPrimaryKey_Override(p PrimaryKey, pkey Assign, skey Assign)

Experimental.

func NewRdsDataSource_Override

func NewRdsDataSource_Override(r RdsDataSource, scope constructs.Construct, id *string, props *RdsDataSourceProps)

Experimental.

func NewResolvableField_Override

func NewResolvableField_Override(r ResolvableField, options *ResolvableFieldOptions)

Experimental.

func NewResolver_Override

func NewResolver_Override(r Resolver, scope constructs.Construct, id *string, props *ResolverProps)

Experimental.

func NewSchema_Override

func NewSchema_Override(s Schema, options *SchemaOptions)

Experimental.

func NewSortKeyStep_Override

func NewSortKeyStep_Override(s SortKeyStep, pkey Assign, skey *string)

Experimental.

func NewUnionType_Override

func NewUnionType_Override(u UnionType, name *string, options *UnionTypeOptions)

Experimental.

func NewValues_Override

func NewValues_Override(v Values)

Experimental.

func NoneDataSource_IsConstruct

func NoneDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func OpenSearchDataSource_IsConstruct

func OpenSearchDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func RdsDataSource_IsConstruct

func RdsDataSource_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

func Resolver_IsConstruct

func Resolver_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct. Experimental.

Types

type AddFieldOptions

type AddFieldOptions struct {
	// The resolvable field to add.
	//
	// This option must be configured for Object, Interface,
	// Input and Union Types.
	// Experimental.
	Field IField `field:"optional" json:"field" yaml:"field"`
	// The name of the field.
	//
	// This option must be configured for Object, Interface,
	// Input and Enum Types.
	// Experimental.
	FieldName *string `field:"optional" json:"fieldName" yaml:"fieldName"`
}

The options to add a field to an Intermediate Type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var field field

addFieldOptions := &addFieldOptions{
	field: field,
	fieldName: jsii.String("fieldName"),
}

Experimental.

type ApiKeyConfig

type ApiKeyConfig struct {
	// Description of API key.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The time from creation time after which the API key expires.
	//
	// It must be a minimum of 1 day and a maximum of 365 days from date of creation.
	// Rounded down to the nearest hour.
	// Experimental.
	Expires awscdk.Expiration `field:"optional" json:"expires" yaml:"expires"`
	// Unique name of the API Key.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Configuration for API Key authorization in AppSync.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import monocdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var expiration expiration

apiKeyConfig := &apiKeyConfig{
	description: jsii.String("description"),
	expires: expiration,
	name: jsii.String("name"),
}

Experimental.

type AppsyncFunction

type AppsyncFunction interface {
	awscdk.Resource
	IAppsyncFunction
	// the data source of this AppSync Function.
	// Experimental.
	DataSource() BaseDataSource
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// the ARN of the AppSync function.
	// Experimental.
	FunctionArn() *string
	// the ID of the AppSync function.
	// Experimental.
	FunctionId() *string
	// the name of this AppSync Function.
	// Experimental.
	FunctionName() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

AppSync Functions are local functions that perform certain operations onto a backend data source.

Developers can compose operations (Functions) and execute them in sequence with Pipeline Resolvers.

Example:

var api graphqlApi

appsyncFunction := appsync.NewAppsyncFunction(this, jsii.String("function"), &appsyncFunctionProps{
	name: jsii.String("appsync_function"),
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

func NewAppsyncFunction

func NewAppsyncFunction(scope constructs.Construct, id *string, props *AppsyncFunctionProps) AppsyncFunction

Experimental.

type AppsyncFunctionAttributes

type AppsyncFunctionAttributes struct {
	// the ARN of the AppSync function.
	// Experimental.
	FunctionArn *string `field:"required" json:"functionArn" yaml:"functionArn"`
}

The attributes for imported AppSync Functions.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

appsyncFunctionAttributes := &appsyncFunctionAttributes{
	functionArn: jsii.String("functionArn"),
}

Experimental.

type AppsyncFunctionProps

type AppsyncFunctionProps struct {
	// the name of the AppSync Function.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// the description for this AppSync Function.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// the request mapping template for the AppSync Function.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// the response mapping template for the AppSync Function.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
	// the GraphQL Api linked to this AppSync Function.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the data source linked to this AppSync Function.
	// Experimental.
	DataSource BaseDataSource `field:"required" json:"dataSource" yaml:"dataSource"`
}

the CDK properties for AppSync Functions.

Example:

var api graphqlApi

appsyncFunction := appsync.NewAppsyncFunction(this, jsii.String("function"), &appsyncFunctionProps{
	name: jsii.String("appsync_function"),
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

type Assign

type Assign interface {
	// Renders the assignment as a map element.
	// Experimental.
	PutInMap(map_ *string) *string
	// Renders the assignment as a VTL string.
	// Experimental.
	RenderAsAssignment() *string
}

Utility class representing the assigment of a value to an attribute.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

assign := awscdk.Aws_appsync.NewAssign(jsii.String("attr"), jsii.String("arg"))

Experimental.

func NewAssign

func NewAssign(attr *string, arg *string) Assign

Experimental.

type AttributeValues

type AttributeValues interface {
	// Allows assigning a value to the specified attribute.
	// Experimental.
	Attribute(attr *string) AttributeValuesStep
	// Renders the attribute value assingments to a VTL string.
	// Experimental.
	RenderTemplate() *string
	// Renders the variables required for `renderTemplate`.
	// Experimental.
	RenderVariables() *string
}

Specifies the attribute value assignments.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

func NewAttributeValues

func NewAttributeValues(container *string, assignments *[]Assign) AttributeValues

Experimental.

func Values_Projecting

func Values_Projecting(arg *string) AttributeValues

Treats the specified object as a map of assignments, where the property names represent attribute names.

It’s opinionated about how it represents some of the nested objects: e.g., it will use lists (“L”) rather than sets (“SS”, “NS”, “BS”). By default it projects the argument container ("$ctx.args"). Experimental.

type AttributeValuesStep

type AttributeValuesStep interface {
	// Assign the value to the current attribute.
	// Experimental.
	Is(val *string) AttributeValues
}

Utility class to allow assigning a value to an attribute.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign assign

attributeValuesStep := awscdk.Aws_appsync.NewAttributeValuesStep(jsii.String("attr"), jsii.String("container"), []assign{
	assign,
})

Experimental.

func NewAttributeValuesStep

func NewAttributeValuesStep(attr *string, container *string, assignments *[]Assign) AttributeValuesStep

Experimental.

func Values_Attribute

func Values_Attribute(attr *string) AttributeValuesStep

Allows assigning a value to the specified attribute. Experimental.

type AuthorizationConfig

type AuthorizationConfig struct {
	// Additional authorization modes.
	// Experimental.
	AdditionalAuthorizationModes *[]*AuthorizationMode `field:"optional" json:"additionalAuthorizationModes" yaml:"additionalAuthorizationModes"`
	// Optional authorization configuration.
	// Experimental.
	DefaultAuthorization *AuthorizationMode `field:"optional" json:"defaultAuthorization" yaml:"defaultAuthorization"`
}

Configuration of the API authorization modes.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

type AuthorizationMode

type AuthorizationMode struct {
	// One of possible four values AppSync supports.
	// See: https://docs.aws.amazon.com/appsync/latest/devguide/security.html
	//
	// Experimental.
	AuthorizationType AuthorizationType `field:"required" json:"authorizationType" yaml:"authorizationType"`
	// If authorizationType is `AuthorizationType.API_KEY`, this option can be configured.
	// Experimental.
	ApiKeyConfig *ApiKeyConfig `field:"optional" json:"apiKeyConfig" yaml:"apiKeyConfig"`
	// If authorizationType is `AuthorizationType.LAMBDA`, this option is required.
	// Experimental.
	LambdaAuthorizerConfig *LambdaAuthorizerConfig `field:"optional" json:"lambdaAuthorizerConfig" yaml:"lambdaAuthorizerConfig"`
	// If authorizationType is `AuthorizationType.OIDC`, this option is required.
	// Experimental.
	OpenIdConnectConfig *OpenIdConnectConfig `field:"optional" json:"openIdConnectConfig" yaml:"openIdConnectConfig"`
	// If authorizationType is `AuthorizationType.USER_POOL`, this option is required.
	// Experimental.
	UserPoolConfig *UserPoolConfig `field:"optional" json:"userPoolConfig" yaml:"userPoolConfig"`
}

Interface to specify default or additional authorization(s).

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

type AuthorizationType

type AuthorizationType string

enum with all possible values for AppSync authorization type.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

const (
	// API Key authorization type.
	// Experimental.
	AuthorizationType_API_KEY AuthorizationType = "API_KEY"
	// AWS IAM authorization type.
	//
	// Can be used with Cognito Identity Pool federated credentials.
	// Experimental.
	AuthorizationType_IAM AuthorizationType = "IAM"
	// Cognito User Pool authorization type.
	// Experimental.
	AuthorizationType_USER_POOL AuthorizationType = "USER_POOL"
	// OpenID Connect authorization type.
	// Experimental.
	AuthorizationType_OIDC AuthorizationType = "OIDC"
	// Lambda authorization type.
	// Experimental.
	AuthorizationType_LAMBDA AuthorizationType = "LAMBDA"
)

type AwsIamConfig

type AwsIamConfig struct {
	// The signing region for AWS IAM authorization.
	// Experimental.
	SigningRegion *string `field:"required" json:"signingRegion" yaml:"signingRegion"`
	// The signing service name for AWS IAM authorization.
	// Experimental.
	SigningServiceName *string `field:"required" json:"signingServiceName" yaml:"signingServiceName"`
}

The authorization config in case the HTTP endpoint requires authorization.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
})

httpDs := api.addHttpDataSource(jsii.String("ds"), jsii.String("https://states.amazonaws.com"), &httpDataSourceOptions{
	name: jsii.String("httpDsWithStepF"),
	description: jsii.String("from appsync to StepFunctions Workflow"),
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("us-east-1"),
		signingServiceName: jsii.String("states"),
	},
})

httpDs.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("callStepFunction"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

type BackedDataSource

type BackedDataSource interface {
	BaseDataSource
	awsiam.IGrantable
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

Abstract AppSync datasource implementation.

Do not use directly but use subclasses for resource backed datasources. Experimental.

type BackedDataSourceProps

type BackedDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Experimental.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
}

properties for an AppSync datasource backed by a resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi
var role role

backedDataSourceProps := &backedDataSourceProps{
	api: graphqlApi,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
}

Experimental.

type BaseAppsyncFunctionProps

type BaseAppsyncFunctionProps struct {
	// the name of the AppSync Function.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// the description for this AppSync Function.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// the request mapping template for the AppSync Function.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// the response mapping template for the AppSync Function.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
}

the base properties for AppSync Functions.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var mappingTemplate mappingTemplate

baseAppsyncFunctionProps := &baseAppsyncFunctionProps{
	name: jsii.String("name"),

	// the properties below are optional
	description: jsii.String("description"),
	requestMappingTemplate: mappingTemplate,
	responseMappingTemplate: mappingTemplate,
}

Experimental.

type BaseDataSource

type BaseDataSource interface {
	awscdk.Construct
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

Abstract AppSync datasource implementation.

Do not use directly but use subclasses for concrete datasources.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

type BaseDataSourceProps

type BaseDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Base properties for an AppSync datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi

baseDataSourceProps := &baseDataSourceProps{
	api: graphqlApi,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
}

Experimental.

type BaseResolverProps

type BaseResolverProps struct {
	// name of the GraphQL field in the given type this resolver is attached to.
	// Experimental.
	FieldName *string `field:"required" json:"fieldName" yaml:"fieldName"`
	// name of the GraphQL type this resolver is attached to.
	// Experimental.
	TypeName *string `field:"required" json:"typeName" yaml:"typeName"`
	// The caching configuration for this resolver.
	// Experimental.
	CachingConfig *CachingConfig `field:"optional" json:"cachingConfig" yaml:"cachingConfig"`
	// configuration of the pipeline resolver.
	// Experimental.
	PipelineConfig *[]IAppsyncFunction `field:"optional" json:"pipelineConfig" yaml:"pipelineConfig"`
	// The request mapping template for this resolver.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// The response mapping template for this resolver.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
}

Basic properties for an AppSync resolver.

Example:

// Build a data source for AppSync to access the database.
var api graphqlApi
// Create username and password secret for DB Cluster
secret := rds.NewDatabaseSecret(this, jsii.String("AuroraSecret"), &databaseSecretProps{
	username: jsii.String("clusteradmin"),
})

// The VPC to place the cluster in
vpc := ec2.NewVpc(this, jsii.String("AuroraVpc"))

// Create the serverless cluster, provide all values needed to customise the database.
cluster := rds.NewServerlessCluster(this, jsii.String("AuroraCluster"), &serverlessClusterProps{
	engine: rds.databaseClusterEngine_AURORA_MYSQL(),
	vpc: vpc,
	credentials: map[string]*string{
		"username": jsii.String("clusteradmin"),
	},
	clusterIdentifier: jsii.String("db-endpoint-test"),
	defaultDatabaseName: jsii.String("demos"),
})
rdsDS := api.addRdsDataSource(jsii.String("rds"), cluster, secret, jsii.String("demos"))

// Set up a resolver for an RDS query.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemosRds"),
	requestMappingTemplate: appsync.mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"SELECT * FROM demos\"\n    ]\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])\n  ")),
})

// Set up a resolver for an RDS mutation.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemoRds"),
	requestMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"INSERT INTO demos VALUES (:id, :version)\",\n      \"SELECT * WHERE id = :id\"\n    ],\n    \"variableMap\": {\n      \":id\": $util.toJson($util.autoId()),\n      \":version\": $util.toJson($ctx.args.version)\n    }\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])\n  ")),
})

Experimental.

type BaseTypeOptions

type BaseTypeOptions struct {
	// property determining if this attribute is a list i.e. if true, attribute would be [Type].
	// Experimental.
	IsList *bool `field:"optional" json:"isList" yaml:"isList"`
	// property determining if this attribute is non-nullable i.e. if true, attribute would be Type!
	// Experimental.
	IsRequired *bool `field:"optional" json:"isRequired" yaml:"isRequired"`
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be [ Type ]! or if isRequired true, attribe would be [ Type! ]!
	// Experimental.
	IsRequiredList *bool `field:"optional" json:"isRequiredList" yaml:"isRequiredList"`
}

Base options for GraphQL Types.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
})
demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
		"version": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

api.addType(demo)

Experimental.

type CachingConfig

type CachingConfig struct {
	// The TTL in seconds for a resolver that has caching enabled.
	//
	// Valid values are between 1 and 3600 seconds.
	// Experimental.
	Ttl awscdk.Duration `field:"required" json:"ttl" yaml:"ttl"`
	// The caching keys for a resolver that has caching enabled.
	//
	// Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.
	// Experimental.
	CachingKeys *[]*string `field:"optional" json:"cachingKeys" yaml:"cachingKeys"`
}

CachingConfig for AppSync resolvers.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import monocdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var duration duration

cachingConfig := &cachingConfig{
	ttl: duration,

	// the properties below are optional
	cachingKeys: []*string{
		jsii.String("cachingKeys"),
	},
}

Experimental.

type CfnApiCache

type CfnApiCache interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// Caching behavior.
	//
	// - *FULL_REQUEST_CACHING* : All requests are fully cached.
	// - *PER_RESOLVER_CACHING* : Individual resolvers that you specify are cached.
	ApiCachingBehavior() *string
	SetApiCachingBehavior(val *string)
	// The GraphQL API ID.
	ApiId() *string
	SetApiId(val *string)
	// At-rest encryption flag for cache.
	//
	// You cannot update this setting after creation.
	AtRestEncryptionEnabled() interface{}
	SetAtRestEncryptionEnabled(val interface{})
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Transit encryption flag when connecting to cache.
	//
	// You cannot update this setting after creation.
	TransitEncryptionEnabled() interface{}
	SetTransitEncryptionEnabled(val interface{})
	// TTL in seconds for cache entries.
	//
	// Valid values are 1–3,600 seconds.
	Ttl() *float64
	SetTtl(val *float64)
	// The cache instance type. Valid values are.
	//
	// - `SMALL`
	// - `MEDIUM`
	// - `LARGE`
	// - `XLARGE`
	// - `LARGE_2X`
	// - `LARGE_4X`
	// - `LARGE_8X` (not available in all regions)
	// - `LARGE_12X`
	//
	// Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
	//
	// The following legacy instance types are available, but their use is discouraged:
	//
	// - *T2_SMALL* : A t2.small instance type.
	// - *T2_MEDIUM* : A t2.medium instance type.
	// - *R4_LARGE* : A r4.large instance type.
	// - *R4_XLARGE* : A r4.xlarge instance type.
	// - *R4_2XLARGE* : A r4.2xlarge instance type.
	// - *R4_4XLARGE* : A r4.4xlarge instance type.
	// - *R4_8XLARGE* : A r4.8xlarge instance type.
	Type() *string
	SetType(val *string)
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::ApiCache`.

The `AWS::AppSync::ApiCache` resource represents the input of a `CreateApiCache` operation.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiCache := awscdk.Aws_appsync.NewCfnApiCache(this, jsii.String("MyCfnApiCache"), &cfnApiCacheProps{
	apiCachingBehavior: jsii.String("apiCachingBehavior"),
	apiId: jsii.String("apiId"),
	ttl: jsii.Number(123),
	type: jsii.String("type"),

	// the properties below are optional
	atRestEncryptionEnabled: jsii.Boolean(false),
	transitEncryptionEnabled: jsii.Boolean(false),
})

func NewCfnApiCache

func NewCfnApiCache(scope awscdk.Construct, id *string, props *CfnApiCacheProps) CfnApiCache

Create a new `AWS::AppSync::ApiCache`.

type CfnApiCacheProps

type CfnApiCacheProps struct {
	// Caching behavior.
	//
	// - *FULL_REQUEST_CACHING* : All requests are fully cached.
	// - *PER_RESOLVER_CACHING* : Individual resolvers that you specify are cached.
	ApiCachingBehavior *string `field:"required" json:"apiCachingBehavior" yaml:"apiCachingBehavior"`
	// The GraphQL API ID.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// TTL in seconds for cache entries.
	//
	// Valid values are 1–3,600 seconds.
	Ttl *float64 `field:"required" json:"ttl" yaml:"ttl"`
	// The cache instance type. Valid values are.
	//
	// - `SMALL`
	// - `MEDIUM`
	// - `LARGE`
	// - `XLARGE`
	// - `LARGE_2X`
	// - `LARGE_4X`
	// - `LARGE_8X` (not available in all regions)
	// - `LARGE_12X`
	//
	// Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.
	//
	// The following legacy instance types are available, but their use is discouraged:
	//
	// - *T2_SMALL* : A t2.small instance type.
	// - *T2_MEDIUM* : A t2.medium instance type.
	// - *R4_LARGE* : A r4.large instance type.
	// - *R4_XLARGE* : A r4.xlarge instance type.
	// - *R4_2XLARGE* : A r4.2xlarge instance type.
	// - *R4_4XLARGE* : A r4.4xlarge instance type.
	// - *R4_8XLARGE* : A r4.8xlarge instance type.
	Type *string `field:"required" json:"type" yaml:"type"`
	// At-rest encryption flag for cache.
	//
	// You cannot update this setting after creation.
	AtRestEncryptionEnabled interface{} `field:"optional" json:"atRestEncryptionEnabled" yaml:"atRestEncryptionEnabled"`
	// Transit encryption flag when connecting to cache.
	//
	// You cannot update this setting after creation.
	TransitEncryptionEnabled interface{} `field:"optional" json:"transitEncryptionEnabled" yaml:"transitEncryptionEnabled"`
}

Properties for defining a `CfnApiCache`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiCacheProps := &cfnApiCacheProps{
	apiCachingBehavior: jsii.String("apiCachingBehavior"),
	apiId: jsii.String("apiId"),
	ttl: jsii.Number(123),
	type: jsii.String("type"),

	// the properties below are optional
	atRestEncryptionEnabled: jsii.Boolean(false),
	transitEncryptionEnabled: jsii.Boolean(false),
}

type CfnApiKey

type CfnApiKey interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// Unique AWS AppSync GraphQL API ID for this API key.
	ApiId() *string
	SetApiId(val *string)
	// The API key ID.
	ApiKeyId() *string
	SetApiKeyId(val *string)
	// The API key.
	AttrApiKey() *string
	// The Amazon Resource Name (ARN) of the API key, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/apikey/apikeya1bzhi` .
	AttrArn() *string
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// Unique description of your API key.
	Description() *string
	SetDescription(val *string)
	// The time after which the API key expires.
	//
	// The date is represented as seconds since the epoch, rounded down to the nearest hour.
	Expires() *float64
	SetExpires(val *float64)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::ApiKey`.

The `AWS::AppSync::ApiKey` resource creates a unique key that you can distribute to clients who are executing GraphQL operations with AWS AppSync that require an API key.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiKey := awscdk.Aws_appsync.NewCfnApiKey(this, jsii.String("MyCfnApiKey"), &cfnApiKeyProps{
	apiId: jsii.String("apiId"),

	// the properties below are optional
	apiKeyId: jsii.String("apiKeyId"),
	description: jsii.String("description"),
	expires: jsii.Number(123),
})

func NewCfnApiKey

func NewCfnApiKey(scope awscdk.Construct, id *string, props *CfnApiKeyProps) CfnApiKey

Create a new `AWS::AppSync::ApiKey`.

type CfnApiKeyProps

type CfnApiKeyProps struct {
	// Unique AWS AppSync GraphQL API ID for this API key.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// The API key ID.
	ApiKeyId *string `field:"optional" json:"apiKeyId" yaml:"apiKeyId"`
	// Unique description of your API key.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The time after which the API key expires.
	//
	// The date is represented as seconds since the epoch, rounded down to the nearest hour.
	Expires *float64 `field:"optional" json:"expires" yaml:"expires"`
}

Properties for defining a `CfnApiKey`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiKeyProps := &cfnApiKeyProps{
	apiId: jsii.String("apiId"),

	// the properties below are optional
	apiKeyId: jsii.String("apiKeyId"),
	description: jsii.String("description"),
	expires: jsii.Number(123),
}

type CfnDataSource

type CfnDataSource interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// Unique AWS AppSync GraphQL API identifier where this data source will be created.
	ApiId() *string
	SetApiId(val *string)
	// The Amazon Resource Name (ARN) of the API key, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename` .
	AttrDataSourceArn() *string
	// Friendly name for you to identify your AWS AppSync data source after creation.
	AttrName() *string
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The description of the data source.
	Description() *string
	SetDescription(val *string)
	// AWS Region and TableName for an Amazon DynamoDB table in your account.
	DynamoDbConfig() interface{}
	SetDynamoDbConfig(val interface{})
	// AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
	//
	// As of September 2021, Amazon Elasticsearch Service is Amazon OpenSearch Service . This property is deprecated. For new data sources, use *OpenSearchServiceConfig* to specify an OpenSearch Service data source.
	ElasticsearchConfig() interface{}
	SetElasticsearchConfig(val interface{})
	// Endpoints for an HTTP data source.
	HttpConfig() interface{}
	SetHttpConfig(val interface{})
	// An ARN of a Lambda function in valid ARN format.
	//
	// This can be the ARN of a Lambda function that exists in the current account or in another account.
	LambdaConfig() interface{}
	SetLambdaConfig(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// Friendly name for you to identify your AppSync data source after creation.
	Name() *string
	SetName(val *string)
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
	OpenSearchServiceConfig() interface{}
	SetOpenSearchServiceConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// Relational Database configuration of the relational database data source.
	RelationalDatabaseConfig() interface{}
	SetRelationalDatabaseConfig(val interface{})
	// The AWS Identity and Access Management service role ARN for the data source.
	//
	// The system assumes this role when accessing the data source.
	//
	// Required if `Type` is specified as `AWS_LAMBDA` , `AMAZON_DYNAMODB` , `AMAZON_ELASTICSEARCH` , or `AMAZON_OPENSEARCH_SERVICE` .
	ServiceRoleArn() *string
	SetServiceRoleArn(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// The type of the data source.
	//
	// - *AWS_LAMBDA* : The data source is an AWS Lambda function.
	// - *AMAZON_DYNAMODB* : The data source is an Amazon DynamoDB table.
	// - *AMAZON_ELASTICSEARCH* : The data source is an Amazon OpenSearch Service domain.
	// - *AMAZON_OPENSEARCH_SERVICE* : The data source is an Amazon OpenSearch Service domain.
	// - *NONE* : There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.
	// - *HTTP* : The data source is an HTTP endpoint.
	// - *RELATIONAL_DATABASE* : The data source is a relational database.
	Type() *string
	SetType(val *string)
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::DataSource`.

The `AWS::AppSync::DataSource` resource creates data sources for resolvers in AWS AppSync to connect to, such as Amazon DynamoDB , AWS Lambda , and Amazon OpenSearch Service . Resolvers use these data sources to fetch data when clients make GraphQL calls.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDataSource := awscdk.Aws_appsync.NewCfnDataSource(this, jsii.String("MyCfnDataSource"), &cfnDataSourceProps{
	apiId: jsii.String("apiId"),
	name: jsii.String("name"),
	type: jsii.String("type"),

	// the properties below are optional
	description: jsii.String("description"),
	dynamoDbConfig: &dynamoDBConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		tableName: jsii.String("tableName"),

		// the properties below are optional
		deltaSyncConfig: &deltaSyncConfigProperty{
			baseTableTtl: jsii.String("baseTableTtl"),
			deltaSyncTableName: jsii.String("deltaSyncTableName"),
			deltaSyncTableTtl: jsii.String("deltaSyncTableTtl"),
		},
		useCallerCredentials: jsii.Boolean(false),
		versioned: jsii.Boolean(false),
	},
	elasticsearchConfig: &elasticsearchConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	httpConfig: &httpConfigProperty{
		endpoint: jsii.String("endpoint"),

		// the properties below are optional
		authorizationConfig: &authorizationConfigProperty{
			authorizationType: jsii.String("authorizationType"),

			// the properties below are optional
			awsIamConfig: &awsIamConfigProperty{
				signingRegion: jsii.String("signingRegion"),
				signingServiceName: jsii.String("signingServiceName"),
			},
		},
	},
	lambdaConfig: &lambdaConfigProperty{
		lambdaFunctionArn: jsii.String("lambdaFunctionArn"),
	},
	openSearchServiceConfig: &openSearchServiceConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	relationalDatabaseConfig: &relationalDatabaseConfigProperty{
		relationalDatabaseSourceType: jsii.String("relationalDatabaseSourceType"),

		// the properties below are optional
		rdsHttpEndpointConfig: &rdsHttpEndpointConfigProperty{
			awsRegion: jsii.String("awsRegion"),
			awsSecretStoreArn: jsii.String("awsSecretStoreArn"),
			dbClusterIdentifier: jsii.String("dbClusterIdentifier"),

			// the properties below are optional
			databaseName: jsii.String("databaseName"),
			schema: jsii.String("schema"),
		},
	},
	serviceRoleArn: jsii.String("serviceRoleArn"),
})

func NewCfnDataSource

func NewCfnDataSource(scope awscdk.Construct, id *string, props *CfnDataSourceProps) CfnDataSource

Create a new `AWS::AppSync::DataSource`.

type CfnDataSourceProps

type CfnDataSourceProps struct {
	// Unique AWS AppSync GraphQL API identifier where this data source will be created.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// Friendly name for you to identify your AppSync data source after creation.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The type of the data source.
	//
	// - *AWS_LAMBDA* : The data source is an AWS Lambda function.
	// - *AMAZON_DYNAMODB* : The data source is an Amazon DynamoDB table.
	// - *AMAZON_ELASTICSEARCH* : The data source is an Amazon OpenSearch Service domain.
	// - *AMAZON_OPENSEARCH_SERVICE* : The data source is an Amazon OpenSearch Service domain.
	// - *NONE* : There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.
	// - *HTTP* : The data source is an HTTP endpoint.
	// - *RELATIONAL_DATABASE* : The data source is a relational database.
	Type *string `field:"required" json:"type" yaml:"type"`
	// The description of the data source.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// AWS Region and TableName for an Amazon DynamoDB table in your account.
	DynamoDbConfig interface{} `field:"optional" json:"dynamoDbConfig" yaml:"dynamoDbConfig"`
	// AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
	//
	// As of September 2021, Amazon Elasticsearch Service is Amazon OpenSearch Service . This property is deprecated. For new data sources, use *OpenSearchServiceConfig* to specify an OpenSearch Service data source.
	ElasticsearchConfig interface{} `field:"optional" json:"elasticsearchConfig" yaml:"elasticsearchConfig"`
	// Endpoints for an HTTP data source.
	HttpConfig interface{} `field:"optional" json:"httpConfig" yaml:"httpConfig"`
	// An ARN of a Lambda function in valid ARN format.
	//
	// This can be the ARN of a Lambda function that exists in the current account or in another account.
	LambdaConfig interface{} `field:"optional" json:"lambdaConfig" yaml:"lambdaConfig"`
	// AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
	OpenSearchServiceConfig interface{} `field:"optional" json:"openSearchServiceConfig" yaml:"openSearchServiceConfig"`
	// Relational Database configuration of the relational database data source.
	RelationalDatabaseConfig interface{} `field:"optional" json:"relationalDatabaseConfig" yaml:"relationalDatabaseConfig"`
	// The AWS Identity and Access Management service role ARN for the data source.
	//
	// The system assumes this role when accessing the data source.
	//
	// Required if `Type` is specified as `AWS_LAMBDA` , `AMAZON_DYNAMODB` , `AMAZON_ELASTICSEARCH` , or `AMAZON_OPENSEARCH_SERVICE` .
	ServiceRoleArn *string `field:"optional" json:"serviceRoleArn" yaml:"serviceRoleArn"`
}

Properties for defining a `CfnDataSource`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDataSourceProps := &cfnDataSourceProps{
	apiId: jsii.String("apiId"),
	name: jsii.String("name"),
	type: jsii.String("type"),

	// the properties below are optional
	description: jsii.String("description"),
	dynamoDbConfig: &dynamoDBConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		tableName: jsii.String("tableName"),

		// the properties below are optional
		deltaSyncConfig: &deltaSyncConfigProperty{
			baseTableTtl: jsii.String("baseTableTtl"),
			deltaSyncTableName: jsii.String("deltaSyncTableName"),
			deltaSyncTableTtl: jsii.String("deltaSyncTableTtl"),
		},
		useCallerCredentials: jsii.Boolean(false),
		versioned: jsii.Boolean(false),
	},
	elasticsearchConfig: &elasticsearchConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	httpConfig: &httpConfigProperty{
		endpoint: jsii.String("endpoint"),

		// the properties below are optional
		authorizationConfig: &authorizationConfigProperty{
			authorizationType: jsii.String("authorizationType"),

			// the properties below are optional
			awsIamConfig: &awsIamConfigProperty{
				signingRegion: jsii.String("signingRegion"),
				signingServiceName: jsii.String("signingServiceName"),
			},
		},
	},
	lambdaConfig: &lambdaConfigProperty{
		lambdaFunctionArn: jsii.String("lambdaFunctionArn"),
	},
	openSearchServiceConfig: &openSearchServiceConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	relationalDatabaseConfig: &relationalDatabaseConfigProperty{
		relationalDatabaseSourceType: jsii.String("relationalDatabaseSourceType"),

		// the properties below are optional
		rdsHttpEndpointConfig: &rdsHttpEndpointConfigProperty{
			awsRegion: jsii.String("awsRegion"),
			awsSecretStoreArn: jsii.String("awsSecretStoreArn"),
			dbClusterIdentifier: jsii.String("dbClusterIdentifier"),

			// the properties below are optional
			databaseName: jsii.String("databaseName"),
			schema: jsii.String("schema"),
		},
	},
	serviceRoleArn: jsii.String("serviceRoleArn"),
}

type CfnDataSource_AuthorizationConfigProperty

type CfnDataSource_AuthorizationConfigProperty struct {
	// The authorization type that the HTTP endpoint requires.
	//
	// - *AWS_IAM* : The authorization type is Signature Version 4 (SigV4).
	AuthorizationType *string `field:"required" json:"authorizationType" yaml:"authorizationType"`
	// The AWS Identity and Access Management settings.
	AwsIamConfig interface{} `field:"optional" json:"awsIamConfig" yaml:"awsIamConfig"`
}

The `AuthorizationConfig` property type specifies the authorization type and configuration for an AWS AppSync http data source.

`AuthorizationConfig` is a property of the [AWS AppSync DataSource HttpConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-httpconfig.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

authorizationConfigProperty := &authorizationConfigProperty{
	authorizationType: jsii.String("authorizationType"),

	// the properties below are optional
	awsIamConfig: &awsIamConfigProperty{
		signingRegion: jsii.String("signingRegion"),
		signingServiceName: jsii.String("signingServiceName"),
	},
}

type CfnDataSource_AwsIamConfigProperty

type CfnDataSource_AwsIamConfigProperty struct {
	// The signing Region for AWS Identity and Access Management authorization.
	SigningRegion *string `field:"optional" json:"signingRegion" yaml:"signingRegion"`
	// The signing service name for AWS Identity and Access Management authorization.
	SigningServiceName *string `field:"optional" json:"signingServiceName" yaml:"signingServiceName"`
}

Use the `AwsIamConfig` property type to specify `AwsIamConfig` for a AWS AppSync authorizaton.

`AwsIamConfig` is a property of the [AWS AppSync DataSource AuthorizationConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-httpconfig-authorizationconfig.html) resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

awsIamConfigProperty := &awsIamConfigProperty{
	signingRegion: jsii.String("signingRegion"),
	signingServiceName: jsii.String("signingServiceName"),
}

type CfnDataSource_DeltaSyncConfigProperty

type CfnDataSource_DeltaSyncConfigProperty struct {
	// The number of minutes that an Item is stored in the data source.
	BaseTableTtl *string `field:"required" json:"baseTableTtl" yaml:"baseTableTtl"`
	// The Delta Sync table name.
	DeltaSyncTableName *string `field:"required" json:"deltaSyncTableName" yaml:"deltaSyncTableName"`
	// The number of minutes that a Delta Sync log entry is stored in the Delta Sync table.
	DeltaSyncTableTtl *string `field:"required" json:"deltaSyncTableTtl" yaml:"deltaSyncTableTtl"`
}

Describes a Delta Sync configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

deltaSyncConfigProperty := &deltaSyncConfigProperty{
	baseTableTtl: jsii.String("baseTableTtl"),
	deltaSyncTableName: jsii.String("deltaSyncTableName"),
	deltaSyncTableTtl: jsii.String("deltaSyncTableTtl"),
}

type CfnDataSource_DynamoDBConfigProperty

type CfnDataSource_DynamoDBConfigProperty struct {
	// The AWS Region.
	AwsRegion *string `field:"required" json:"awsRegion" yaml:"awsRegion"`
	// The table name.
	TableName *string `field:"required" json:"tableName" yaml:"tableName"`
	// The `DeltaSyncConfig` for a versioned datasource.
	DeltaSyncConfig interface{} `field:"optional" json:"deltaSyncConfig" yaml:"deltaSyncConfig"`
	// Set to `TRUE` to use AWS Identity and Access Management with this data source.
	UseCallerCredentials interface{} `field:"optional" json:"useCallerCredentials" yaml:"useCallerCredentials"`
	// Set to TRUE to use Conflict Detection and Resolution with this data source.
	Versioned interface{} `field:"optional" json:"versioned" yaml:"versioned"`
}

The `DynamoDBConfig` property type specifies the `AwsRegion` and `TableName` for an Amazon DynamoDB table in your account for an AWS AppSync data source.

`DynamoDBConfig` is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dynamoDBConfigProperty := &dynamoDBConfigProperty{
	awsRegion: jsii.String("awsRegion"),
	tableName: jsii.String("tableName"),

	// the properties below are optional
	deltaSyncConfig: &deltaSyncConfigProperty{
		baseTableTtl: jsii.String("baseTableTtl"),
		deltaSyncTableName: jsii.String("deltaSyncTableName"),
		deltaSyncTableTtl: jsii.String("deltaSyncTableTtl"),
	},
	useCallerCredentials: jsii.Boolean(false),
	versioned: jsii.Boolean(false),
}

type CfnDataSource_ElasticsearchConfigProperty

type CfnDataSource_ElasticsearchConfigProperty struct {
	// The AWS Region.
	AwsRegion *string `field:"required" json:"awsRegion" yaml:"awsRegion"`
	// The endpoint.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
}

The `ElasticsearchConfig` property type specifies the `AwsRegion` and `Endpoints` for an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.

ElasticsearchConfig is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) property type.

As of September 2021, Amazon Elasticsearch Service is Amazon OpenSearch Service . This property is deprecated. For new data sources, use *OpenSearchServiceConfig* to specify an OpenSearch Service data source.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

elasticsearchConfigProperty := &elasticsearchConfigProperty{
	awsRegion: jsii.String("awsRegion"),
	endpoint: jsii.String("endpoint"),
}

type CfnDataSource_HttpConfigProperty

type CfnDataSource_HttpConfigProperty struct {
	// The endpoint.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The authorization configuration.
	AuthorizationConfig interface{} `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"`
}

Use the `HttpConfig` property type to specify `HttpConfig` for an AWS AppSync data source.

`HttpConfig` is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

httpConfigProperty := &httpConfigProperty{
	endpoint: jsii.String("endpoint"),

	// the properties below are optional
	authorizationConfig: &authorizationConfigProperty{
		authorizationType: jsii.String("authorizationType"),

		// the properties below are optional
		awsIamConfig: &awsIamConfigProperty{
			signingRegion: jsii.String("signingRegion"),
			signingServiceName: jsii.String("signingServiceName"),
		},
	},
}

type CfnDataSource_LambdaConfigProperty

type CfnDataSource_LambdaConfigProperty struct {
	// The ARN for the Lambda function.
	LambdaFunctionArn *string `field:"required" json:"lambdaFunctionArn" yaml:"lambdaFunctionArn"`
}

The `LambdaConfig` property type specifies the Lambda function ARN for an AWS AppSync data source.

`LambdaConfig` is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaConfigProperty := &lambdaConfigProperty{
	lambdaFunctionArn: jsii.String("lambdaFunctionArn"),
}

type CfnDataSource_OpenSearchServiceConfigProperty

type CfnDataSource_OpenSearchServiceConfigProperty struct {
	// The AWS Region.
	AwsRegion *string `field:"required" json:"awsRegion" yaml:"awsRegion"`
	// The endpoint.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
}

The `OpenSearchServiceConfig` property type specifies the `AwsRegion` and `Endpoints` for an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.

`OpenSearchServiceConfig` is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

openSearchServiceConfigProperty := &openSearchServiceConfigProperty{
	awsRegion: jsii.String("awsRegion"),
	endpoint: jsii.String("endpoint"),
}

type CfnDataSource_RdsHttpEndpointConfigProperty

type CfnDataSource_RdsHttpEndpointConfigProperty struct {
	// AWS Region for RDS HTTP endpoint.
	AwsRegion *string `field:"required" json:"awsRegion" yaml:"awsRegion"`
	// The ARN for database credentials stored in AWS Secrets Manager .
	AwsSecretStoreArn *string `field:"required" json:"awsSecretStoreArn" yaml:"awsSecretStoreArn"`
	// Amazon RDS cluster Amazon Resource Name (ARN).
	DbClusterIdentifier *string `field:"required" json:"dbClusterIdentifier" yaml:"dbClusterIdentifier"`
	// Logical database name.
	DatabaseName *string `field:"optional" json:"databaseName" yaml:"databaseName"`
	// Logical schema name.
	Schema *string `field:"optional" json:"schema" yaml:"schema"`
}

Use the `RdsHttpEndpointConfig` property type to specify the `RdsHttpEndpoint` for an AWS AppSync relational database.

`RdsHttpEndpointConfig` is a property of the [AWS AppSync DataSource RelationalDatabaseConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-relationaldatabaseconfig.html) resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

rdsHttpEndpointConfigProperty := &rdsHttpEndpointConfigProperty{
	awsRegion: jsii.String("awsRegion"),
	awsSecretStoreArn: jsii.String("awsSecretStoreArn"),
	dbClusterIdentifier: jsii.String("dbClusterIdentifier"),

	// the properties below are optional
	databaseName: jsii.String("databaseName"),
	schema: jsii.String("schema"),
}

type CfnDataSource_RelationalDatabaseConfigProperty

type CfnDataSource_RelationalDatabaseConfigProperty struct {
	// The type of relational data source.
	RelationalDatabaseSourceType *string `field:"required" json:"relationalDatabaseSourceType" yaml:"relationalDatabaseSourceType"`
	// Information about the Amazon RDS resource.
	RdsHttpEndpointConfig interface{} `field:"optional" json:"rdsHttpEndpointConfig" yaml:"rdsHttpEndpointConfig"`
}

Use the `RelationalDatabaseConfig` property type to specify `RelationalDatabaseConfig` for an AWS AppSync data source.

`RelationalDatabaseConfig` is a property of the [AWS::AppSync::DataSource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

relationalDatabaseConfigProperty := &relationalDatabaseConfigProperty{
	relationalDatabaseSourceType: jsii.String("relationalDatabaseSourceType"),

	// the properties below are optional
	rdsHttpEndpointConfig: &rdsHttpEndpointConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		awsSecretStoreArn: jsii.String("awsSecretStoreArn"),
		dbClusterIdentifier: jsii.String("dbClusterIdentifier"),

		// the properties below are optional
		databaseName: jsii.String("databaseName"),
		schema: jsii.String("schema"),
	},
}

type CfnDomainName

type CfnDomainName interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The domain name provided by AWS AppSync .
	AttrAppSyncDomainName() *string
	AttrDomainName() *string
	// The ID of your Amazon Route 53 hosted zone.
	AttrHostedZoneId() *string
	// The Amazon Resource Name (ARN) of the certificate.
	//
	// This will be an AWS Certificate Manager certificate.
	CertificateArn() *string
	SetCertificateArn(val *string)
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The decription for your domain name.
	Description() *string
	SetDescription(val *string)
	// The domain name.
	DomainName() *string
	SetDomainName(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::DomainName`.

The `AWS::AppSync::DomainName` resource creates a `DomainNameConfig` object to configure a custom domain.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDomainName := awscdk.Aws_appsync.NewCfnDomainName(this, jsii.String("MyCfnDomainName"), &cfnDomainNameProps{
	certificateArn: jsii.String("certificateArn"),
	domainName: jsii.String("domainName"),

	// the properties below are optional
	description: jsii.String("description"),
})

func NewCfnDomainName

func NewCfnDomainName(scope awscdk.Construct, id *string, props *CfnDomainNameProps) CfnDomainName

Create a new `AWS::AppSync::DomainName`.

type CfnDomainNameApiAssociation

type CfnDomainNameApiAssociation interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The API ID.
	ApiId() *string
	SetApiId(val *string)
	AttrApiAssociationIdentifier() *string
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The domain name.
	DomainName() *string
	SetDomainName(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::DomainNameApiAssociation`.

The `AWS::AppSync::DomainNameApiAssociation` resource represents the mapping of your custom domain name to the assigned API URL.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDomainNameApiAssociation := awscdk.Aws_appsync.NewCfnDomainNameApiAssociation(this, jsii.String("MyCfnDomainNameApiAssociation"), &cfnDomainNameApiAssociationProps{
	apiId: jsii.String("apiId"),
	domainName: jsii.String("domainName"),
})

func NewCfnDomainNameApiAssociation

func NewCfnDomainNameApiAssociation(scope awscdk.Construct, id *string, props *CfnDomainNameApiAssociationProps) CfnDomainNameApiAssociation

Create a new `AWS::AppSync::DomainNameApiAssociation`.

type CfnDomainNameApiAssociationProps

type CfnDomainNameApiAssociationProps struct {
	// The API ID.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// The domain name.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
}

Properties for defining a `CfnDomainNameApiAssociation`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDomainNameApiAssociationProps := &cfnDomainNameApiAssociationProps{
	apiId: jsii.String("apiId"),
	domainName: jsii.String("domainName"),
}

type CfnDomainNameProps

type CfnDomainNameProps struct {
	// The Amazon Resource Name (ARN) of the certificate.
	//
	// This will be an AWS Certificate Manager certificate.
	CertificateArn *string `field:"required" json:"certificateArn" yaml:"certificateArn"`
	// The domain name.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
	// The decription for your domain name.
	Description *string `field:"optional" json:"description" yaml:"description"`
}

Properties for defining a `CfnDomainName`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDomainNameProps := &cfnDomainNameProps{
	certificateArn: jsii.String("certificateArn"),
	domainName: jsii.String("domainName"),

	// the properties below are optional
	description: jsii.String("description"),
}

type CfnFunctionConfiguration

type CfnFunctionConfiguration interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The AWS AppSync GraphQL API that you want to attach using this function.
	ApiId() *string
	SetApiId(val *string)
	// The name of data source this function will attach.
	AttrDataSourceName() *string
	// ARN of the function, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/functions/functionId` .
	AttrFunctionArn() *string
	// The unique ID of this function.
	AttrFunctionId() *string
	// The name of the function.
	AttrName() *string
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The name of data source this function will attach.
	DataSourceName() *string
	SetDataSourceName(val *string)
	// The `Function` description.
	Description() *string
	SetDescription(val *string)
	// The version of the request mapping template.
	//
	// Currently, only the 2018-05-29 version of the template is supported.
	FunctionVersion() *string
	SetFunctionVersion(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a `BatchInvoke` operation.
	MaxBatchSize() *float64
	SetMaxBatchSize(val *float64)
	// The name of the function.
	Name() *string
	SetName(val *string)
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The `Function` request mapping template.
	//
	// Functions support only the 2018-05-29 version of the request mapping template.
	RequestMappingTemplate() *string
	SetRequestMappingTemplate(val *string)
	// Describes a Sync configuration for a resolver.
	//
	// Contains information on which Conflict Detection, as well as Resolution strategy, should be performed when the resolver is invoked.
	RequestMappingTemplateS3Location() *string
	SetRequestMappingTemplateS3Location(val *string)
	// The `Function` response mapping template.
	ResponseMappingTemplate() *string
	SetResponseMappingTemplate(val *string)
	// The location of a response mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	ResponseMappingTemplateS3Location() *string
	SetResponseMappingTemplateS3Location(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Describes a Sync configuration for a resolver.
	//
	// Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.
	SyncConfig() interface{}
	SetSyncConfig(val interface{})
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::FunctionConfiguration`.

The `AWS::AppSync::FunctionConfiguration` resource defines the functions in GraphQL APIs to perform certain operations. You can use pipeline resolvers to attach functions. For more information, see [Pipeline Resolvers](https://docs.aws.amazon.com/appsync/latest/devguide/pipeline-resolvers.html) in the *AWS AppSync Developer Guide* .

> When you submit an update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the AWS CloudFormation template. Changing the Amazon S3 file content without changing a property value will not result in an update operation. > > See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *AWS CloudFormation User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnFunctionConfiguration := awscdk.Aws_appsync.NewCfnFunctionConfiguration(this, jsii.String("MyCfnFunctionConfiguration"), &cfnFunctionConfigurationProps{
	apiId: jsii.String("apiId"),
	dataSourceName: jsii.String("dataSourceName"),
	functionVersion: jsii.String("functionVersion"),
	name: jsii.String("name"),

	// the properties below are optional
	description: jsii.String("description"),
	maxBatchSize: jsii.Number(123),
	requestMappingTemplate: jsii.String("requestMappingTemplate"),
	requestMappingTemplateS3Location: jsii.String("requestMappingTemplateS3Location"),
	responseMappingTemplate: jsii.String("responseMappingTemplate"),
	responseMappingTemplateS3Location: jsii.String("responseMappingTemplateS3Location"),
	syncConfig: &syncConfigProperty{
		conflictDetection: jsii.String("conflictDetection"),

		// the properties below are optional
		conflictHandler: jsii.String("conflictHandler"),
		lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
			lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
		},
	},
})

func NewCfnFunctionConfiguration

func NewCfnFunctionConfiguration(scope awscdk.Construct, id *string, props *CfnFunctionConfigurationProps) CfnFunctionConfiguration

Create a new `AWS::AppSync::FunctionConfiguration`.

type CfnFunctionConfigurationProps

type CfnFunctionConfigurationProps struct {
	// The AWS AppSync GraphQL API that you want to attach using this function.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// The name of data source this function will attach.
	DataSourceName *string `field:"required" json:"dataSourceName" yaml:"dataSourceName"`
	// The version of the request mapping template.
	//
	// Currently, only the 2018-05-29 version of the template is supported.
	FunctionVersion *string `field:"required" json:"functionVersion" yaml:"functionVersion"`
	// The name of the function.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The `Function` description.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a `BatchInvoke` operation.
	MaxBatchSize *float64 `field:"optional" json:"maxBatchSize" yaml:"maxBatchSize"`
	// The `Function` request mapping template.
	//
	// Functions support only the 2018-05-29 version of the request mapping template.
	RequestMappingTemplate *string `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// Describes a Sync configuration for a resolver.
	//
	// Contains information on which Conflict Detection, as well as Resolution strategy, should be performed when the resolver is invoked.
	RequestMappingTemplateS3Location *string `field:"optional" json:"requestMappingTemplateS3Location" yaml:"requestMappingTemplateS3Location"`
	// The `Function` response mapping template.
	ResponseMappingTemplate *string `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
	// The location of a response mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	ResponseMappingTemplateS3Location *string `field:"optional" json:"responseMappingTemplateS3Location" yaml:"responseMappingTemplateS3Location"`
	// Describes a Sync configuration for a resolver.
	//
	// Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.
	SyncConfig interface{} `field:"optional" json:"syncConfig" yaml:"syncConfig"`
}

Properties for defining a `CfnFunctionConfiguration`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnFunctionConfigurationProps := &cfnFunctionConfigurationProps{
	apiId: jsii.String("apiId"),
	dataSourceName: jsii.String("dataSourceName"),
	functionVersion: jsii.String("functionVersion"),
	name: jsii.String("name"),

	// the properties below are optional
	description: jsii.String("description"),
	maxBatchSize: jsii.Number(123),
	requestMappingTemplate: jsii.String("requestMappingTemplate"),
	requestMappingTemplateS3Location: jsii.String("requestMappingTemplateS3Location"),
	responseMappingTemplate: jsii.String("responseMappingTemplate"),
	responseMappingTemplateS3Location: jsii.String("responseMappingTemplateS3Location"),
	syncConfig: &syncConfigProperty{
		conflictDetection: jsii.String("conflictDetection"),

		// the properties below are optional
		conflictHandler: jsii.String("conflictHandler"),
		lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
			lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
		},
	},
}

type CfnFunctionConfiguration_LambdaConflictHandlerConfigProperty

type CfnFunctionConfiguration_LambdaConflictHandlerConfigProperty struct {
	// The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
	LambdaConflictHandlerArn *string `field:"optional" json:"lambdaConflictHandlerArn" yaml:"lambdaConflictHandlerArn"`
}

The `LambdaConflictHandlerConfig` object when configuring `LAMBDA` as the Conflict Handler.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaConflictHandlerConfigProperty := &lambdaConflictHandlerConfigProperty{
	lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
}

type CfnFunctionConfiguration_SyncConfigProperty

type CfnFunctionConfiguration_SyncConfigProperty struct {
	// The Conflict Detection strategy to use.
	//
	// - *VERSION* : Detect conflicts based on object versions for this resolver.
	// - *NONE* : Do not detect conflicts when invoking this resolver.
	ConflictDetection *string `field:"required" json:"conflictDetection" yaml:"conflictDetection"`
	// The Conflict Resolution strategy to perform in the event of a conflict.
	//
	// - *OPTIMISTIC_CONCURRENCY* : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
	// - *AUTOMERGE* : Resolve conflicts with the Automerge conflict resolution strategy.
	// - *LAMBDA* : Resolve conflicts with an AWS Lambda function supplied in the `LambdaConflictHandlerConfig` .
	ConflictHandler *string `field:"optional" json:"conflictHandler" yaml:"conflictHandler"`
	// The `LambdaConflictHandlerConfig` when configuring `LAMBDA` as the Conflict Handler.
	LambdaConflictHandlerConfig interface{} `field:"optional" json:"lambdaConflictHandlerConfig" yaml:"lambdaConflictHandlerConfig"`
}

Describes a Sync configuration for a resolver.

Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

syncConfigProperty := &syncConfigProperty{
	conflictDetection: jsii.String("conflictDetection"),

	// the properties below are optional
	conflictHandler: jsii.String("conflictHandler"),
	lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
		lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
	},
}

type CfnGraphQLApi

type CfnGraphQLApi interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// A list of additional authentication providers for the `GraphqlApi` API.
	AdditionalAuthenticationProviders() interface{}
	SetAdditionalAuthenticationProviders(val interface{})
	// Unique AWS AppSync GraphQL API identifier.
	AttrApiId() *string
	// The Amazon Resource Name (ARN) of the API key, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid` .
	AttrArn() *string
	// The Endpoint URL of your GraphQL API.
	AttrGraphQlUrl() *string
	// Security configuration for your GraphQL API.
	//
	// For allowed values (such as `API_KEY` , `AWS_IAM` , `AMAZON_COGNITO_USER_POOLS` , `OPENID_CONNECT` , or `AWS_LAMBDA` ), see [Security](https://docs.aws.amazon.com/appsync/latest/devguide/security.html) in the *AWS AppSync Developer Guide* .
	AuthenticationType() *string
	SetAuthenticationType(val *string)
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// A `LambdaAuthorizerConfig` holds configuration on how to authorize AWS AppSync API access when using the `AWS_LAMBDA` authorizer mode.
	//
	// Be aware that an AWS AppSync API may have only one Lambda authorizer configured at a time.
	LambdaAuthorizerConfig() interface{}
	SetLambdaAuthorizerConfig(val interface{})
	// The Amazon CloudWatch Logs configuration.
	LogConfig() interface{}
	SetLogConfig(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The API name.
	Name() *string
	SetName(val *string)
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// The OpenID Connect configuration.
	OpenIdConnectConfig() interface{}
	SetOpenIdConnectConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// An arbitrary set of tags (key-value pairs) for this GraphQL API.
	Tags() awscdk.TagManager
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint.
	UserPoolConfig() interface{}
	SetUserPoolConfig(val interface{})
	// A flag indicating whether to use AWS X-Ray tracing for this `GraphqlApi` .
	XrayEnabled() interface{}
	SetXrayEnabled(val interface{})
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::GraphQLApi`.

The `AWS::AppSync::GraphQLApi` resource creates a new AWS AppSync GraphQL API. This is the top-level construct for your application. For more information, see [Quick Start](https://docs.aws.amazon.com/appsync/latest/devguide/quickstart.html) in the *AWS AppSync Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGraphQLApi := awscdk.Aws_appsync.NewCfnGraphQLApi(this, jsii.String("MyCfnGraphQLApi"), &cfnGraphQLApiProps{
	authenticationType: jsii.String("authenticationType"),
	name: jsii.String("name"),

	// the properties below are optional
	additionalAuthenticationProviders: []interface{}{
		&additionalAuthenticationProviderProperty{
			authenticationType: jsii.String("authenticationType"),

			// the properties below are optional
			lambdaAuthorizerConfig: &lambdaAuthorizerConfigProperty{
				authorizerResultTtlInSeconds: jsii.Number(123),
				authorizerUri: jsii.String("authorizerUri"),
				identityValidationExpression: jsii.String("identityValidationExpression"),
			},
			openIdConnectConfig: &openIDConnectConfigProperty{
				authTtl: jsii.Number(123),
				clientId: jsii.String("clientId"),
				iatTtl: jsii.Number(123),
				issuer: jsii.String("issuer"),
			},
			userPoolConfig: &cognitoUserPoolConfigProperty{
				appIdClientRegex: jsii.String("appIdClientRegex"),
				awsRegion: jsii.String("awsRegion"),
				userPoolId: jsii.String("userPoolId"),
			},
		},
	},
	lambdaAuthorizerConfig: &lambdaAuthorizerConfigProperty{
		authorizerResultTtlInSeconds: jsii.Number(123),
		authorizerUri: jsii.String("authorizerUri"),
		identityValidationExpression: jsii.String("identityValidationExpression"),
	},
	logConfig: &logConfigProperty{
		cloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"),
		excludeVerboseContent: jsii.Boolean(false),
		fieldLogLevel: jsii.String("fieldLogLevel"),
	},
	openIdConnectConfig: &openIDConnectConfigProperty{
		authTtl: jsii.Number(123),
		clientId: jsii.String("clientId"),
		iatTtl: jsii.Number(123),
		issuer: jsii.String("issuer"),
	},
	tags: []cfnTag{
		&cfnTag{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
	userPoolConfig: &userPoolConfigProperty{
		appIdClientRegex: jsii.String("appIdClientRegex"),
		awsRegion: jsii.String("awsRegion"),
		defaultAction: jsii.String("defaultAction"),
		userPoolId: jsii.String("userPoolId"),
	},
	xrayEnabled: jsii.Boolean(false),
})

func NewCfnGraphQLApi

func NewCfnGraphQLApi(scope awscdk.Construct, id *string, props *CfnGraphQLApiProps) CfnGraphQLApi

Create a new `AWS::AppSync::GraphQLApi`.

type CfnGraphQLApiProps

type CfnGraphQLApiProps struct {
	// Security configuration for your GraphQL API.
	//
	// For allowed values (such as `API_KEY` , `AWS_IAM` , `AMAZON_COGNITO_USER_POOLS` , `OPENID_CONNECT` , or `AWS_LAMBDA` ), see [Security](https://docs.aws.amazon.com/appsync/latest/devguide/security.html) in the *AWS AppSync Developer Guide* .
	AuthenticationType *string `field:"required" json:"authenticationType" yaml:"authenticationType"`
	// The API name.
	Name *string `field:"required" json:"name" yaml:"name"`
	// A list of additional authentication providers for the `GraphqlApi` API.
	AdditionalAuthenticationProviders interface{} `field:"optional" json:"additionalAuthenticationProviders" yaml:"additionalAuthenticationProviders"`
	// A `LambdaAuthorizerConfig` holds configuration on how to authorize AWS AppSync API access when using the `AWS_LAMBDA` authorizer mode.
	//
	// Be aware that an AWS AppSync API may have only one Lambda authorizer configured at a time.
	LambdaAuthorizerConfig interface{} `field:"optional" json:"lambdaAuthorizerConfig" yaml:"lambdaAuthorizerConfig"`
	// The Amazon CloudWatch Logs configuration.
	LogConfig interface{} `field:"optional" json:"logConfig" yaml:"logConfig"`
	// The OpenID Connect configuration.
	OpenIdConnectConfig interface{} `field:"optional" json:"openIdConnectConfig" yaml:"openIdConnectConfig"`
	// An arbitrary set of tags (key-value pairs) for this GraphQL API.
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
	// Optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint.
	UserPoolConfig interface{} `field:"optional" json:"userPoolConfig" yaml:"userPoolConfig"`
	// A flag indicating whether to use AWS X-Ray tracing for this `GraphqlApi` .
	XrayEnabled interface{} `field:"optional" json:"xrayEnabled" yaml:"xrayEnabled"`
}

Properties for defining a `CfnGraphQLApi`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGraphQLApiProps := &cfnGraphQLApiProps{
	authenticationType: jsii.String("authenticationType"),
	name: jsii.String("name"),

	// the properties below are optional
	additionalAuthenticationProviders: []interface{}{
		&additionalAuthenticationProviderProperty{
			authenticationType: jsii.String("authenticationType"),

			// the properties below are optional
			lambdaAuthorizerConfig: &lambdaAuthorizerConfigProperty{
				authorizerResultTtlInSeconds: jsii.Number(123),
				authorizerUri: jsii.String("authorizerUri"),
				identityValidationExpression: jsii.String("identityValidationExpression"),
			},
			openIdConnectConfig: &openIDConnectConfigProperty{
				authTtl: jsii.Number(123),
				clientId: jsii.String("clientId"),
				iatTtl: jsii.Number(123),
				issuer: jsii.String("issuer"),
			},
			userPoolConfig: &cognitoUserPoolConfigProperty{
				appIdClientRegex: jsii.String("appIdClientRegex"),
				awsRegion: jsii.String("awsRegion"),
				userPoolId: jsii.String("userPoolId"),
			},
		},
	},
	lambdaAuthorizerConfig: &lambdaAuthorizerConfigProperty{
		authorizerResultTtlInSeconds: jsii.Number(123),
		authorizerUri: jsii.String("authorizerUri"),
		identityValidationExpression: jsii.String("identityValidationExpression"),
	},
	logConfig: &logConfigProperty{
		cloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"),
		excludeVerboseContent: jsii.Boolean(false),
		fieldLogLevel: jsii.String("fieldLogLevel"),
	},
	openIdConnectConfig: &openIDConnectConfigProperty{
		authTtl: jsii.Number(123),
		clientId: jsii.String("clientId"),
		iatTtl: jsii.Number(123),
		issuer: jsii.String("issuer"),
	},
	tags: []cfnTag{
		&cfnTag{
			key: jsii.String("key"),
			value: jsii.String("value"),
		},
	},
	userPoolConfig: &userPoolConfigProperty{
		appIdClientRegex: jsii.String("appIdClientRegex"),
		awsRegion: jsii.String("awsRegion"),
		defaultAction: jsii.String("defaultAction"),
		userPoolId: jsii.String("userPoolId"),
	},
	xrayEnabled: jsii.Boolean(false),
}

type CfnGraphQLApi_AdditionalAuthenticationProviderProperty

type CfnGraphQLApi_AdditionalAuthenticationProviderProperty struct {
	// The authentication type for API key, AWS Identity and Access Management , OIDC, Amazon Cognito user pools , or AWS Lambda .
	//
	// Valid Values: `API_KEY` | `AWS_IAM` | `OPENID_CONNECT` | `AMAZON_COGNITO_USER_POOLS` | `AWS_LAMBDA`.
	AuthenticationType *string `field:"required" json:"authenticationType" yaml:"authenticationType"`
	// Configuration for AWS Lambda function authorization.
	LambdaAuthorizerConfig interface{} `field:"optional" json:"lambdaAuthorizerConfig" yaml:"lambdaAuthorizerConfig"`
	// The OIDC configuration.
	OpenIdConnectConfig interface{} `field:"optional" json:"openIdConnectConfig" yaml:"openIdConnectConfig"`
	// The Amazon Cognito user pool configuration.
	UserPoolConfig interface{} `field:"optional" json:"userPoolConfig" yaml:"userPoolConfig"`
}

Describes an additional authentication provider.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

additionalAuthenticationProviderProperty := &additionalAuthenticationProviderProperty{
	authenticationType: jsii.String("authenticationType"),

	// the properties below are optional
	lambdaAuthorizerConfig: &lambdaAuthorizerConfigProperty{
		authorizerResultTtlInSeconds: jsii.Number(123),
		authorizerUri: jsii.String("authorizerUri"),
		identityValidationExpression: jsii.String("identityValidationExpression"),
	},
	openIdConnectConfig: &openIDConnectConfigProperty{
		authTtl: jsii.Number(123),
		clientId: jsii.String("clientId"),
		iatTtl: jsii.Number(123),
		issuer: jsii.String("issuer"),
	},
	userPoolConfig: &cognitoUserPoolConfigProperty{
		appIdClientRegex: jsii.String("appIdClientRegex"),
		awsRegion: jsii.String("awsRegion"),
		userPoolId: jsii.String("userPoolId"),
	},
}

type CfnGraphQLApi_CognitoUserPoolConfigProperty

type CfnGraphQLApi_CognitoUserPoolConfigProperty struct {
	// A regular expression for validating the incoming Amazon Cognito user pool app client ID.
	AppIdClientRegex *string `field:"optional" json:"appIdClientRegex" yaml:"appIdClientRegex"`
	// The AWS Region in which the user pool was created.
	AwsRegion *string `field:"optional" json:"awsRegion" yaml:"awsRegion"`
	// The user pool ID.
	UserPoolId *string `field:"optional" json:"userPoolId" yaml:"userPoolId"`
}

Describes an Amazon Cognito user pool configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cognitoUserPoolConfigProperty := &cognitoUserPoolConfigProperty{
	appIdClientRegex: jsii.String("appIdClientRegex"),
	awsRegion: jsii.String("awsRegion"),
	userPoolId: jsii.String("userPoolId"),
}

type CfnGraphQLApi_LambdaAuthorizerConfigProperty

type CfnGraphQLApi_LambdaAuthorizerConfigProperty struct {
	// The number of seconds a response should be cached for.
	//
	// The default is 5 minutes (300 seconds). The Lambda function can override this by returning a `ttlOverride` key in its response. A value of 0 disables caching of responses.
	AuthorizerResultTtlInSeconds *float64 `field:"optional" json:"authorizerResultTtlInSeconds" yaml:"authorizerResultTtlInSeconds"`
	// The ARN of the Lambda function to be called for authorization.
	//
	// This may be a standard Lambda ARN, a version ARN ( `.../v3` ) or 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 do so with the AWS 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`
	AuthorizerUri *string `field:"optional" json:"authorizerUri" yaml:"authorizerUri"`
	// A regular expression for validation of tokens before the Lambda function is called.
	IdentityValidationExpression *string `field:"optional" json:"identityValidationExpression" yaml:"identityValidationExpression"`
}

Configuration for AWS Lambda function authorization.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaAuthorizerConfigProperty := &lambdaAuthorizerConfigProperty{
	authorizerResultTtlInSeconds: jsii.Number(123),
	authorizerUri: jsii.String("authorizerUri"),
	identityValidationExpression: jsii.String("identityValidationExpression"),
}

type CfnGraphQLApi_LogConfigProperty

type CfnGraphQLApi_LogConfigProperty struct {
	// The service role that AWS AppSync will assume to publish to Amazon CloudWatch Logs in your account.
	CloudWatchLogsRoleArn *string `field:"optional" json:"cloudWatchLogsRoleArn" yaml:"cloudWatchLogsRoleArn"`
	// Set to TRUE to exclude sections that contain information such as headers, context, and evaluated mapping templates, regardless of logging level.
	ExcludeVerboseContent interface{} `field:"optional" json:"excludeVerboseContent" yaml:"excludeVerboseContent"`
	// The field logging level. Values can be NONE, ERROR, or ALL.
	//
	// - *NONE* : No field-level logs are captured.
	// - *ERROR* : Logs the following information only for the fields that are in error:
	//
	// - The error section in the server response.
	// - Field-level errors.
	// - The generated request/response functions that got resolved for error fields.
	// - *ALL* : The following information is logged for all fields in the query:
	//
	// - Field-level tracing information.
	// - The generated request/response functions that got resolved for each field.
	FieldLogLevel *string `field:"optional" json:"fieldLogLevel" yaml:"fieldLogLevel"`
}

The `LogConfig` property type specifies the logging configuration when writing GraphQL operations and tracing to Amazon CloudWatch for an AWS AppSync GraphQL API.

`LogConfig` is a property of the [AWS::AppSync::GraphQLApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

logConfigProperty := &logConfigProperty{
	cloudWatchLogsRoleArn: jsii.String("cloudWatchLogsRoleArn"),
	excludeVerboseContent: jsii.Boolean(false),
	fieldLogLevel: jsii.String("fieldLogLevel"),
}

type CfnGraphQLApi_OpenIDConnectConfigProperty

type CfnGraphQLApi_OpenIDConnectConfigProperty struct {
	// The number of milliseconds that a token is valid after being authenticated.
	AuthTtl *float64 `field:"optional" json:"authTtl" yaml:"authTtl"`
	// 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 AWS AppSync can validate against multiple client identifiers at a time.
	ClientId *string `field:"optional" json:"clientId" yaml:"clientId"`
	// The number of milliseconds that a token is valid after it's issued to a user.
	IatTtl *float64 `field:"optional" json:"iatTtl" yaml:"iatTtl"`
	// The issuer for the OIDC configuration.
	//
	// The issuer returned by discovery must exactly match the value of `iss` in the ID token.
	Issuer *string `field:"optional" json:"issuer" yaml:"issuer"`
}

The `OpenIDConnectConfig` property type specifies the optional authorization configuration for using an OpenID Connect compliant service with your GraphQL endpoint for an AWS AppSync GraphQL API.

`OpenIDConnectConfig` is a property of the [AWS::AppSync::GraphQLApi](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html) property type.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

openIDConnectConfigProperty := &openIDConnectConfigProperty{
	authTtl: jsii.Number(123),
	clientId: jsii.String("clientId"),
	iatTtl: jsii.Number(123),
	issuer: jsii.String("issuer"),
}

type CfnGraphQLApi_UserPoolConfigProperty

type CfnGraphQLApi_UserPoolConfigProperty struct {
	// A regular expression for validating the incoming Amazon Cognito user pool app client ID.
	AppIdClientRegex *string `field:"optional" json:"appIdClientRegex" yaml:"appIdClientRegex"`
	// The AWS Region in which the user pool was created.
	AwsRegion *string `field:"optional" json:"awsRegion" yaml:"awsRegion"`
	// 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.
	//
	// When specifying Amazon Cognito user pools as the default authentication, you must set the value for `DefaultAction` to `ALLOW` if specifying `AdditionalAuthenticationProviders` .
	DefaultAction *string `field:"optional" json:"defaultAction" yaml:"defaultAction"`
	// The user pool ID.
	UserPoolId *string `field:"optional" json:"userPoolId" yaml:"userPoolId"`
}

The `UserPoolConfig` property type specifies the optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint for an AWS AppSync GraphQL API.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

userPoolConfigProperty := &userPoolConfigProperty{
	appIdClientRegex: jsii.String("appIdClientRegex"),
	awsRegion: jsii.String("awsRegion"),
	defaultAction: jsii.String("defaultAction"),
	userPoolId: jsii.String("userPoolId"),
}

type CfnGraphQLSchema

type CfnGraphQLSchema interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The AWS AppSync GraphQL API identifier to which you want to apply this schema.
	ApiId() *string
	SetApiId(val *string)
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The text representation of a GraphQL schema in SDL format.
	//
	// For more information about using the `Ref` function, see [Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref) .
	Definition() *string
	SetDefinition(val *string)
	// The location of a GraphQL schema file in an Amazon S3 bucket.
	//
	// Use this if you want to provision with the schema living in Amazon S3 rather than embedding it in your CloudFormation template.
	DefinitionS3Location() *string
	SetDefinitionS3Location(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::GraphQLSchema`.

The `AWS::AppSync::GraphQLSchema` resource is used for your AWS AppSync GraphQL schema that controls the data model for your API. Schema files are text written in Schema Definition Language (SDL) format. For more information about schema authoring, see [Designing a GraphQL API](https://docs.aws.amazon.com/appsync/latest/devguide/designing-a-graphql-api.html) in the *AWS AppSync Developer Guide* .

> When you submit an update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CloudFormation template. Changing the Amazon S3 file content without changing a property value will not result in an update operation. > > See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *AWS CloudFormation User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGraphQLSchema := awscdk.Aws_appsync.NewCfnGraphQLSchema(this, jsii.String("MyCfnGraphQLSchema"), &cfnGraphQLSchemaProps{
	apiId: jsii.String("apiId"),

	// the properties below are optional
	definition: jsii.String("definition"),
	definitionS3Location: jsii.String("definitionS3Location"),
})

func NewCfnGraphQLSchema

func NewCfnGraphQLSchema(scope awscdk.Construct, id *string, props *CfnGraphQLSchemaProps) CfnGraphQLSchema

Create a new `AWS::AppSync::GraphQLSchema`.

type CfnGraphQLSchemaProps

type CfnGraphQLSchemaProps struct {
	// The AWS AppSync GraphQL API identifier to which you want to apply this schema.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// The text representation of a GraphQL schema in SDL format.
	//
	// For more information about using the `Ref` function, see [Ref](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref) .
	Definition *string `field:"optional" json:"definition" yaml:"definition"`
	// The location of a GraphQL schema file in an Amazon S3 bucket.
	//
	// Use this if you want to provision with the schema living in Amazon S3 rather than embedding it in your CloudFormation template.
	DefinitionS3Location *string `field:"optional" json:"definitionS3Location" yaml:"definitionS3Location"`
}

Properties for defining a `CfnGraphQLSchema`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGraphQLSchemaProps := &cfnGraphQLSchemaProps{
	apiId: jsii.String("apiId"),

	// the properties below are optional
	definition: jsii.String("definition"),
	definitionS3Location: jsii.String("definitionS3Location"),
}

type CfnResolver

type CfnResolver interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The AWS AppSync GraphQL API to which you want to attach this resolver.
	ApiId() *string
	SetApiId(val *string)
	// The GraphQL field on a type that invokes the resolver.
	AttrFieldName() *string
	// ARN of the resolver, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/types/typename/resolvers/resolvername` .
	AttrResolverArn() *string
	// The GraphQL type that invokes this resolver.
	AttrTypeName() *string
	// The caching configuration for the resolver.
	CachingConfig() interface{}
	SetCachingConfig(val interface{})
	// Options for this resource, such as condition, update policy etc.
	// Experimental.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	// Experimental.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	// Experimental.
	CreationStack() *[]*string
	// The resolver data source name.
	DataSourceName() *string
	SetDataSourceName(val *string)
	// The GraphQL field on a type that invokes the resolver.
	FieldName() *string
	SetFieldName(val *string)
	// The resolver type.
	//
	// - *UNIT* : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
	// - *PIPELINE* : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of `Function` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
	Kind() *string
	SetKind(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	// Experimental.
	LogicalId() *string
	// The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a `BatchInvoke` operation.
	MaxBatchSize() *float64
	SetMaxBatchSize(val *float64)
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Functions linked with the pipeline resolver.
	PipelineConfig() interface{}
	SetPipelineConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	// Experimental.
	Ref() *string
	// The request mapping template.
	//
	// Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.
	RequestMappingTemplate() *string
	SetRequestMappingTemplate(val *string)
	// The location of a request mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	RequestMappingTemplateS3Location() *string
	SetRequestMappingTemplateS3Location(val *string)
	// The response mapping template.
	ResponseMappingTemplate() *string
	SetResponseMappingTemplate(val *string)
	// The location of a response mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	ResponseMappingTemplateS3Location() *string
	SetResponseMappingTemplateS3Location(val *string)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	// Experimental.
	Stack() awscdk.Stack
	// The `SyncConfig` for a resolver attached to a versioned data source.
	SyncConfig() interface{}
	SetSyncConfig(val interface{})
	// The GraphQL type that invokes this resolver.
	TypeName() *string
	SetTypeName(val *string)
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	// Experimental.
	UpdatedProperites() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	// Experimental.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	// Experimental.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//    "GlobalSecondaryIndexes": [
	//      {
	//        "Projection": {
	//          "NonKeyAttributes": [ "myattribute" ]
	//          ...
	//        }
	//        ...
	//      },
	//      {
	//        "ProjectionType": "INCLUDE"
	//        ...
	//      },
	//    ]
	//    ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	// Experimental.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	// Experimental.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	// Experimental.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	// Experimental.
	GetAtt(attributeName *string) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	// Experimental.
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Overrides the auto-generated logical ID with a specific ID.
	// Experimental.
	OverrideLogicalId(newLogicalId *string)
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	// Experimental.
	ShouldSynthesize() *bool
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
	// Experimental.
	ValidateProperties(_properties interface{})
}

A CloudFormation `AWS::AppSync::Resolver`.

The `AWS::AppSync::Resolver` resource defines the logical GraphQL resolver that you attach to fields in a schema. Request and response templates for resolvers are written in Apache Velocity Template Language (VTL) format. For more information about resolvers, see [Resolver Mapping Template Reference](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference.html) .

> When you submit an update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CloudFormation template. Changing the Amazon S3 file content without changing a property value will not result in an update operation. > > See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *AWS CloudFormation User Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnResolver := awscdk.Aws_appsync.NewCfnResolver(this, jsii.String("MyCfnResolver"), &cfnResolverProps{
	apiId: jsii.String("apiId"),
	fieldName: jsii.String("fieldName"),
	typeName: jsii.String("typeName"),

	// the properties below are optional
	cachingConfig: &cachingConfigProperty{
		ttl: jsii.Number(123),

		// the properties below are optional
		cachingKeys: []*string{
			jsii.String("cachingKeys"),
		},
	},
	dataSourceName: jsii.String("dataSourceName"),
	kind: jsii.String("kind"),
	maxBatchSize: jsii.Number(123),
	pipelineConfig: &pipelineConfigProperty{
		functions: []*string{
			jsii.String("functions"),
		},
	},
	requestMappingTemplate: jsii.String("requestMappingTemplate"),
	requestMappingTemplateS3Location: jsii.String("requestMappingTemplateS3Location"),
	responseMappingTemplate: jsii.String("responseMappingTemplate"),
	responseMappingTemplateS3Location: jsii.String("responseMappingTemplateS3Location"),
	syncConfig: &syncConfigProperty{
		conflictDetection: jsii.String("conflictDetection"),

		// the properties below are optional
		conflictHandler: jsii.String("conflictHandler"),
		lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
			lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
		},
	},
})

func NewCfnResolver

func NewCfnResolver(scope awscdk.Construct, id *string, props *CfnResolverProps) CfnResolver

Create a new `AWS::AppSync::Resolver`.

type CfnResolverProps

type CfnResolverProps struct {
	// The AWS AppSync GraphQL API to which you want to attach this resolver.
	ApiId *string `field:"required" json:"apiId" yaml:"apiId"`
	// The GraphQL field on a type that invokes the resolver.
	FieldName *string `field:"required" json:"fieldName" yaml:"fieldName"`
	// The GraphQL type that invokes this resolver.
	TypeName *string `field:"required" json:"typeName" yaml:"typeName"`
	// The caching configuration for the resolver.
	CachingConfig interface{} `field:"optional" json:"cachingConfig" yaml:"cachingConfig"`
	// The resolver data source name.
	DataSourceName *string `field:"optional" json:"dataSourceName" yaml:"dataSourceName"`
	// The resolver type.
	//
	// - *UNIT* : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
	// - *PIPELINE* : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of `Function` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
	Kind *string `field:"optional" json:"kind" yaml:"kind"`
	// The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a `BatchInvoke` operation.
	MaxBatchSize *float64 `field:"optional" json:"maxBatchSize" yaml:"maxBatchSize"`
	// Functions linked with the pipeline resolver.
	PipelineConfig interface{} `field:"optional" json:"pipelineConfig" yaml:"pipelineConfig"`
	// The request mapping template.
	//
	// Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.
	RequestMappingTemplate *string `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// The location of a request mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	RequestMappingTemplateS3Location *string `field:"optional" json:"requestMappingTemplateS3Location" yaml:"requestMappingTemplateS3Location"`
	// The response mapping template.
	ResponseMappingTemplate *string `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
	// The location of a response mapping template in an Amazon S3 bucket.
	//
	// Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
	ResponseMappingTemplateS3Location *string `field:"optional" json:"responseMappingTemplateS3Location" yaml:"responseMappingTemplateS3Location"`
	// The `SyncConfig` for a resolver attached to a versioned data source.
	SyncConfig interface{} `field:"optional" json:"syncConfig" yaml:"syncConfig"`
}

Properties for defining a `CfnResolver`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnResolverProps := &cfnResolverProps{
	apiId: jsii.String("apiId"),
	fieldName: jsii.String("fieldName"),
	typeName: jsii.String("typeName"),

	// the properties below are optional
	cachingConfig: &cachingConfigProperty{
		ttl: jsii.Number(123),

		// the properties below are optional
		cachingKeys: []*string{
			jsii.String("cachingKeys"),
		},
	},
	dataSourceName: jsii.String("dataSourceName"),
	kind: jsii.String("kind"),
	maxBatchSize: jsii.Number(123),
	pipelineConfig: &pipelineConfigProperty{
		functions: []*string{
			jsii.String("functions"),
		},
	},
	requestMappingTemplate: jsii.String("requestMappingTemplate"),
	requestMappingTemplateS3Location: jsii.String("requestMappingTemplateS3Location"),
	responseMappingTemplate: jsii.String("responseMappingTemplate"),
	responseMappingTemplateS3Location: jsii.String("responseMappingTemplateS3Location"),
	syncConfig: &syncConfigProperty{
		conflictDetection: jsii.String("conflictDetection"),

		// the properties below are optional
		conflictHandler: jsii.String("conflictHandler"),
		lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
			lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
		},
	},
}

type CfnResolver_CachingConfigProperty

type CfnResolver_CachingConfigProperty struct {
	// The TTL in seconds for a resolver that has caching activated.
	//
	// Valid values are 1–3,600 seconds.
	Ttl *float64 `field:"required" json:"ttl" yaml:"ttl"`
	// The caching keys for a resolver that has caching activated.
	//
	// Valid values are entries from the `$context.arguments` , `$context.source` , and `$context.identity` maps.
	CachingKeys *[]*string `field:"optional" json:"cachingKeys" yaml:"cachingKeys"`
}

The caching configuration for a resolver that has caching activated.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cachingConfigProperty := &cachingConfigProperty{
	ttl: jsii.Number(123),

	// the properties below are optional
	cachingKeys: []*string{
		jsii.String("cachingKeys"),
	},
}

type CfnResolver_LambdaConflictHandlerConfigProperty

type CfnResolver_LambdaConflictHandlerConfigProperty struct {
	// The Amazon Resource Name (ARN) for the Lambda function to use as the Conflict Handler.
	LambdaConflictHandlerArn *string `field:"optional" json:"lambdaConflictHandlerArn" yaml:"lambdaConflictHandlerArn"`
}

The `LambdaConflictHandlerConfig` when configuring LAMBDA as the Conflict Handler.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaConflictHandlerConfigProperty := &lambdaConflictHandlerConfigProperty{
	lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
}

type CfnResolver_PipelineConfigProperty

type CfnResolver_PipelineConfigProperty struct {
	// A list of `Function` objects.
	Functions *[]*string `field:"optional" json:"functions" yaml:"functions"`
}

Use the `PipelineConfig` property type to specify `PipelineConfig` for an AWS AppSync resolver.

`PipelineConfig` is a property of the [AWS::AppSync::Resolver](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-resolver.html) resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

pipelineConfigProperty := &pipelineConfigProperty{
	functions: []*string{
		jsii.String("functions"),
	},
}

type CfnResolver_SyncConfigProperty

type CfnResolver_SyncConfigProperty struct {
	// The Conflict Detection strategy to use.
	//
	// - *VERSION* : Detect conflicts based on object versions for this resolver.
	// - *NONE* : Do not detect conflicts when invoking this resolver.
	ConflictDetection *string `field:"required" json:"conflictDetection" yaml:"conflictDetection"`
	// The Conflict Resolution strategy to perform in the event of a conflict.
	//
	// - *OPTIMISTIC_CONCURRENCY* : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
	// - *AUTOMERGE* : Resolve conflicts with the Automerge conflict resolution strategy.
	// - *LAMBDA* : Resolve conflicts with an AWS Lambda function supplied in the `LambdaConflictHandlerConfig` .
	ConflictHandler *string `field:"optional" json:"conflictHandler" yaml:"conflictHandler"`
	// The `LambdaConflictHandlerConfig` when configuring `LAMBDA` as the Conflict Handler.
	LambdaConflictHandlerConfig interface{} `field:"optional" json:"lambdaConflictHandlerConfig" yaml:"lambdaConflictHandlerConfig"`
}

Describes a Sync configuration for a resolver.

Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

syncConfigProperty := &syncConfigProperty{
	conflictDetection: jsii.String("conflictDetection"),

	// the properties below are optional
	conflictHandler: jsii.String("conflictHandler"),
	lambdaConflictHandlerConfig: &lambdaConflictHandlerConfigProperty{
		lambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
	},
}

type DataSourceOptions

type DataSourceOptions struct {
	// The description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source, overrides the id given by cdk.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Optional configuration for data sources.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

dataSourceOptions := &dataSourceOptions{
	description: jsii.String("description"),
	name: jsii.String("name"),
}

Experimental.

type Directive

type Directive interface {
	// The authorization type of this directive.
	// Experimental.
	Mode() AuthorizationType
	// the authorization modes for this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// Mutation fields for a subscription directive.
	// Experimental.
	MutationFields() *[]*string
	// Generate the directive statement.
	// Experimental.
	ToString() *string
}

Directives for types.

i.e. @aws_iam or @aws_subscribe

Example:

var api graphqlApi
var film interfaceType

api.addSubscription(jsii.String("addedFilm"), appsync.NewField(&fieldOptions{
	returnType: film.attribute(),
	args: map[string]graphqlType{
		"id": appsync.*graphqlType.id(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
	directives: []directive{
		appsync.*directive.subscribe(jsii.String("addFilm")),
	},
}))

Experimental.

func Directive_ApiKey

func Directive_ApiKey() Directive

Add the @aws_api_key directive. Experimental.

func Directive_Cognito

func Directive_Cognito(groups ...*string) Directive

Add the @aws_auth or @aws_cognito_user_pools directive. Experimental.

func Directive_Custom

func Directive_Custom(statement *string) Directive

Add a custom directive. Experimental.

func Directive_Iam

func Directive_Iam() Directive

Add the @aws_iam directive. Experimental.

func Directive_Oidc

func Directive_Oidc() Directive

Add the @aws_oidc directive. Experimental.

func Directive_Subscribe

func Directive_Subscribe(mutations ...*string) Directive

Add the @aws_subscribe directive.

Only use for top level Subscription type. Experimental.

type DomainOptions

type DomainOptions struct {
	// The certificate to use with the domain name.
	// Experimental.
	Certificate awscertificatemanager.ICertificate `field:"required" json:"certificate" yaml:"certificate"`
	// The actual domain name.
	//
	// For example, `api.example.com`.
	// Experimental.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
}

Domain name configuration for AppSync.

Example:

import acm "github.com/aws/aws-cdk-go/awscdk"
import route53 "github.com/aws/aws-cdk-go/awscdk"

// hosted zone and route53 features
var hostedZoneId string
zoneName := "example.com"

myDomainName := "api.example.com"
certificate := acm.NewCertificate(this, jsii.String("cert"), &certificateProps{
	domainName: myDomainName,
})
api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("myApi"),
	domainName: &domainOptions{
		certificate: certificate,
		domainName: myDomainName,
	},
})

// hosted zone for adding appsync domain
zone := route53.hostedZone.fromHostedZoneAttributes(this, jsii.String("HostedZone"), &hostedZoneAttributes{
	hostedZoneId: jsii.String(hostedZoneId),
	zoneName: jsii.String(zoneName),
})

// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
route53.NewCnameRecord(this, jsii.String("CnameApiRecord"), &cnameRecordProps{
	recordName: jsii.String("api"),
	zone: zone,
	domainName: myDomainName,
})

Experimental.

type DynamoDbDataSource

type DynamoDbDataSource interface {
	BackedDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync datasource backed by a DynamoDB table.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

func NewDynamoDbDataSource

func NewDynamoDbDataSource(scope constructs.Construct, id *string, props *DynamoDbDataSourceProps) DynamoDbDataSource

Experimental.

type DynamoDbDataSourceProps

type DynamoDbDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Experimental.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
	// The DynamoDB table backing this data source.
	// Experimental.
	Table awsdynamodb.ITable `field:"required" json:"table" yaml:"table"`
	// Specify whether this DS is read only or has read and write permissions to the DynamoDB table.
	// Experimental.
	ReadOnlyAccess *bool `field:"optional" json:"readOnlyAccess" yaml:"readOnlyAccess"`
	// use credentials of caller to access DynamoDB.
	// Experimental.
	UseCallerCredentials *bool `field:"optional" json:"useCallerCredentials" yaml:"useCallerCredentials"`
}

Properties for an AppSync DynamoDB datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi
var role role
var table table

dynamoDbDataSourceProps := &dynamoDbDataSourceProps{
	api: graphqlApi,
	table: table,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	readOnlyAccess: jsii.Boolean(false),
	serviceRole: role,
	useCallerCredentials: jsii.Boolean(false),
}

Experimental.

type ElasticsearchDataSource deprecated

type ElasticsearchDataSource interface {
	BackedDataSource
	// Deprecated: - use `OpenSearchDataSource`.
	Api() IGraphqlApi
	// Deprecated: - use `OpenSearchDataSource`.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Deprecated: - use `OpenSearchDataSource`.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Deprecated: - use `OpenSearchDataSource`.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Deprecated: - use `OpenSearchDataSource`.
	Name() *string
	// The construct tree node associated with this construct.
	// Deprecated: - use `OpenSearchDataSource`.
	Node() awscdk.ConstructNode
	// Deprecated: - use `OpenSearchDataSource`.
	ServiceRole() awsiam.IRole
	// Deprecated: - use `OpenSearchDataSource`.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Deprecated: - use `OpenSearchDataSource`.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Deprecated: - use `OpenSearchDataSource`.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Deprecated: - use `OpenSearchDataSource`.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Deprecated: - use `OpenSearchDataSource`.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Deprecated: - use `OpenSearchDataSource`.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Deprecated: - use `OpenSearchDataSource`.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Deprecated: - use `OpenSearchDataSource`.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Deprecated: - use `OpenSearchDataSource`.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Deprecated: - use `OpenSearchDataSource`.
	Validate() *[]*string
}

An Appsync datasource backed by Elasticsearch.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var domain domain
var graphqlApi graphqlApi
var role role

elasticsearchDataSource := awscdk.Aws_appsync.NewElasticsearchDataSource(this, jsii.String("MyElasticsearchDataSource"), &elasticsearchDataSourceProps{
	api: graphqlApi,
	domain: domain,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
})

Deprecated: - use `OpenSearchDataSource`.

func NewElasticsearchDataSource deprecated

func NewElasticsearchDataSource(scope constructs.Construct, id *string, props *ElasticsearchDataSourceProps) ElasticsearchDataSource

Deprecated: - use `OpenSearchDataSource`.

type ElasticsearchDataSourceProps deprecated

type ElasticsearchDataSourceProps struct {
	// The API to attach this data source to.
	// Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
	// The elasticsearch domain containing the endpoint for the data source.
	// Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.
	Domain awselasticsearch.IDomain `field:"required" json:"domain" yaml:"domain"`
}

Properties for the Elasticsearch Data Source.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var domain domain
var graphqlApi graphqlApi
var role role

elasticsearchDataSourceProps := &elasticsearchDataSourceProps{
	api: graphqlApi,
	domain: domain,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
}

Deprecated: - use `OpenSearchDataSourceProps` with `OpenSearchDataSource`.

type EnumType

type EnumType interface {
	IIntermediateType
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the authorization modes for this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// the name of this type.
	// Experimental.
	Name() *string
	// Add a field to this Enum Type.
	//
	// To add a field to this Enum Type, you must only configure
	// addField with the fieldName options.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create an GraphQL Type representing this Enum Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the string of this enum type.
	// Experimental.
	ToString() *string
}

Enum Types are abstract types that includes a set of fields that represent the strings this type can create.

Example:

var api graphqlApi

episode := appsync.NewEnumType(jsii.String("Episode"), &enumTypeOptions{
	definition: []*string{
		jsii.String("NEWHOPE"),
		jsii.String("EMPIRE"),
		jsii.String("JEDI"),
	},
})
api.addType(episode)

Experimental.

func NewEnumType

func NewEnumType(name *string, options *EnumTypeOptions) EnumType

Experimental.

type EnumTypeOptions

type EnumTypeOptions struct {
	// the attributes of this type.
	// Experimental.
	Definition *[]*string `field:"required" json:"definition" yaml:"definition"`
}

Properties for configuring an Enum Type.

Example:

var api graphqlApi

episode := appsync.NewEnumType(jsii.String("Episode"), &enumTypeOptions{
	definition: []*string{
		jsii.String("NEWHOPE"),
		jsii.String("EMPIRE"),
		jsii.String("JEDI"),
	},
})
api.addType(episode)

Experimental.

type ExtendedDataSourceProps

type ExtendedDataSourceProps struct {
	// the type of the AppSync datasource.
	// Experimental.
	Type *string `field:"required" json:"type" yaml:"type"`
	// configuration for DynamoDB Datasource.
	// Experimental.
	DynamoDbConfig interface{} `field:"optional" json:"dynamoDbConfig" yaml:"dynamoDbConfig"`
	// configuration for Elasticsearch data source.
	// Deprecated: - use `openSearchConfig`.
	ElasticsearchConfig interface{} `field:"optional" json:"elasticsearchConfig" yaml:"elasticsearchConfig"`
	// configuration for HTTP Datasource.
	// Experimental.
	HttpConfig interface{} `field:"optional" json:"httpConfig" yaml:"httpConfig"`
	// configuration for Lambda Datasource.
	// Experimental.
	LambdaConfig interface{} `field:"optional" json:"lambdaConfig" yaml:"lambdaConfig"`
	// configuration for OpenSearch data source.
	// Experimental.
	OpenSearchServiceConfig interface{} `field:"optional" json:"openSearchServiceConfig" yaml:"openSearchServiceConfig"`
	// configuration for RDS Datasource.
	// Experimental.
	RelationalDatabaseConfig interface{} `field:"optional" json:"relationalDatabaseConfig" yaml:"relationalDatabaseConfig"`
}

props used by implementations of BaseDataSource to provide configuration.

Should not be used directly.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

extendedDataSourceProps := &extendedDataSourceProps{
	type: jsii.String("type"),

	// the properties below are optional
	dynamoDbConfig: &dynamoDBConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		tableName: jsii.String("tableName"),

		// the properties below are optional
		deltaSyncConfig: &deltaSyncConfigProperty{
			baseTableTtl: jsii.String("baseTableTtl"),
			deltaSyncTableName: jsii.String("deltaSyncTableName"),
			deltaSyncTableTtl: jsii.String("deltaSyncTableTtl"),
		},
		useCallerCredentials: jsii.Boolean(false),
		versioned: jsii.Boolean(false),
	},
	elasticsearchConfig: &elasticsearchConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	httpConfig: &httpConfigProperty{
		endpoint: jsii.String("endpoint"),

		// the properties below are optional
		authorizationConfig: &authorizationConfigProperty{
			authorizationType: jsii.String("authorizationType"),

			// the properties below are optional
			awsIamConfig: &awsIamConfigProperty{
				signingRegion: jsii.String("signingRegion"),
				signingServiceName: jsii.String("signingServiceName"),
			},
		},
	},
	lambdaConfig: &lambdaConfigProperty{
		lambdaFunctionArn: jsii.String("lambdaFunctionArn"),
	},
	openSearchServiceConfig: &openSearchServiceConfigProperty{
		awsRegion: jsii.String("awsRegion"),
		endpoint: jsii.String("endpoint"),
	},
	relationalDatabaseConfig: &relationalDatabaseConfigProperty{
		relationalDatabaseSourceType: jsii.String("relationalDatabaseSourceType"),

		// the properties below are optional
		rdsHttpEndpointConfig: &rdsHttpEndpointConfigProperty{
			awsRegion: jsii.String("awsRegion"),
			awsSecretStoreArn: jsii.String("awsSecretStoreArn"),
			dbClusterIdentifier: jsii.String("dbClusterIdentifier"),

			// the properties below are optional
			databaseName: jsii.String("databaseName"),
			schema: jsii.String("schema"),
		},
	},
}

Experimental.

type ExtendedResolverProps

type ExtendedResolverProps struct {
	// name of the GraphQL field in the given type this resolver is attached to.
	// Experimental.
	FieldName *string `field:"required" json:"fieldName" yaml:"fieldName"`
	// name of the GraphQL type this resolver is attached to.
	// Experimental.
	TypeName *string `field:"required" json:"typeName" yaml:"typeName"`
	// The caching configuration for this resolver.
	// Experimental.
	CachingConfig *CachingConfig `field:"optional" json:"cachingConfig" yaml:"cachingConfig"`
	// configuration of the pipeline resolver.
	// Experimental.
	PipelineConfig *[]IAppsyncFunction `field:"optional" json:"pipelineConfig" yaml:"pipelineConfig"`
	// The request mapping template for this resolver.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// The response mapping template for this resolver.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
	// The data source this resolver is using.
	// Experimental.
	DataSource BaseDataSource `field:"optional" json:"dataSource" yaml:"dataSource"`
}

Additional property for an AppSync resolver for data source reference.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import monocdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var appsyncFunction appsyncFunction
var baseDataSource baseDataSource
var duration duration
var mappingTemplate mappingTemplate

extendedResolverProps := &extendedResolverProps{
	fieldName: jsii.String("fieldName"),
	typeName: jsii.String("typeName"),

	// the properties below are optional
	cachingConfig: &cachingConfig{
		ttl: duration,

		// the properties below are optional
		cachingKeys: []*string{
			jsii.String("cachingKeys"),
		},
	},
	dataSource: baseDataSource,
	pipelineConfig: []iAppsyncFunction{
		appsyncFunction,
	},
	requestMappingTemplate: mappingTemplate,
	responseMappingTemplate: mappingTemplate,
}

Experimental.

type Field

type Field interface {
	GraphqlType
	IField
	// The options for this field.
	// Experimental.
	FieldOptions() *ResolvableFieldOptions
	// the intermediate type linked to this attribute (i.e. an interface or an object).
	// Experimental.
	IntermediateType() IIntermediateType
	// property determining if this attribute is a list i.e. if true, attribute would be `[Type]`.
	// Experimental.
	IsList() *bool
	// property determining if this attribute is non-nullable i.e. if true, attribute would be `Type!` and this attribute must always have a value.
	// Experimental.
	IsRequired() *bool
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be `[ Type ]!` and this attribute's list must always have a value.
	// Experimental.
	IsRequiredList() *bool
	// the type of attribute.
	// Experimental.
	Type() Type
	// Generate the args string of this resolvable field.
	// Experimental.
	ArgsToString() *string
	// Generate the directives for this field.
	// Experimental.
	DirectivesToString(modes *[]AuthorizationType) *string
	// Generate the string for this attribute.
	// Experimental.
	ToString() *string
}

Fields build upon Graphql Types and provide typing and arguments.

Example:

field := appsync.NewField(&fieldOptions{
	returnType: appsync.graphqlType.string(),
	args: map[string]*graphqlType{
		"argument": appsync.*graphqlType.string(),
	},
})
type := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"test": field,
	},
})

Experimental.

func NewField

func NewField(options *FieldOptions) Field

Experimental.

type FieldLogLevel

type FieldLogLevel string

log-level for fields in AppSync. Experimental.

const (
	// No logging.
	// Experimental.
	FieldLogLevel_NONE FieldLogLevel = "NONE"
	// Error logging.
	// Experimental.
	FieldLogLevel_ERROR FieldLogLevel = "ERROR"
	// All logging.
	// Experimental.
	FieldLogLevel_ALL FieldLogLevel = "ALL"
)

type FieldOptions

type FieldOptions struct {
	// The return type for this field.
	// Experimental.
	ReturnType GraphqlType `field:"required" json:"returnType" yaml:"returnType"`
	// The arguments for this field.
	//
	// i.e. type Example (first: String second: String) {}
	// - where 'first' and 'second' are key values for args
	// and 'String' is the GraphqlType.
	// Experimental.
	Args *map[string]GraphqlType `field:"optional" json:"args" yaml:"args"`
	// the directives for this field.
	// Experimental.
	Directives *[]Directive `field:"optional" json:"directives" yaml:"directives"`
}

Properties for configuring a field.

Example:

field := appsync.NewField(&fieldOptions{
	returnType: appsync.graphqlType.string(),
	args: map[string]*graphqlType{
		"argument": appsync.*graphqlType.string(),
	},
})
type := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"test": field,
	},
})

Experimental.

type GraphqlApi

type GraphqlApi interface {
	GraphqlApiBase
	// an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
	// Experimental.
	ApiId() *string
	// the configured API key, if present.
	// Experimental.
	ApiKey() *string
	// the ARN of the API.
	// Experimental.
	Arn() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// the URL of the endpoint created by AppSync.
	// Experimental.
	GraphqlUrl() *string
	// The Authorization Types for this GraphQL Api.
	// Experimental.
	Modes() *[]AuthorizationType
	// the name of the API.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// the schema attached to this api.
	// Experimental.
	Schema() Schema
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// add a new DynamoDB data source to this API.
	// Experimental.
	AddDynamoDbDataSource(id *string, table awsdynamodb.ITable, options *DataSourceOptions) DynamoDbDataSource
	// add a new elasticsearch data source to this API.
	// Deprecated: - use `addOpenSearchDataSource`.
	AddElasticsearchDataSource(id *string, domain awselasticsearch.IDomain, options *DataSourceOptions) ElasticsearchDataSource
	// add a new http data source to this API.
	// Experimental.
	AddHttpDataSource(id *string, endpoint *string, options *HttpDataSourceOptions) HttpDataSource
	// add a new Lambda data source to this API.
	// Experimental.
	AddLambdaDataSource(id *string, lambdaFunction awslambda.IFunction, options *DataSourceOptions) LambdaDataSource
	// Add a mutation field to the schema's Mutation. CDK will create an Object Type called 'Mutation'. For example,.
	//
	// type Mutation {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddMutation(fieldName *string, field ResolvableField) ObjectType
	// add a new dummy data source to this API.
	//
	// Useful for pipeline resolvers
	// and for backend changes that don't require a data source.
	// Experimental.
	AddNoneDataSource(id *string, options *DataSourceOptions) NoneDataSource
	// add a new OpenSearch data source to this API.
	// Experimental.
	AddOpenSearchDataSource(id *string, domain awsopensearchservice.IDomain, options *DataSourceOptions) OpenSearchDataSource
	// Add a query field to the schema's Query. CDK will create an Object Type called 'Query'. For example,.
	//
	// type Query {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddQuery(fieldName *string, field ResolvableField) ObjectType
	// add a new Rds data source to this API.
	// Experimental.
	AddRdsDataSource(id *string, serverlessCluster awsrds.IServerlessCluster, secretStore awssecretsmanager.ISecret, databaseName *string, options *DataSourceOptions) RdsDataSource
	// Add schema dependency to a given construct.
	// Experimental.
	AddSchemaDependency(construct awscdk.CfnResource) *bool
	// Add a subscription field to the schema's Subscription. CDK will create an Object Type called 'Subscription'. For example,.
	//
	// type Subscription {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddSubscription(fieldName *string, field ResolvableField) ObjectType
	// Escape hatch to append to Schema as desired.
	//
	// Will always result
	// in a newline.
	// Experimental.
	AddToSchema(addition *string, delimiter *string)
	// Add type to the schema.
	// Experimental.
	AddType(type_ IIntermediateType) IIntermediateType
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *ExtendedResolverProps) Resolver
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.
	// Experimental.
	Grant(grantee awsiam.IGrantable, resources IamResource, actions ...*string) awsiam.Grant
	// Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.
	// Experimental.
	GrantMutation(grantee awsiam.IGrantable, fields ...*string) awsiam.Grant
	// Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.
	// Experimental.
	GrantQuery(grantee awsiam.IGrantable, fields ...*string) awsiam.Grant
	// Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.
	// Experimental.
	GrantSubscription(grantee awsiam.IGrantable, fields ...*string) awsiam.Grant
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync GraphQL API.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
})
demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
		"version": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

api.addType(demo)

Experimental.

func NewGraphqlApi

func NewGraphqlApi(scope constructs.Construct, id *string, props *GraphqlApiProps) GraphqlApi

Experimental.

type GraphqlApiAttributes

type GraphqlApiAttributes struct {
	// an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
	// Experimental.
	GraphqlApiId *string `field:"required" json:"graphqlApiId" yaml:"graphqlApiId"`
	// the arn for the GraphQL Api.
	// Experimental.
	GraphqlApiArn *string `field:"optional" json:"graphqlApiArn" yaml:"graphqlApiArn"`
}

Attributes for GraphQL imports.

Example:

var api graphqlApi
var table table

importedApi := appsync.graphqlApi.fromGraphqlApiAttributes(this, jsii.String("IApi"), &graphqlApiAttributes{
	graphqlApiId: api.apiId,
	graphqlApiArn: api.arn,
})
importedApi.addDynamoDbDataSource(jsii.String("TableDataSource"), table)

Experimental.

type GraphqlApiBase

type GraphqlApiBase interface {
	awscdk.Resource
	IGraphqlApi
	// an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
	// Experimental.
	ApiId() *string
	// the ARN of the API.
	// Experimental.
	Arn() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// add a new DynamoDB data source to this API.
	// Experimental.
	AddDynamoDbDataSource(id *string, table awsdynamodb.ITable, options *DataSourceOptions) DynamoDbDataSource
	// add a new elasticsearch data source to this API.
	// Deprecated: - use `addOpenSearchDataSource`.
	AddElasticsearchDataSource(id *string, domain awselasticsearch.IDomain, options *DataSourceOptions) ElasticsearchDataSource
	// add a new http data source to this API.
	// Experimental.
	AddHttpDataSource(id *string, endpoint *string, options *HttpDataSourceOptions) HttpDataSource
	// add a new Lambda data source to this API.
	// Experimental.
	AddLambdaDataSource(id *string, lambdaFunction awslambda.IFunction, options *DataSourceOptions) LambdaDataSource
	// add a new dummy data source to this API.
	//
	// Useful for pipeline resolvers
	// and for backend changes that don't require a data source.
	// Experimental.
	AddNoneDataSource(id *string, options *DataSourceOptions) NoneDataSource
	// add a new OpenSearch data source to this API.
	// Experimental.
	AddOpenSearchDataSource(id *string, domain awsopensearchservice.IDomain, options *DataSourceOptions) OpenSearchDataSource
	// add a new Rds data source to this API.
	// Experimental.
	AddRdsDataSource(id *string, serverlessCluster awsrds.IServerlessCluster, secretStore awssecretsmanager.ISecret, databaseName *string, options *DataSourceOptions) RdsDataSource
	// Add schema dependency if not imported.
	// Experimental.
	AddSchemaDependency(construct awscdk.CfnResource) *bool
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *ExtendedResolverProps) Resolver
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

Base Class for GraphQL API. Experimental.

type GraphqlApiProps

type GraphqlApiProps struct {
	// the name of the GraphQL API.
	// Experimental.
	Name *string `field:"required" json:"name" yaml:"name"`
	// Optional authorization configuration.
	// Experimental.
	AuthorizationConfig *AuthorizationConfig `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"`
	// The domain name configuration for the GraphQL API.
	//
	// The Route 53 hosted zone and CName DNS record must be configured in addition to this setting to
	// enable custom domain URL.
	// Experimental.
	DomainName *DomainOptions `field:"optional" json:"domainName" yaml:"domainName"`
	// Logging configuration for this api.
	// Experimental.
	LogConfig *LogConfig `field:"optional" json:"logConfig" yaml:"logConfig"`
	// GraphQL schema definition. Specify how you want to define your schema.
	//
	// Schema.fromFile(filePath: string) allows schema definition through schema.graphql file
	// Experimental.
	Schema Schema `field:"optional" json:"schema" yaml:"schema"`
	// A flag indicating whether or not X-Ray tracing is enabled for the GraphQL API.
	// Experimental.
	XrayEnabled *bool `field:"optional" json:"xrayEnabled" yaml:"xrayEnabled"`
}

Properties for an AppSync GraphQL API.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
})
demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
		"version": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

api.addType(demo)

Experimental.

type GraphqlType

type GraphqlType interface {
	IField
	// the intermediate type linked to this attribute (i.e. an interface or an object).
	// Experimental.
	IntermediateType() IIntermediateType
	// property determining if this attribute is a list i.e. if true, attribute would be `[Type]`.
	// Experimental.
	IsList() *bool
	// property determining if this attribute is non-nullable i.e. if true, attribute would be `Type!` and this attribute must always have a value.
	// Experimental.
	IsRequired() *bool
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be `[ Type ]!` and this attribute's list must always have a value.
	// Experimental.
	IsRequiredList() *bool
	// the type of attribute.
	// Experimental.
	Type() Type
	// Generate the arguments for this field.
	// Experimental.
	ArgsToString() *string
	// Generate the directives for this field.
	// Experimental.
	DirectivesToString(_modes *[]AuthorizationType) *string
	// Generate the string for this attribute.
	// Experimental.
	ToString() *string
}

The GraphQL Types in AppSync's GraphQL.

GraphQL Types are the building blocks for object types, queries, mutations, etc. They are types like String, Int, Id or even Object Types you create.

i.e. `String`, `String!`, `[String]`, `[String!]`, `[String]!`

GraphQL Types are used to define the entirety of schema.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

func Field_AwsDate

func Field_AwsDate(options *BaseTypeOptions) GraphqlType

`AWSDate` scalar type represents a valid extended `ISO 8601 Date` string.

In other words, accepts date strings in the form of `YYYY-MM-DD`. It accepts time zone offsets. Experimental.

func Field_AwsDateTime

func Field_AwsDateTime(options *BaseTypeOptions) GraphqlType

`AWSDateTime` scalar type represents a valid extended `ISO 8601 DateTime` string.

In other words, accepts date strings in the form of `YYYY-MM-DDThh:mm:ss.sssZ`. It accepts time zone offsets. Experimental.

func Field_AwsEmail

func Field_AwsEmail(options *BaseTypeOptions) GraphqlType

`AWSEmail` scalar type represents an email address string (i.e.`username@example.com`). Experimental.

func Field_AwsIpAddress

func Field_AwsIpAddress(options *BaseTypeOptions) GraphqlType

`AWSIPAddress` scalar type respresents a valid `IPv4` of `IPv6` address string. Experimental.

func Field_AwsJson

func Field_AwsJson(options *BaseTypeOptions) GraphqlType

`AWSJson` scalar type represents a JSON string. Experimental.

func Field_AwsPhone

func Field_AwsPhone(options *BaseTypeOptions) GraphqlType

`AWSPhone` scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.

The number can specify a country code at the beginning, but is not required for US phone numbers. Experimental.

func Field_AwsTime

func Field_AwsTime(options *BaseTypeOptions) GraphqlType

`AWSTime` scalar type represents a valid extended `ISO 8601 Time` string.

In other words, accepts date strings in the form of `hh:mm:ss.sss`. It accepts time zone offsets. Experimental.

func Field_AwsTimestamp

func Field_AwsTimestamp(options *BaseTypeOptions) GraphqlType

`AWSTimestamp` scalar type represents the number of seconds since `1970-01-01T00:00Z`.

Timestamps are serialized and deserialized as numbers. Experimental.

func Field_AwsUrl

func Field_AwsUrl(options *BaseTypeOptions) GraphqlType

`AWSURL` scalar type represetns a valid URL string.

URLs wihtout schemes or contain double slashes are considered invalid. Experimental.

func Field_Boolean

func Field_Boolean(options *BaseTypeOptions) GraphqlType

`Boolean` scalar type is a boolean value: true or false. Experimental.

func Field_Float

func Field_Float(options *BaseTypeOptions) GraphqlType

`Float` scalar type is a signed double-precision fractional value. Experimental.

func Field_Id

func Field_Id(options *BaseTypeOptions) GraphqlType

`ID` scalar type is a unique identifier. `ID` type is serialized similar to `String`.

Often used as a key for a cache and not intended to be human-readable. Experimental.

func Field_Int

func Field_Int(options *BaseTypeOptions) GraphqlType

`Int` scalar type is a signed non-fractional numerical value. Experimental.

func Field_Intermediate

func Field_Intermediate(options *GraphqlTypeOptions) GraphqlType

an intermediate type to be added as an attribute (i.e. an interface or an object type). Experimental.

func Field_String

func Field_String(options *BaseTypeOptions) GraphqlType

`String` scalar type is a free-form human-readable text. Experimental.

func GraphqlType_AwsDate

func GraphqlType_AwsDate(options *BaseTypeOptions) GraphqlType

`AWSDate` scalar type represents a valid extended `ISO 8601 Date` string.

In other words, accepts date strings in the form of `YYYY-MM-DD`. It accepts time zone offsets. Experimental.

func GraphqlType_AwsDateTime

func GraphqlType_AwsDateTime(options *BaseTypeOptions) GraphqlType

`AWSDateTime` scalar type represents a valid extended `ISO 8601 DateTime` string.

In other words, accepts date strings in the form of `YYYY-MM-DDThh:mm:ss.sssZ`. It accepts time zone offsets. Experimental.

func GraphqlType_AwsEmail

func GraphqlType_AwsEmail(options *BaseTypeOptions) GraphqlType

`AWSEmail` scalar type represents an email address string (i.e.`username@example.com`). Experimental.

func GraphqlType_AwsIpAddress

func GraphqlType_AwsIpAddress(options *BaseTypeOptions) GraphqlType

`AWSIPAddress` scalar type respresents a valid `IPv4` of `IPv6` address string. Experimental.

func GraphqlType_AwsJson

func GraphqlType_AwsJson(options *BaseTypeOptions) GraphqlType

`AWSJson` scalar type represents a JSON string. Experimental.

func GraphqlType_AwsPhone

func GraphqlType_AwsPhone(options *BaseTypeOptions) GraphqlType

`AWSPhone` scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.

The number can specify a country code at the beginning, but is not required for US phone numbers. Experimental.

func GraphqlType_AwsTime

func GraphqlType_AwsTime(options *BaseTypeOptions) GraphqlType

`AWSTime` scalar type represents a valid extended `ISO 8601 Time` string.

In other words, accepts date strings in the form of `hh:mm:ss.sss`. It accepts time zone offsets. Experimental.

func GraphqlType_AwsTimestamp

func GraphqlType_AwsTimestamp(options *BaseTypeOptions) GraphqlType

`AWSTimestamp` scalar type represents the number of seconds since `1970-01-01T00:00Z`.

Timestamps are serialized and deserialized as numbers. Experimental.

func GraphqlType_AwsUrl

func GraphqlType_AwsUrl(options *BaseTypeOptions) GraphqlType

`AWSURL` scalar type represetns a valid URL string.

URLs wihtout schemes or contain double slashes are considered invalid. Experimental.

func GraphqlType_Boolean

func GraphqlType_Boolean(options *BaseTypeOptions) GraphqlType

`Boolean` scalar type is a boolean value: true or false. Experimental.

func GraphqlType_Float

func GraphqlType_Float(options *BaseTypeOptions) GraphqlType

`Float` scalar type is a signed double-precision fractional value. Experimental.

func GraphqlType_Id

func GraphqlType_Id(options *BaseTypeOptions) GraphqlType

`ID` scalar type is a unique identifier. `ID` type is serialized similar to `String`.

Often used as a key for a cache and not intended to be human-readable. Experimental.

func GraphqlType_Int

func GraphqlType_Int(options *BaseTypeOptions) GraphqlType

`Int` scalar type is a signed non-fractional numerical value. Experimental.

func GraphqlType_Intermediate

func GraphqlType_Intermediate(options *GraphqlTypeOptions) GraphqlType

an intermediate type to be added as an attribute (i.e. an interface or an object type). Experimental.

func GraphqlType_String

func GraphqlType_String(options *BaseTypeOptions) GraphqlType

`String` scalar type is a free-form human-readable text. Experimental.

func NewGraphqlType

func NewGraphqlType(type_ Type, options *GraphqlTypeOptions) GraphqlType

Experimental.

func ResolvableField_AwsDate

func ResolvableField_AwsDate(options *BaseTypeOptions) GraphqlType

`AWSDate` scalar type represents a valid extended `ISO 8601 Date` string.

In other words, accepts date strings in the form of `YYYY-MM-DD`. It accepts time zone offsets. Experimental.

func ResolvableField_AwsDateTime

func ResolvableField_AwsDateTime(options *BaseTypeOptions) GraphqlType

`AWSDateTime` scalar type represents a valid extended `ISO 8601 DateTime` string.

In other words, accepts date strings in the form of `YYYY-MM-DDThh:mm:ss.sssZ`. It accepts time zone offsets. Experimental.

func ResolvableField_AwsEmail

func ResolvableField_AwsEmail(options *BaseTypeOptions) GraphqlType

`AWSEmail` scalar type represents an email address string (i.e.`username@example.com`). Experimental.

func ResolvableField_AwsIpAddress

func ResolvableField_AwsIpAddress(options *BaseTypeOptions) GraphqlType

`AWSIPAddress` scalar type respresents a valid `IPv4` of `IPv6` address string. Experimental.

func ResolvableField_AwsJson

func ResolvableField_AwsJson(options *BaseTypeOptions) GraphqlType

`AWSJson` scalar type represents a JSON string. Experimental.

func ResolvableField_AwsPhone

func ResolvableField_AwsPhone(options *BaseTypeOptions) GraphqlType

`AWSPhone` scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.

The number can specify a country code at the beginning, but is not required for US phone numbers. Experimental.

func ResolvableField_AwsTime

func ResolvableField_AwsTime(options *BaseTypeOptions) GraphqlType

`AWSTime` scalar type represents a valid extended `ISO 8601 Time` string.

In other words, accepts date strings in the form of `hh:mm:ss.sss`. It accepts time zone offsets. Experimental.

func ResolvableField_AwsTimestamp

func ResolvableField_AwsTimestamp(options *BaseTypeOptions) GraphqlType

`AWSTimestamp` scalar type represents the number of seconds since `1970-01-01T00:00Z`.

Timestamps are serialized and deserialized as numbers. Experimental.

func ResolvableField_AwsUrl

func ResolvableField_AwsUrl(options *BaseTypeOptions) GraphqlType

`AWSURL` scalar type represetns a valid URL string.

URLs wihtout schemes or contain double slashes are considered invalid. Experimental.

func ResolvableField_Boolean

func ResolvableField_Boolean(options *BaseTypeOptions) GraphqlType

`Boolean` scalar type is a boolean value: true or false. Experimental.

func ResolvableField_Float

func ResolvableField_Float(options *BaseTypeOptions) GraphqlType

`Float` scalar type is a signed double-precision fractional value. Experimental.

func ResolvableField_Id

func ResolvableField_Id(options *BaseTypeOptions) GraphqlType

`ID` scalar type is a unique identifier. `ID` type is serialized similar to `String`.

Often used as a key for a cache and not intended to be human-readable. Experimental.

func ResolvableField_Int

func ResolvableField_Int(options *BaseTypeOptions) GraphqlType

`Int` scalar type is a signed non-fractional numerical value. Experimental.

func ResolvableField_Intermediate

func ResolvableField_Intermediate(options *GraphqlTypeOptions) GraphqlType

an intermediate type to be added as an attribute (i.e. an interface or an object type). Experimental.

func ResolvableField_String

func ResolvableField_String(options *BaseTypeOptions) GraphqlType

`String` scalar type is a free-form human-readable text. Experimental.

type GraphqlTypeOptions

type GraphqlTypeOptions struct {
	// property determining if this attribute is a list i.e. if true, attribute would be [Type].
	// Experimental.
	IsList *bool `field:"optional" json:"isList" yaml:"isList"`
	// property determining if this attribute is non-nullable i.e. if true, attribute would be Type!
	// Experimental.
	IsRequired *bool `field:"optional" json:"isRequired" yaml:"isRequired"`
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be [ Type ]! or if isRequired true, attribe would be [ Type! ]!
	// Experimental.
	IsRequiredList *bool `field:"optional" json:"isRequiredList" yaml:"isRequiredList"`
	// the intermediate type linked to this attribute.
	// Experimental.
	IntermediateType IIntermediateType `field:"optional" json:"intermediateType" yaml:"intermediateType"`
}

Options for GraphQL Types.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var intermediateType iIntermediateType

graphqlTypeOptions := &graphqlTypeOptions{
	intermediateType: intermediateType,
	isList: jsii.Boolean(false),
	isRequired: jsii.Boolean(false),
	isRequiredList: jsii.Boolean(false),
}

Experimental.

type HttpDataSource

type HttpDataSource interface {
	BackedDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync datasource backed by a http endpoint.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
})

httpDs := api.addHttpDataSource(jsii.String("ds"), jsii.String("https://states.amazonaws.com"), &httpDataSourceOptions{
	name: jsii.String("httpDsWithStepF"),
	description: jsii.String("from appsync to StepFunctions Workflow"),
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("us-east-1"),
		signingServiceName: jsii.String("states"),
	},
})

httpDs.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("callStepFunction"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

func NewHttpDataSource

func NewHttpDataSource(scope constructs.Construct, id *string, props *HttpDataSourceProps) HttpDataSource

Experimental.

type HttpDataSourceOptions

type HttpDataSourceOptions struct {
	// The description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source, overrides the id given by cdk.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The authorization config in case the HTTP endpoint requires authorization.
	// Experimental.
	AuthorizationConfig *AwsIamConfig `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"`
}

Optional configuration for Http data sources.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
})

httpDs := api.addHttpDataSource(jsii.String("ds"), jsii.String("https://states.amazonaws.com"), &httpDataSourceOptions{
	name: jsii.String("httpDsWithStepF"),
	description: jsii.String("from appsync to StepFunctions Workflow"),
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("us-east-1"),
		signingServiceName: jsii.String("states"),
	},
})

httpDs.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("callStepFunction"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

type HttpDataSourceProps

type HttpDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The http endpoint.
	// Experimental.
	Endpoint *string `field:"required" json:"endpoint" yaml:"endpoint"`
	// The authorization config in case the HTTP endpoint requires authorization.
	// Experimental.
	AuthorizationConfig *AwsIamConfig `field:"optional" json:"authorizationConfig" yaml:"authorizationConfig"`
}

Properties for an AppSync http datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi

httpDataSourceProps := &httpDataSourceProps{
	api: graphqlApi,
	endpoint: jsii.String("endpoint"),

	// the properties below are optional
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("signingRegion"),
		signingServiceName: jsii.String("signingServiceName"),
	},
	description: jsii.String("description"),
	name: jsii.String("name"),
}

Experimental.

type IAppsyncFunction

type IAppsyncFunction interface {
	awscdk.IResource
	// the ARN of the AppSync function.
	// Experimental.
	FunctionArn() *string
	// the name of this AppSync Function.
	// Experimental.
	FunctionId() *string
}

Interface for AppSync Functions. Experimental.

func AppsyncFunction_FromAppsyncFunctionAttributes

func AppsyncFunction_FromAppsyncFunctionAttributes(scope constructs.Construct, id *string, attrs *AppsyncFunctionAttributes) IAppsyncFunction

Import Appsync Function from arn. Experimental.

type IField

type IField interface {
	// Generate the arguments for this field.
	// Experimental.
	ArgsToString() *string
	// Generate the directives for this field.
	// Experimental.
	DirectivesToString(modes *[]AuthorizationType) *string
	// Generate the string for this attribute.
	// Experimental.
	ToString() *string
	// The options to make this field resolvable.
	// Experimental.
	FieldOptions() *ResolvableFieldOptions
	// the intermediate type linked to this attribute (i.e. an interface or an object).
	// Experimental.
	IntermediateType() IIntermediateType
	// property determining if this attribute is a list i.e. if true, attribute would be `[Type]`.
	// Experimental.
	IsList() *bool
	// property determining if this attribute is non-nullable i.e. if true, attribute would be `Type!` and this attribute must always have a value.
	// Experimental.
	IsRequired() *bool
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be `[ Type ]!` and this attribute's list must always have a value.
	// Experimental.
	IsRequiredList() *bool
	// the type of attribute.
	// Experimental.
	Type() Type
}

A Graphql Field. Experimental.

type IGraphqlApi

type IGraphqlApi interface {
	awscdk.IResource
	// add a new DynamoDB data source to this API.
	// Experimental.
	AddDynamoDbDataSource(id *string, table awsdynamodb.ITable, options *DataSourceOptions) DynamoDbDataSource
	// add a new elasticsearch data source to this API.
	// Deprecated: - use `addOpenSearchDataSource`.
	AddElasticsearchDataSource(id *string, domain awselasticsearch.IDomain, options *DataSourceOptions) ElasticsearchDataSource
	// add a new http data source to this API.
	// Experimental.
	AddHttpDataSource(id *string, endpoint *string, options *HttpDataSourceOptions) HttpDataSource
	// add a new Lambda data source to this API.
	// Experimental.
	AddLambdaDataSource(id *string, lambdaFunction awslambda.IFunction, options *DataSourceOptions) LambdaDataSource
	// add a new dummy data source to this API.
	//
	// Useful for pipeline resolvers
	// and for backend changes that don't require a data source.
	// Experimental.
	AddNoneDataSource(id *string, options *DataSourceOptions) NoneDataSource
	// Add a new OpenSearch data source to this API.
	// Experimental.
	AddOpenSearchDataSource(id *string, domain awsopensearchservice.IDomain, options *DataSourceOptions) OpenSearchDataSource
	// add a new Rds data source to this API.
	// Experimental.
	AddRdsDataSource(id *string, serverlessCluster awsrds.IServerlessCluster, secretStore awssecretsmanager.ISecret, databaseName *string, options *DataSourceOptions) RdsDataSource
	// Add schema dependency if not imported.
	// Experimental.
	AddSchemaDependency(construct awscdk.CfnResource) *bool
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *ExtendedResolverProps) Resolver
	// an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
	// Experimental.
	ApiId() *string
	// the ARN of the API.
	// Experimental.
	Arn() *string
}

Interface for GraphQL. Experimental.

func GraphqlApi_FromGraphqlApiAttributes

func GraphqlApi_FromGraphqlApiAttributes(scope constructs.Construct, id *string, attrs *GraphqlApiAttributes) IGraphqlApi

Import a GraphQL API through this function. Experimental.

type IIntermediateType

type IIntermediateType interface {
	// Add a field to this Intermediate Type.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create an GraphQL Type representing this Intermediate Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the string of this object type.
	// Experimental.
	ToString() *string
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the directives for this object type.
	// Experimental.
	Directives() *[]Directive
	// The Interface Types this Intermediate Type implements.
	// Experimental.
	InterfaceTypes() *[]InterfaceType
	// the intermediate type linked to this attribute (i.e. an interface or an object).
	// Experimental.
	IntermediateType() IIntermediateType
	// the name of this type.
	// Experimental.
	Name() *string
	// The resolvers linked to this data source.
	// Experimental.
	Resolvers() *[]Resolver
	// Experimental.
	SetResolvers(r *[]Resolver)
}

Intermediate Types are types that includes a certain set of fields that define the entirety of your schema. Experimental.

type IamResource

type IamResource interface {
	// Return the Resource ARN.
	// Experimental.
	ResourceArns(api GraphqlApi) *[]*string
}

A class used to generate resource arns for AppSync.

Example:

var api graphqlApi
role := iam.NewRole(this, jsii.String("Role"), &roleProps{
	assumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})

api.grant(role, appsync.iamResource.custom(jsii.String("types/Mutation/fields/updateExample")), jsii.String("appsync:GraphQL"))

Experimental.

func IamResource_All

func IamResource_All() IamResource

Generate the resource names that accepts all types: `*`. Experimental.

func IamResource_Custom

func IamResource_Custom(arns ...*string) IamResource

Generate the resource names given custom arns. Experimental.

func IamResource_OfType

func IamResource_OfType(type_ *string, fields ...*string) IamResource

Generate the resource names given a type and fields. Experimental.

type InputType

type InputType interface {
	IIntermediateType
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the authorization modes for this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// the name of this type.
	// Experimental.
	Name() *string
	// Add a field to this Input Type.
	//
	// Input Types must have both fieldName and field options.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create a GraphQL Type representing this Input Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the string of this input type.
	// Experimental.
	ToString() *string
}

Input Types are abstract types that define complex objects.

They are used in arguments to represent.

Example:

var api graphqlApi

review := appsync.NewInputType(jsii.String("Review"), &intermediateTypeOptions{
	definition: map[string]iField{
		"stars": appsync.GraphqlType.int(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
		"commentary": appsync.GraphqlType.string(),
	},
})
api.addType(review)

Experimental.

func NewInputType

func NewInputType(name *string, props *IntermediateTypeOptions) InputType

Experimental.

type InterfaceType

type InterfaceType interface {
	IIntermediateType
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the directives for this object type.
	// Experimental.
	Directives() *[]Directive
	// the authorization modes for this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// the name of this type.
	// Experimental.
	Name() *string
	// Add a field to this Interface Type.
	//
	// Interface Types must have both fieldName and field options.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create a GraphQL Type representing this Intermediate Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the string of this object type.
	// Experimental.
	ToString() *string
}

Interface Types are abstract types that includes a certain set of fields that other types must include if they implement the interface.

Example:

node := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})
demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
	interfaceTypes: []interfaceType{
		node,
	},
	definition: map[string]*iField{
		"version": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

Experimental.

func NewInterfaceType

func NewInterfaceType(name *string, props *IntermediateTypeOptions) InterfaceType

Experimental.

type IntermediateTypeOptions

type IntermediateTypeOptions struct {
	// the attributes of this type.
	// Experimental.
	Definition *map[string]IField `field:"required" json:"definition" yaml:"definition"`
	// the directives for this object type.
	// Experimental.
	Directives *[]Directive `field:"optional" json:"directives" yaml:"directives"`
}

Properties for configuring an Intermediate Type.

Example:

node := appsync.NewInterfaceType(jsii.String("Node"), &intermediateTypeOptions{
	definition: map[string]iField{
		"id": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})
demo := appsync.NewObjectType(jsii.String("Demo"), &objectTypeOptions{
	interfaceTypes: []interfaceType{
		node,
	},
	definition: map[string]*iField{
		"version": appsync.GraphqlType.string(&BaseTypeOptions{
			"isRequired": jsii.Boolean(true),
		}),
	},
})

Experimental.

type KeyCondition

type KeyCondition interface {
	// Conjunction between two conditions.
	// Experimental.
	And(keyCond KeyCondition) KeyCondition
	// Renders the key condition to a VTL string.
	// Experimental.
	RenderTemplate() *string
}

Factory class for DynamoDB key conditions.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keyCondition := awscdk.Aws_appsync.keyCondition.beginsWith(jsii.String("keyName"), jsii.String("arg"))

Experimental.

func KeyCondition_BeginsWith

func KeyCondition_BeginsWith(keyName *string, arg *string) KeyCondition

Condition (k, arg).

True if the key attribute k begins with the Query argument. Experimental.

func KeyCondition_Between

func KeyCondition_Between(keyName *string, arg1 *string, arg2 *string) KeyCondition

Condition k BETWEEN arg1 AND arg2, true if k >= arg1 and k <= arg2. Experimental.

func KeyCondition_Eq

func KeyCondition_Eq(keyName *string, arg *string) KeyCondition

Condition k = arg, true if the key attribute k is equal to the Query argument. Experimental.

func KeyCondition_Ge

func KeyCondition_Ge(keyName *string, arg *string) KeyCondition

Condition k >= arg, true if the key attribute k is greater or equal to the Query argument. Experimental.

func KeyCondition_Gt

func KeyCondition_Gt(keyName *string, arg *string) KeyCondition

Condition k > arg, true if the key attribute k is greater than the the Query argument. Experimental.

func KeyCondition_Le

func KeyCondition_Le(keyName *string, arg *string) KeyCondition

Condition k <= arg, true if the key attribute k is less than or equal to the Query argument. Experimental.

func KeyCondition_Lt

func KeyCondition_Lt(keyName *string, arg *string) KeyCondition

Condition k < arg, true if the key attribute k is less than the Query argument. Experimental.

type LambdaAuthorizerConfig

type LambdaAuthorizerConfig struct {
	// The authorizer lambda function.
	//
	// 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 do so with the AWS 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`
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html
	//
	// Experimental.
	Handler awslambda.IFunction `field:"required" json:"handler" yaml:"handler"`
	// How long the results are cached.
	//
	// Disable caching by setting this to 0.
	// Experimental.
	ResultsCacheTtl awscdk.Duration `field:"optional" json:"resultsCacheTtl" yaml:"resultsCacheTtl"`
	// A regular expression for validation of tokens before the Lambda function is called.
	// Experimental.
	ValidationRegex *string `field:"optional" json:"validationRegex" yaml:"validationRegex"`
}

Configuration for Lambda authorization in AppSync.

Note that you can only have a single AWS Lambda function configured to authorize your API.

Example:

import lambda "github.com/aws/aws-cdk-go/awscdk"
var authFunction function

appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("appsync.test.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_LAMBDA,
			lambdaAuthorizerConfig: &lambdaAuthorizerConfig{
				handler: authFunction,
			},
		},
	},
})

Experimental.

type LambdaDataSource

type LambdaDataSource interface {
	BackedDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync datasource backed by a Lambda function.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var graphqlApi graphqlApi
var role role

lambdaDataSource := awscdk.Aws_appsync.NewLambdaDataSource(this, jsii.String("MyLambdaDataSource"), &lambdaDataSourceProps{
	api: graphqlApi,
	lambdaFunction: function_,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
})

Experimental.

func NewLambdaDataSource

func NewLambdaDataSource(scope constructs.Construct, id *string, props *LambdaDataSourceProps) LambdaDataSource

Experimental.

type LambdaDataSourceProps

type LambdaDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Experimental.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
	// The Lambda function to call to interact with this data source.
	// Experimental.
	LambdaFunction awslambda.IFunction `field:"required" json:"lambdaFunction" yaml:"lambdaFunction"`
}

Properties for an AppSync Lambda datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var graphqlApi graphqlApi
var role role

lambdaDataSourceProps := &lambdaDataSourceProps{
	api: graphqlApi,
	lambdaFunction: function_,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
}

Experimental.

type LogConfig

type LogConfig struct {
	// exclude verbose content.
	// Experimental.
	ExcludeVerboseContent interface{} `field:"optional" json:"excludeVerboseContent" yaml:"excludeVerboseContent"`
	// log level for fields.
	// Experimental.
	FieldLogLevel FieldLogLevel `field:"optional" json:"fieldLogLevel" yaml:"fieldLogLevel"`
	// The role for CloudWatch Logs.
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Logging configuration for AppSync.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

logConfig := &logConfig{
	excludeVerboseContent: jsii.Boolean(false),
	fieldLogLevel: awscdk.Aws_appsync.fieldLogLevel_NONE,
	role: role,
}

Experimental.

type MappingTemplate

type MappingTemplate interface {
	// this is called to render the mapping template to a VTL string.
	// Experimental.
	RenderTemplate() *string
}

MappingTemplates for AppSync resolvers.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

func MappingTemplate_DynamoDbDeleteItem

func MappingTemplate_DynamoDbDeleteItem(keyName *string, idArg *string) MappingTemplate

Mapping template to delete a single item from a DynamoDB table. Experimental.

func MappingTemplate_DynamoDbGetItem

func MappingTemplate_DynamoDbGetItem(keyName *string, idArg *string) MappingTemplate

Mapping template to get a single item from a DynamoDB table. Experimental.

func MappingTemplate_DynamoDbPutItem

func MappingTemplate_DynamoDbPutItem(key PrimaryKey, values AttributeValues) MappingTemplate

Mapping template to save a single item to a DynamoDB table. Experimental.

func MappingTemplate_DynamoDbQuery

func MappingTemplate_DynamoDbQuery(cond KeyCondition, indexName *string) MappingTemplate

Mapping template to query a set of items from a DynamoDB table. Experimental.

func MappingTemplate_DynamoDbResultItem

func MappingTemplate_DynamoDbResultItem() MappingTemplate

Mapping template for a single result item from DynamoDB. Experimental.

func MappingTemplate_DynamoDbResultList

func MappingTemplate_DynamoDbResultList() MappingTemplate

Mapping template for a result list from DynamoDB. Experimental.

func MappingTemplate_DynamoDbScanTable

func MappingTemplate_DynamoDbScanTable() MappingTemplate

Mapping template to scan a DynamoDB table to fetch all entries. Experimental.

func MappingTemplate_FromFile

func MappingTemplate_FromFile(fileName *string) MappingTemplate

Create a mapping template from the given file. Experimental.

func MappingTemplate_FromString

func MappingTemplate_FromString(template *string) MappingTemplate

Create a mapping template from the given string. Experimental.

func MappingTemplate_LambdaRequest

func MappingTemplate_LambdaRequest(payload *string, operation *string) MappingTemplate

Mapping template to invoke a Lambda function. Experimental.

func MappingTemplate_LambdaResult

func MappingTemplate_LambdaResult() MappingTemplate

Mapping template to return the Lambda result to the caller. Experimental.

type NoneDataSource

type NoneDataSource interface {
	BaseDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync dummy datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi

noneDataSource := awscdk.Aws_appsync.NewNoneDataSource(this, jsii.String("MyNoneDataSource"), &noneDataSourceProps{
	api: graphqlApi,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
})

Experimental.

func NewNoneDataSource

func NewNoneDataSource(scope constructs.Construct, id *string, props *NoneDataSourceProps) NoneDataSource

Experimental.

type NoneDataSourceProps

type NoneDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
}

Properties for an AppSync dummy datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi

noneDataSourceProps := &noneDataSourceProps{
	api: graphqlApi,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
}

Experimental.

type ObjectType

type ObjectType interface {
	InterfaceType
	IIntermediateType
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the directives for this object type.
	// Experimental.
	Directives() *[]Directive
	// The Interface Types this Object Type implements.
	// Experimental.
	InterfaceTypes() *[]InterfaceType
	// the authorization modes for this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// the name of this type.
	// Experimental.
	Name() *string
	// The resolvers linked to this data source.
	// Experimental.
	Resolvers() *[]Resolver
	// Experimental.
	SetResolvers(val *[]Resolver)
	// Add a field to this Object Type.
	//
	// Object Types must have both fieldName and field options.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create a GraphQL Type representing this Intermediate Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the resolvers linked to this Object Type.
	// Experimental.
	GenerateResolver(api IGraphqlApi, fieldName *string, options *ResolvableFieldOptions) Resolver
	// Generate the string of this object type.
	// Experimental.
	ToString() *string
}

Object Types are types declared by you.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

func NewObjectType

func NewObjectType(name *string, props *ObjectTypeOptions) ObjectType

Experimental.

type ObjectTypeOptions

type ObjectTypeOptions struct {
	// the attributes of this type.
	// Experimental.
	Definition *map[string]IField `field:"required" json:"definition" yaml:"definition"`
	// the directives for this object type.
	// Experimental.
	Directives *[]Directive `field:"optional" json:"directives" yaml:"directives"`
	// The Interface Types this Object Type implements.
	// Experimental.
	InterfaceTypes *[]InterfaceType `field:"optional" json:"interfaceTypes" yaml:"interfaceTypes"`
}

Properties for configuring an Object Type.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

type OpenIdConnectConfig

type OpenIdConnectConfig struct {
	// The issuer for the OIDC configuration.
	//
	// The issuer returned by discovery must exactly match the value of `iss` in the OIDC token.
	// Experimental.
	OidcProvider *string `field:"required" json:"oidcProvider" yaml:"oidcProvider"`
	// The client identifier of the Relying party at the OpenID identity provider.
	//
	// A regular expression can be specified so AppSync can validate against multiple client identifiers at a time.
	//
	// Example:
	//   -"ABCD|CDEF"
	//
	// Experimental.
	ClientId *string `field:"optional" json:"clientId" yaml:"clientId"`
	// The number of milliseconds an OIDC token is valid after being authenticated by OIDC provider.
	//
	// `auth_time` claim in OIDC token is required for this validation to work.
	// Experimental.
	TokenExpiryFromAuth *float64 `field:"optional" json:"tokenExpiryFromAuth" yaml:"tokenExpiryFromAuth"`
	// The number of milliseconds an OIDC token is valid after being issued to a user.
	//
	// This validation uses `iat` claim of OIDC token.
	// Experimental.
	TokenExpiryFromIssue *float64 `field:"optional" json:"tokenExpiryFromIssue" yaml:"tokenExpiryFromIssue"`
}

Configuration for OpenID Connect authorization in AppSync.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

openIdConnectConfig := &openIdConnectConfig{
	oidcProvider: jsii.String("oidcProvider"),

	// the properties below are optional
	clientId: jsii.String("clientId"),
	tokenExpiryFromAuth: jsii.Number(123),
	tokenExpiryFromIssue: jsii.Number(123),
}

Experimental.

type OpenSearchDataSource

type OpenSearchDataSource interface {
	BackedDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An Appsync datasource backed by OpenSearch.

Example:

import opensearch "github.com/aws/aws-cdk-go/awscdk"

var api graphqlApi

user := iam.NewUser(this, jsii.String("User"))
domain := opensearch.NewDomain(this, jsii.String("Domain"), &domainProps{
	version: opensearch.engineVersion_OPENSEARCH_1_2(),
	removalPolicy: awscdk.RemovalPolicy_DESTROY,
	fineGrainedAccessControl: &advancedSecurityOptions{
		masterUserArn: user.userArn,
	},
	encryptionAtRest: &encryptionAtRestOptions{
		enabled: jsii.Boolean(true),
	},
	nodeToNodeEncryption: jsii.Boolean(true),
	enforceHttps: jsii.Boolean(true),
})
ds := api.addOpenSearchDataSource(jsii.String("ds"), domain)

ds.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getTests"),
	requestMappingTemplate: appsync.mappingTemplate.fromString(jSON.stringify(map[string]interface{}{
		"version": jsii.String("2017-02-28"),
		"operation": jsii.String("GET"),
		"path": jsii.String("/id/post/_search"),
		"params": map[string]map[string]interface{}{
			"headers": map[string]interface{}{
			},
			"queryString": map[string]interface{}{
			},
			"body": map[string]*f64{
				"from": jsii.Number(0),
				"size": jsii.Number(50),
			},
		},
	})),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("[\n    #foreach($entry in $context.result.hits.hits)\n    #if( $velocityCount > 1 ) , #end\n    $utils.toJson($entry.get(\"_source\"))\n    #end\n  ]")),
})

Experimental.

func NewOpenSearchDataSource

func NewOpenSearchDataSource(scope constructs.Construct, id *string, props *OpenSearchDataSourceProps) OpenSearchDataSource

Experimental.

type OpenSearchDataSourceProps

type OpenSearchDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Experimental.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
	// The OpenSearch domain containing the endpoint for the data source.
	// Experimental.
	Domain awsopensearchservice.IDomain `field:"required" json:"domain" yaml:"domain"`
}

Properties for the OpenSearch Data Source.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var domain domain
var graphqlApi graphqlApi
var role role

openSearchDataSourceProps := &openSearchDataSourceProps{
	api: graphqlApi,
	domain: domain,

	// the properties below are optional
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
}

Experimental.

type PartitionKey

type PartitionKey interface {
	PrimaryKey
	// Experimental.
	Pkey() Assign
	// Renders the key assignment to a VTL string.
	// Experimental.
	RenderTemplate() *string
	// Allows assigning a value to the sort key.
	// Experimental.
	Sort(key *string) SortKeyStep
}

Specifies the assignment to the partition key.

It can be enhanced with the assignment of the sort key.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign assign

partitionKey := awscdk.Aws_appsync.NewPartitionKey(assign)

Experimental.

func NewPartitionKey

func NewPartitionKey(pkey Assign) PartitionKey

Experimental.

type PartitionKeyStep

type PartitionKeyStep interface {
	// Assign an auto-generated value to the partition key.
	// Experimental.
	Auto() PartitionKey
	// Assign an auto-generated value to the partition key.
	// Experimental.
	Is(val *string) PartitionKey
}

Utility class to allow assigning a value or an auto-generated id to a partition key.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

partitionKeyStep := awscdk.Aws_appsync.NewPartitionKeyStep(jsii.String("key"))

Experimental.

func NewPartitionKeyStep

func NewPartitionKeyStep(key *string) PartitionKeyStep

Experimental.

func PartitionKey_Partition

func PartitionKey_Partition(key *string) PartitionKeyStep

Allows assigning a value to the partition key. Experimental.

func PrimaryKey_Partition

func PrimaryKey_Partition(key *string) PartitionKeyStep

Allows assigning a value to the partition key. Experimental.

type PrimaryKey

type PrimaryKey interface {
	// Experimental.
	Pkey() Assign
	// Renders the key assignment to a VTL string.
	// Experimental.
	RenderTemplate() *string
}

Specifies the assignment to the primary key.

It either contains the full primary key or only the partition key.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

func NewPrimaryKey

func NewPrimaryKey(pkey Assign, skey Assign) PrimaryKey

Experimental.

type RdsDataSource

type RdsDataSource interface {
	BackedDataSource
	// Experimental.
	Api() IGraphqlApi
	// Experimental.
	SetApi(val IGraphqlApi)
	// the underlying CFN data source resource.
	// Experimental.
	Ds() CfnDataSource
	// the principal of the data source to be IGrantable.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// the name of the data source.
	// Experimental.
	Name() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Experimental.
	ServiceRole() awsiam.IRole
	// Experimental.
	SetServiceRole(val awsiam.IRole)
	// creates a new appsync function for this datasource and API using the given properties.
	// Experimental.
	CreateFunction(props *BaseAppsyncFunctionProps) AppsyncFunction
	// creates a new resolver for this datasource and API using the given properties.
	// Experimental.
	CreateResolver(props *BaseResolverProps) Resolver
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync datasource backed by RDS.

Example:

// Build a data source for AppSync to access the database.
var api graphqlApi
// Create username and password secret for DB Cluster
secret := rds.NewDatabaseSecret(this, jsii.String("AuroraSecret"), &databaseSecretProps{
	username: jsii.String("clusteradmin"),
})

// The VPC to place the cluster in
vpc := ec2.NewVpc(this, jsii.String("AuroraVpc"))

// Create the serverless cluster, provide all values needed to customise the database.
cluster := rds.NewServerlessCluster(this, jsii.String("AuroraCluster"), &serverlessClusterProps{
	engine: rds.databaseClusterEngine_AURORA_MYSQL(),
	vpc: vpc,
	credentials: map[string]*string{
		"username": jsii.String("clusteradmin"),
	},
	clusterIdentifier: jsii.String("db-endpoint-test"),
	defaultDatabaseName: jsii.String("demos"),
})
rdsDS := api.addRdsDataSource(jsii.String("rds"), cluster, secret, jsii.String("demos"))

// Set up a resolver for an RDS query.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemosRds"),
	requestMappingTemplate: appsync.mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"SELECT * FROM demos\"\n    ]\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])\n  ")),
})

// Set up a resolver for an RDS mutation.
rdsDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemoRds"),
	requestMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n  {\n    \"version\": \"2018-05-29\",\n    \"statements\": [\n      \"INSERT INTO demos VALUES (:id, :version)\",\n      \"SELECT * WHERE id = :id\"\n    ],\n    \"variableMap\": {\n      \":id\": $util.toJson($util.autoId()),\n      \":version\": $util.toJson($ctx.args.version)\n    }\n  }\n  ")),
	responseMappingTemplate: appsync.*mappingTemplate.fromString(jsii.String("\n    $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])\n  ")),
})

Experimental.

func NewRdsDataSource

func NewRdsDataSource(scope constructs.Construct, id *string, props *RdsDataSourceProps) RdsDataSource

Experimental.

type RdsDataSourceProps

type RdsDataSourceProps struct {
	// The API to attach this data source to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
	// the description of the data source.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// The name of the data source.
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// The IAM service role to be assumed by AppSync to interact with the data source.
	// Experimental.
	ServiceRole awsiam.IRole `field:"optional" json:"serviceRole" yaml:"serviceRole"`
	// The secret containing the credentials for the database.
	// Experimental.
	SecretStore awssecretsmanager.ISecret `field:"required" json:"secretStore" yaml:"secretStore"`
	// The serverless cluster to call to interact with this data source.
	// Experimental.
	ServerlessCluster awsrds.IServerlessCluster `field:"required" json:"serverlessCluster" yaml:"serverlessCluster"`
	// The name of the database to use within the cluster.
	// Experimental.
	DatabaseName *string `field:"optional" json:"databaseName" yaml:"databaseName"`
}

Properties for an AppSync RDS datasource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var graphqlApi graphqlApi
var role role
var secret secret
var serverlessCluster serverlessCluster

rdsDataSourceProps := &rdsDataSourceProps{
	api: graphqlApi,
	secretStore: secret,
	serverlessCluster: serverlessCluster,

	// the properties below are optional
	databaseName: jsii.String("databaseName"),
	description: jsii.String("description"),
	name: jsii.String("name"),
	serviceRole: role,
}

Experimental.

type ResolvableField

type ResolvableField interface {
	Field
	IField
	// The options to make this field resolvable.
	// Experimental.
	FieldOptions() *ResolvableFieldOptions
	// the intermediate type linked to this attribute (i.e. an interface or an object).
	// Experimental.
	IntermediateType() IIntermediateType
	// property determining if this attribute is a list i.e. if true, attribute would be `[Type]`.
	// Experimental.
	IsList() *bool
	// property determining if this attribute is non-nullable i.e. if true, attribute would be `Type!` and this attribute must always have a value.
	// Experimental.
	IsRequired() *bool
	// property determining if this attribute is a non-nullable list i.e. if true, attribute would be `[ Type ]!` and this attribute's list must always have a value.
	// Experimental.
	IsRequiredList() *bool
	// the type of attribute.
	// Experimental.
	Type() Type
	// Generate the args string of this resolvable field.
	// Experimental.
	ArgsToString() *string
	// Generate the directives for this field.
	// Experimental.
	DirectivesToString(modes *[]AuthorizationType) *string
	// Generate the string for this attribute.
	// Experimental.
	ToString() *string
}

Resolvable Fields build upon Graphql Types and provide fields that can resolve into operations on a data source.

Example:

var api graphqlApi
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

info := appsync.NewObjectType(jsii.String("Info"), &objectTypeOptions{
	definition: map[string]iField{
		"node": appsync.NewResolvableField(&ResolvableFieldOptions{
			"returnType": appsync.GraphqlType.string(),
			"args": map[string]GraphqlType{
				"id": appsync.GraphqlType.string(),
			},
			"dataSource": api.addNoneDataSource(jsii.String("none")),
			"requestMappingTemplate": dummyRequest,
			"responseMappingTemplate": dummyResponse,
		}),
	},
})

Experimental.

func NewResolvableField

func NewResolvableField(options *ResolvableFieldOptions) ResolvableField

Experimental.

type ResolvableFieldOptions

type ResolvableFieldOptions struct {
	// The return type for this field.
	// Experimental.
	ReturnType GraphqlType `field:"required" json:"returnType" yaml:"returnType"`
	// The arguments for this field.
	//
	// i.e. type Example (first: String second: String) {}
	// - where 'first' and 'second' are key values for args
	// and 'String' is the GraphqlType.
	// Experimental.
	Args *map[string]GraphqlType `field:"optional" json:"args" yaml:"args"`
	// the directives for this field.
	// Experimental.
	Directives *[]Directive `field:"optional" json:"directives" yaml:"directives"`
	// The data source creating linked to this resolvable field.
	// Experimental.
	DataSource BaseDataSource `field:"optional" json:"dataSource" yaml:"dataSource"`
	// configuration of the pipeline resolver.
	// Experimental.
	PipelineConfig *[]IAppsyncFunction `field:"optional" json:"pipelineConfig" yaml:"pipelineConfig"`
	// The request mapping template for this resolver.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// The response mapping template for this resolver.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
}

Properties for configuring a resolvable field.

Example:

var api graphqlApi
var filmNode objectType
var dummyRequest mappingTemplate
var dummyResponse mappingTemplate

string := appsync.graphqlType.string()
int := appsync.graphqlType.int()
api.addMutation(jsii.String("addFilm"), appsync.NewResolvableField(&resolvableFieldOptions{
	returnType: filmNode.attribute(),
	args: map[string]*graphqlType{
		"name": string,
		"film_number": int,
	},
	dataSource: api.addNoneDataSource(jsii.String("none")),
	requestMappingTemplate: dummyRequest,
	responseMappingTemplate: dummyResponse,
}))

Experimental.

type Resolver

type Resolver interface {
	awscdk.Construct
	// the ARN of the resolver.
	// Experimental.
	Arn() *string
	// The construct tree node associated with this construct.
	// Experimental.
	Node() awscdk.ConstructNode
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	OnPrepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	OnSynthesize(session constructs.ISynthesisSession)
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	OnValidate() *[]*string
	// Perform final modifications before synthesis.
	//
	// This method can be implemented by derived constructs in order to perform
	// final changes before synthesis. prepare() will be called after child
	// constructs have been prepared.
	//
	// This is an advanced framework feature. Only use this if you
	// understand the implications.
	// Experimental.
	Prepare()
	// Allows this construct to emit artifacts into the cloud assembly during synthesis.
	//
	// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
	// as they participate in synthesizing the cloud assembly.
	// Experimental.
	Synthesize(session awscdk.ISynthesisSession)
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Validate the current construct.
	//
	// This method can be implemented by derived constructs in order to perform
	// validation logic. It is called on all constructs before synthesis.
	//
	// Returns: An array of validation error messages, or an empty array if the construct is valid.
	// Experimental.
	Validate() *[]*string
}

An AppSync resolver.

Example:

var api graphqlApi
var appsyncFunction appsyncFunction

pipelineResolver := appsync.NewResolver(this, jsii.String("pipeline"), &resolverProps{
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	typeName: jsii.String("typeName"),
	fieldName: jsii.String("fieldName"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("beforeRequest.vtl")),
	pipelineConfig: []iAppsyncFunction{
		appsyncFunction,
	},
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("afterResponse.vtl")),
})

Experimental.

func NewResolver

func NewResolver(scope constructs.Construct, id *string, props *ResolverProps) Resolver

Experimental.

type ResolverProps

type ResolverProps struct {
	// name of the GraphQL field in the given type this resolver is attached to.
	// Experimental.
	FieldName *string `field:"required" json:"fieldName" yaml:"fieldName"`
	// name of the GraphQL type this resolver is attached to.
	// Experimental.
	TypeName *string `field:"required" json:"typeName" yaml:"typeName"`
	// The caching configuration for this resolver.
	// Experimental.
	CachingConfig *CachingConfig `field:"optional" json:"cachingConfig" yaml:"cachingConfig"`
	// configuration of the pipeline resolver.
	// Experimental.
	PipelineConfig *[]IAppsyncFunction `field:"optional" json:"pipelineConfig" yaml:"pipelineConfig"`
	// The request mapping template for this resolver.
	// Experimental.
	RequestMappingTemplate MappingTemplate `field:"optional" json:"requestMappingTemplate" yaml:"requestMappingTemplate"`
	// The response mapping template for this resolver.
	// Experimental.
	ResponseMappingTemplate MappingTemplate `field:"optional" json:"responseMappingTemplate" yaml:"responseMappingTemplate"`
	// The data source this resolver is using.
	// Experimental.
	DataSource BaseDataSource `field:"optional" json:"dataSource" yaml:"dataSource"`
	// The API this resolver is attached to.
	// Experimental.
	Api IGraphqlApi `field:"required" json:"api" yaml:"api"`
}

Additional property for an AppSync resolver for GraphQL API reference.

Example:

var api graphqlApi
var appsyncFunction appsyncFunction

pipelineResolver := appsync.NewResolver(this, jsii.String("pipeline"), &resolverProps{
	api: api,
	dataSource: api.addNoneDataSource(jsii.String("none")),
	typeName: jsii.String("typeName"),
	fieldName: jsii.String("fieldName"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("beforeRequest.vtl")),
	pipelineConfig: []iAppsyncFunction{
		appsyncFunction,
	},
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("afterResponse.vtl")),
})

Experimental.

type Schema

type Schema interface {
	// The definition for this schema.
	// Experimental.
	Definition() *string
	// Experimental.
	SetDefinition(val *string)
	// Add a mutation field to the schema's Mutation. CDK will create an Object Type called 'Mutation'. For example,.
	//
	// type Mutation {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddMutation(fieldName *string, field ResolvableField) ObjectType
	// Add a query field to the schema's Query. CDK will create an Object Type called 'Query'. For example,.
	//
	// type Query {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddQuery(fieldName *string, field ResolvableField) ObjectType
	// Add a subscription field to the schema's Subscription. CDK will create an Object Type called 'Subscription'. For example,.
	//
	// type Subscription {
	//    fieldName: Field.returnType
	// }.
	// Experimental.
	AddSubscription(fieldName *string, field Field) ObjectType
	// Escape hatch to add to Schema as desired.
	//
	// Will always result
	// in a newline.
	// Experimental.
	AddToSchema(addition *string, delimiter *string)
	// Add type to the schema.
	// Experimental.
	AddType(type_ IIntermediateType) IIntermediateType
	// Called when the GraphQL Api is initialized to allow this object to bind to the stack.
	// Experimental.
	Bind(api GraphqlApi) CfnGraphQLSchema
}

The Schema for a GraphQL Api.

If no options are configured, schema will be generated code-first.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("api"), &graphqlApiProps{
	name: jsii.String("api"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
})

httpDs := api.addHttpDataSource(jsii.String("ds"), jsii.String("https://states.amazonaws.com"), &httpDataSourceOptions{
	name: jsii.String("httpDsWithStepF"),
	description: jsii.String("from appsync to StepFunctions Workflow"),
	authorizationConfig: &awsIamConfig{
		signingRegion: jsii.String("us-east-1"),
		signingServiceName: jsii.String("states"),
	},
})

httpDs.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("callStepFunction"),
	requestMappingTemplate: appsync.mappingTemplate.fromFile(jsii.String("request.vtl")),
	responseMappingTemplate: appsync.*mappingTemplate.fromFile(jsii.String("response.vtl")),
})

Experimental.

func NewSchema

func NewSchema(options *SchemaOptions) Schema

Experimental.

func Schema_FromAsset

func Schema_FromAsset(filePath *string) Schema

Generate a Schema from file.

Returns: `SchemaAsset` with immutable schema defintion. Experimental.

type SchemaOptions

type SchemaOptions struct {
	// The file path for the schema.
	//
	// When this option is
	// configured, then the schema will be generated from an
	// existing file from disk.
	// Experimental.
	FilePath *string `field:"optional" json:"filePath" yaml:"filePath"`
}

The options for configuring a schema.

If no options are specified, then the schema will be generated code-first.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

schemaOptions := &schemaOptions{
	filePath: jsii.String("filePath"),
}

Experimental.

type SortKeyStep

type SortKeyStep interface {
	// Assign an auto-generated value to the sort key.
	// Experimental.
	Auto() PrimaryKey
	// Assign an auto-generated value to the sort key.
	// Experimental.
	Is(val *string) PrimaryKey
}

Utility class to allow assigning a value or an auto-generated id to a sort key.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assign assign

sortKeyStep := awscdk.Aws_appsync.NewSortKeyStep(assign, jsii.String("skey"))

Experimental.

func NewSortKeyStep

func NewSortKeyStep(pkey Assign, skey *string) SortKeyStep

Experimental.

type Type

type Type string

Enum containing the Types that can be used to define ObjectTypes. Experimental.

const (
	// `ID` scalar type is a unique identifier. `ID` type is serialized similar to `String`.
	//
	// Often used as a key for a cache and not intended to be human-readable.
	// Experimental.
	Type_ID Type = "ID"
	// `String` scalar type is a free-form human-readable text.
	// Experimental.
	Type_STRING Type = "STRING"
	// `Int` scalar type is a signed non-fractional numerical value.
	// Experimental.
	Type_INT Type = "INT"
	// `Float` scalar type is a signed double-precision fractional value.
	// Experimental.
	Type_FLOAT Type = "FLOAT"
	// `Boolean` scalar type is a boolean value: true or false.
	// Experimental.
	Type_BOOLEAN Type = "BOOLEAN"
	// `AWSDate` scalar type represents a valid extended `ISO 8601 Date` string.
	//
	// In other words, accepts date strings in the form of `YYYY-MM-DD`. It accepts time zone offsets.
	// See: https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates
	//
	// Experimental.
	Type_AWS_DATE Type = "AWS_DATE"
	// `AWSTime` scalar type represents a valid extended `ISO 8601 Time` string.
	//
	// In other words, accepts date strings in the form of `hh:mm:ss.sss`. It accepts time zone offsets.
	// See: https://en.wikipedia.org/wiki/ISO_8601#Times
	//
	// Experimental.
	Type_AWS_TIME Type = "AWS_TIME"
	// `AWSDateTime` scalar type represents a valid extended `ISO 8601 DateTime` string.
	//
	// In other words, accepts date strings in the form of `YYYY-MM-DDThh:mm:ss.sssZ`. It accepts time zone offsets.
	// See: https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
	//
	// Experimental.
	Type_AWS_DATE_TIME Type = "AWS_DATE_TIME"
	// `AWSTimestamp` scalar type represents the number of seconds since `1970-01-01T00:00Z`.
	//
	// Timestamps are serialized and deserialized as numbers.
	// Experimental.
	Type_AWS_TIMESTAMP Type = "AWS_TIMESTAMP"
	// `AWSEmail` scalar type represents an email address string (i.e.`username@example.com`).
	// Experimental.
	Type_AWS_EMAIL Type = "AWS_EMAIL"
	// `AWSJson` scalar type represents a JSON string.
	// Experimental.
	Type_AWS_JSON Type = "AWS_JSON"
	// `AWSURL` scalar type represetns a valid URL string.
	//
	// URLs wihtout schemes or contain double slashes are considered invalid.
	// Experimental.
	Type_AWS_URL Type = "AWS_URL"
	// `AWSPhone` scalar type represents a valid phone number. Phone numbers maybe be whitespace delimited or hyphenated.
	//
	// The number can specify a country code at the beginning, but is not required for US phone numbers.
	// Experimental.
	Type_AWS_PHONE Type = "AWS_PHONE"
	// `AWSIPAddress` scalar type respresents a valid `IPv4` of `IPv6` address string.
	// Experimental.
	Type_AWS_IP_ADDRESS Type = "AWS_IP_ADDRESS"
	// Type used for Intermediate Types (i.e. an interface or an object type).
	// Experimental.
	Type_INTERMEDIATE Type = "INTERMEDIATE"
)

type UnionType

type UnionType interface {
	IIntermediateType
	// the attributes of this type.
	// Experimental.
	Definition() *map[string]IField
	// the authorization modes supported by this intermediate type.
	// Experimental.
	Modes() *[]AuthorizationType
	// Experimental.
	SetModes(val *[]AuthorizationType)
	// the name of this type.
	// Experimental.
	Name() *string
	// Add a field to this Union Type.
	//
	// Input Types must have field options and the IField must be an Object Type.
	// Experimental.
	AddField(options *AddFieldOptions)
	// Create a GraphQL Type representing this Union Type.
	// Experimental.
	Attribute(options *BaseTypeOptions) GraphqlType
	// Generate the string of this Union type.
	// Experimental.
	ToString() *string
}

Union Types are abstract types that are similar to Interface Types, but they cannot to specify any common fields between types.

Note that fields of a union type need to be object types. In other words, you can't create a union type out of interfaces, other unions, or inputs.

Example:

var api graphqlApi

string := appsync.graphqlType.string()
human := appsync.NewObjectType(jsii.String("Human"), &objectTypeOptions{
	definition: map[string]iField{
		"name": string,
	},
})
droid := appsync.NewObjectType(jsii.String("Droid"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
starship := appsync.NewObjectType(jsii.String("Starship"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
search := appsync.NewUnionType(jsii.String("Search"), &unionTypeOptions{
	definition: []iIntermediateType{
		human,
		droid,
		starship,
	},
})
api.addType(search)

Experimental.

func NewUnionType

func NewUnionType(name *string, options *UnionTypeOptions) UnionType

Experimental.

type UnionTypeOptions

type UnionTypeOptions struct {
	// the object types for this union type.
	// Experimental.
	Definition *[]IIntermediateType `field:"required" json:"definition" yaml:"definition"`
}

Properties for configuring an Union Type.

Example:

var api graphqlApi

string := appsync.graphqlType.string()
human := appsync.NewObjectType(jsii.String("Human"), &objectTypeOptions{
	definition: map[string]iField{
		"name": string,
	},
})
droid := appsync.NewObjectType(jsii.String("Droid"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
starship := appsync.NewObjectType(jsii.String("Starship"), &objectTypeOptions{
	definition: map[string]*iField{
		"name": string,
	},
})
search := appsync.NewUnionType(jsii.String("Search"), &unionTypeOptions{
	definition: []iIntermediateType{
		human,
		droid,
		starship,
	},
})
api.addType(search)

Experimental.

type UserPoolConfig

type UserPoolConfig struct {
	// The Cognito user pool to use as identity source.
	// Experimental.
	UserPool awscognito.IUserPool `field:"required" json:"userPool" yaml:"userPool"`
	// the optional app id regex.
	// Experimental.
	AppIdClientRegex *string `field:"optional" json:"appIdClientRegex" yaml:"appIdClientRegex"`
	// Default auth action.
	// Experimental.
	DefaultAction UserPoolDefaultAction `field:"optional" json:"defaultAction" yaml:"defaultAction"`
}

Configuration for Cognito user-pools in AppSync.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var userPool userPool

userPoolConfig := &userPoolConfig{
	userPool: userPool,

	// the properties below are optional
	appIdClientRegex: jsii.String("appIdClientRegex"),
	defaultAction: awscdk.Aws_appsync.userPoolDefaultAction_ALLOW,
}

Experimental.

type UserPoolDefaultAction

type UserPoolDefaultAction string

enum with all possible values for Cognito user-pool default actions. Experimental.

const (
	// ALLOW access to API.
	// Experimental.
	UserPoolDefaultAction_ALLOW UserPoolDefaultAction = "ALLOW"
	// DENY access to API.
	// Experimental.
	UserPoolDefaultAction_DENY UserPoolDefaultAction = "DENY"
)

type Values

type Values interface {
}

Factory class for attribute value assignments.

Example:

api := appsync.NewGraphqlApi(this, jsii.String("Api"), &graphqlApiProps{
	name: jsii.String("demo"),
	schema: appsync.schema.fromAsset(path.join(__dirname, jsii.String("schema.graphql"))),
	authorizationConfig: &authorizationConfig{
		defaultAuthorization: &authorizationMode{
			authorizationType: appsync.authorizationType_IAM,
		},
	},
	xrayEnabled: jsii.Boolean(true),
})

demoTable := dynamodb.NewTable(this, jsii.String("DemoTable"), &tableProps{
	partitionKey: &attribute{
		name: jsii.String("id"),
		type: dynamodb.attributeType_STRING,
	},
})

demoDS := api.addDynamoDbDataSource(jsii.String("demoDataSource"), demoTable)

// Resolver for the Query "getDemos" that scans the DynamoDb table and returns the entire list.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Query"),
	fieldName: jsii.String("getDemos"),
	requestMappingTemplate: appsync.mappingTemplate.dynamoDbScanTable(),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultList(),
})

// Resolver for the Mutation "addDemo" that puts the item into the DynamoDb table.
demoDS.createResolver(&baseResolverProps{
	typeName: jsii.String("Mutation"),
	fieldName: jsii.String("addDemo"),
	requestMappingTemplate: appsync.*mappingTemplate.dynamoDbPutItem(appsync.primaryKey.partition(jsii.String("id")).auto(), appsync.values.projecting(jsii.String("input"))),
	responseMappingTemplate: appsync.*mappingTemplate.dynamoDbResultItem(),
})

Experimental.

func NewValues

func NewValues() Values

Experimental.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL