diff --git a/packages/amplify-data-construct/.jsii b/packages/amplify-data-construct/.jsii index d9ad9068ac..38597b502c 100644 --- a/packages/amplify-data-construct/.jsii +++ b/packages/amplify-data-construct/.jsii @@ -3520,7 +3520,7 @@ }, "name": "@aws-amplify/data-construct", "readme": { - "markdown": "# AmplifyData Construct\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40aws-amplify%2Fdata-construct)](https://constructs.dev/packages/@aws-amplify/data-construct)\n\nThis package vends an L3 CDK Construct wrapping the behavior of the Amplify GraphQL Transformer. This enables quick development and interation of AppSync APIs which support the Amplify GraphQL Directives. For more information on schema modeling in GraphQL, please refer to the [amplify developer docs](https://docs.amplify.aws/cli/graphql/overview/).\n\nThe primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema.\n\nNote: only a single instance of the `AmplifyData` construct can be invoked within a CDK synthesis at this point in time.\n\n## Examples\n\n### Simple Todo List With Cognito Userpool-based Owner Authorization\n\nIn this example, we create a single model, which will use `user pool` auth in order to allow logged in users to create and manage their own `todos` privately.\n\nWe create a cdk App and Stack, though you may be deploying this to a custom stack, this is purely illustrative for a concise demo.\n\nWe then wire this through to import a user pool which was already deployed (creating and deploying is out of scope for this example).\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'TodoStack');\n\nnew AmplifyData(stack, 'TodoApp', {\n definition: AmplifyDataDefinition.fromString(/* GraphQL */ `\n type Todo @model @auth(rules: [{ allow: owner }]) {\n description: String!\n completed: Boolean\n }\n `),\n authorizationModes: {\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Multiple related models, with public read access, and admin read/write access\n\nIn this example, we create a two related models, which will use which logged in users in the 'Author' and 'Admin' user groups will have\nfull access to, and customers requesting with api key will only have read permissions on.\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'BlogStack');\n\nnew AmplifyData(stack, 'BlogApp', {\n definition: AmplifyDataDefinition.fromString(/* GraphQL */ `\n type Blog @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n }\n\n type Post @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n }\n `),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Import GraphQL Schema from files, instead of inline.\n\nIn this example, we import the schema definition itself from one or more local file, rather than an inline graphql string.\n\n```graphql\n# todo.graphql\ntype Todo @model @auth(rules: [{ allow: owner }]) {\n content: String!\n done: Boolean\n}\n```\n\n```graphql\n# blog.graphql\ntype Blog @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n}\n\ntype Post @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n}\n```\n\n```ts\n// app.ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'MultiFileStack');\n\nnew AmplifyData(stack, 'MultiFileDefinition', {\n definition: AmplifyDataDefinition.fromFiles(path.join(__dirname, 'todo.graphql'), path.join(__dirname, 'blog.graphql')),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n" + "markdown": "# AmplifyData Construct\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40aws-amplify%2Fdata-construct)](https://constructs.dev/packages/@aws-amplify/data-construct)\n\nThis package vends an L3 CDK Construct wrapping the behavior of the Amplify GraphQL Transformer. This enables quick development and interation of AppSync APIs which support the Amplify GraphQL Directives. For more information on schema modeling in GraphQL, please refer to the [amplify developer docs](https://docs.amplify.aws/cli/graphql/overview/).\n\nThe primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema.\n\n## Examples\n\n### Simple Todo List With Cognito Userpool-based Owner Authorization\n\nIn this example, we create a single model, which will use `user pool` auth in order to allow logged in users to create and manage their own `todos` privately.\n\nWe create a cdk App and Stack, though you may be deploying this to a custom stack, this is purely illustrative for a concise demo.\n\nWe then wire this through to import a user pool which was already deployed (creating and deploying is out of scope for this example).\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'TodoStack');\n\nnew AmplifyData(stack, 'TodoApp', {\n definition: AmplifyDataDefinition.fromString(/* GraphQL */ `\n type Todo @model @auth(rules: [{ allow: owner }]) {\n description: String!\n completed: Boolean\n }\n `),\n authorizationModes: {\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Multiple related models, with public read access, and admin read/write access\n\nIn this example, we create a two related models, which will use which logged in users in the 'Author' and 'Admin' user groups will have\nfull access to, and customers requesting with api key will only have read permissions on.\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'BlogStack');\n\nnew AmplifyData(stack, 'BlogApp', {\n definition: AmplifyDataDefinition.fromString(/* GraphQL */ `\n type Blog @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n }\n\n type Post @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n }\n `),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Import GraphQL Schema from files, instead of inline.\n\nIn this example, we import the schema definition itself from one or more local file, rather than an inline graphql string.\n\n```graphql\n# todo.graphql\ntype Todo @model @auth(rules: [{ allow: owner }]) {\n content: String!\n done: Boolean\n}\n```\n\n```graphql\n# blog.graphql\ntype Blog @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n}\n\ntype Post @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n}\n```\n\n```ts\n// app.ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyData, AmplifyDataDefinition } from '@aws-amplify/data-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'MultiFileStack');\n\nnew AmplifyData(stack, 'MultiFileDefinition', {\n definition: AmplifyDataDefinition.fromFiles(path.join(__dirname, 'todo.graphql'), path.join(__dirname, 'blog.graphql')),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n" }, "repository": { "directory": "packages/amplify-data-construct", @@ -3535,5 +3535,5 @@ }, "types": {}, "version": "1.7.2", - "fingerprint": "lhTH8On2vgQ1f/2zsM4RwATDNauPbYxMg3txq5pGaMU=" + "fingerprint": "4gdnEpjS4yQg2de7yrDbsRfoYCPl/SorshNUpdweEho=" } \ No newline at end of file diff --git a/packages/amplify-data-construct/README.md b/packages/amplify-data-construct/README.md index 258a8c3991..2eb3868550 100644 --- a/packages/amplify-data-construct/README.md +++ b/packages/amplify-data-construct/README.md @@ -6,8 +6,6 @@ This package vends an L3 CDK Construct wrapping the behavior of the Amplify Grap The primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema. -Note: only a single instance of the `AmplifyData` construct can be invoked within a CDK synthesis at this point in time. - ## Examples ### Simple Todo List With Cognito Userpool-based Owner Authorization diff --git a/packages/amplify-graphql-api-construct/.jsii b/packages/amplify-graphql-api-construct/.jsii index f5e2482b20..8845ec45cd 100644 --- a/packages/amplify-graphql-api-construct/.jsii +++ b/packages/amplify-graphql-api-construct/.jsii @@ -3512,7 +3512,7 @@ }, "name": "@aws-amplify/graphql-api-construct", "readme": { - "markdown": "# Amplify Graphql API Construct\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40aws-amplify%2Fgraphql-api-construct)](https://constructs.dev/packages/@aws-amplify/graphql-api-construct)\n\nThis package vends an L3 CDK Construct wrapping the behavior of the Amplify GraphQL Transformer. This enables quick development and interation of AppSync APIs which support the Amplify GraphQL Directives. For more information on schema modeling in GraphQL, please refer to the [amplify developer docs](https://docs.amplify.aws/cli/graphql/overview/).\n\nThe primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema.\n\nNote: only a single instance of the `AmplifyGraphqlApi` construct can be invoked within a CDK synthesis at this point in time.\n\n## Examples\n\n### Simple Todo List With Cognito Userpool-based Owner Authorization\n\nIn this example, we create a single model, which will use `user pool` auth in order to allow logged in users to create and manage their own `todos` privately.\n\nWe create a cdk App and Stack, though you may be deploying this to a custom stack, this is purely illustrative for a concise demo.\n\nWe then wire this through to import a user pool which was already deployed (creating and deploying is out of scope for this example).\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'TodoStack');\n\nnew AmplifyGraphqlApi(stack, 'TodoApp', {\n definition: AmplifyGraphqlDefinition.fromString(/* GraphQL */ `\n type Todo @model @auth(rules: [{ allow: owner }]) {\n description: String!\n completed: Boolean\n }\n `),\n authorizationModes: {\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Multiple related models, with public read access, and admin read/write access\n\nIn this example, we create a two related models, which will use which logged in users in the 'Author' and 'Admin' user groups will have\nfull access to, and customers requesting with api key will only have read permissions on.\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'BlogStack');\n\nnew AmplifyGraphqlApi(stack, 'BlogApp', {\n definition: AmplifyGraphqlDefinition.fromString(/* GraphQL */ `\n type Blog @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n }\n\n type Post @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n }\n `),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Import GraphQL Schema from files, instead of inline\n\nIn this example, we import the schema definition itself from one or more local files, rather than an inline graphql string.\n\n```graphql\n# todo.graphql\ntype Todo @model @auth(rules: [{ allow: owner }]) {\n content: String!\n done: Boolean\n}\n```\n\n```graphql\n# blog.graphql\ntype Blog @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n}\n\ntype Post @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n}\n```\n\n```ts\n// app.ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'MultiFileStack');\n\nnew AmplifyGraphqlApi(stack, 'MultiFileDefinition', {\n definition: AmplifyGraphqlDefinition.fromFiles(path.join(__dirname, 'todo.graphql'), path.join(__dirname, 'blog.graphql')),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n# API Reference \n\n## Constructs \n\n### AmplifyGraphqlApi \n\nL3 Construct which invokes the Amplify Transformer Pattern over an input Graphql Schema.\n\nThis can be used to quickly define appsync apis which support full CRUD+List and Subscriptions, relationships,\nauth, search over data, the ability to inject custom business logic and query/mutation operations, and connect to ML services.\n\nFor more information, refer to the docs links below:\nData Modeling - https://docs.amplify.aws/cli/graphql/data-modeling/\nAuthorization - https://docs.amplify.aws/cli/graphql/authorization-rules/\nCustom Business Logic - https://docs.amplify.aws/cli/graphql/custom-business-logic/\nSearch - https://docs.amplify.aws/cli/graphql/search-and-result-aggregations/\nML Services - https://docs.amplify.aws/cli/graphql/connect-to-machine-learning-services/\n\nFor a full reference of the supported custom graphql directives - https://docs.amplify.aws/cli/graphql/directives-reference/\n\nThe output of this construct is a mapping of L2 or L1 resources generated by the transformer, which generally follow the access pattern\n\n```typescript\n const api = new AmplifyGraphQlApi(this, 'api', { });\n // Access L2 resources under `.resources`\n api.resources.tables[\"Todo\"].tableArn;\n\n // Access L1 resources under `.resources.cfnResources`\n api.resources.cfnResources.cfnGraphqlApi.xrayEnabled = true;\n Object.values(api.resources.cfnResources.cfnTables).forEach(table => {\n table.pointInTimeRecoverySpecification = { pointInTimeRecoveryEnabled: false };\n });\n```\n`resources..` - you can then perform any CDK action on these resulting resoureces.\n\n#### Initializers \n\n```typescript\nimport { AmplifyGraphqlApi } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyGraphqlApi(scope: Construct, id: string, props: AmplifyGraphqlApiProps)\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| scope | constructs.Construct | the scope to create this construct within. |\n| id | string | the id to use for this api. |\n| props | AmplifyGraphqlApiProps | the properties used to configure the generated api. |\n\n---\n\n##### `scope`Required \n\n- *Type:* constructs.Construct\n\nthe scope to create this construct within.\n\n---\n\n##### `id`Required \n\n- *Type:* string\n\nthe id to use for this api.\n\n---\n\n##### `props`Required \n\n- *Type:* AmplifyGraphqlApiProps\n\nthe properties used to configure the generated api.\n\n---\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| toString | Returns a string representation of this construct. |\n| addDynamoDbDataSource | Add a new DynamoDB data source to this API. |\n| addElasticsearchDataSource | Add a new elasticsearch data source to this API. |\n| addEventBridgeDataSource | Add an EventBridge data source to this api. |\n| addFunction | Add an appsync function to the api. |\n| addHttpDataSource | Add a new http data source to this API. |\n| addLambdaDataSource | Add a new Lambda data source to this API. |\n| addNoneDataSource | Add a new dummy data source to this API. |\n| addOpenSearchDataSource | dd a new OpenSearch data source to this API. |\n| addRdsDataSource | Add a new Rds data source to this API. |\n| addResolver | Add a resolver to the api. |\n\n---\n\n##### `toString` \n\n```typescript\npublic toString(): string\n```\n\nReturns a string representation of this construct.\n\n##### `addDynamoDbDataSource` \n\n```typescript\npublic addDynamoDbDataSource(id: string, table: ITable, options?: DataSourceOptions): DynamoDbDataSource\n```\n\nAdd a new DynamoDB data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `table`Required \n\n- *Type:* aws-cdk-lib.aws_dynamodb.ITable\n\nThe DynamoDB table backing this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### ~~`addElasticsearchDataSource`~~ \n\n```typescript\npublic addElasticsearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): ElasticsearchDataSource\n```\n\nAdd a new elasticsearch data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `domain`Required \n\n- *Type:* aws-cdk-lib.aws_elasticsearch.IDomain\n\nThe elasticsearch domain for this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addEventBridgeDataSource` \n\n```typescript\npublic addEventBridgeDataSource(id: string, eventBus: IEventBus, options?: DataSourceOptions): EventBridgeDataSource\n```\n\nAdd an EventBridge data source to this api.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `eventBus`Required \n\n- *Type:* aws-cdk-lib.aws_events.IEventBus\n\nThe EventBridge EventBus on which to put events.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addFunction` \n\n```typescript\npublic addFunction(id: string, props: AddFunctionProps): AppsyncFunction\n```\n\nAdd an appsync function to the api.\n\n###### `id`Required \n\n- *Type:* string\n\nthe function's id.\n\n---\n\n###### `props`Required \n\n- *Type:* AddFunctionProps\n\n---\n\n##### `addHttpDataSource` \n\n```typescript\npublic addHttpDataSource(id: string, endpoint: string, options?: HttpDataSourceOptions): HttpDataSource\n```\n\nAdd a new http data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `endpoint`Required \n\n- *Type:* string\n\nThe http endpoint.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.HttpDataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addLambdaDataSource` \n\n```typescript\npublic addLambdaDataSource(id: string, lambdaFunction: IFunction, options?: DataSourceOptions): LambdaDataSource\n```\n\nAdd a new Lambda data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `lambdaFunction`Required \n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe Lambda function to call to interact with this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addNoneDataSource` \n\n```typescript\npublic addNoneDataSource(id: string, options?: DataSourceOptions): NoneDataSource\n```\n\nAdd a new dummy data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\nUseful for pipeline resolvers and for backend changes that don't require a data source.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addOpenSearchDataSource` \n\n```typescript\npublic addOpenSearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): OpenSearchDataSource\n```\n\ndd a new OpenSearch data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `domain`Required \n\n- *Type:* aws-cdk-lib.aws_opensearchservice.IDomain\n\nThe OpenSearch domain for this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addRdsDataSource` \n\n```typescript\npublic addRdsDataSource(id: string, serverlessCluster: IServerlessCluster, secretStore: ISecret, databaseName?: string, options?: DataSourceOptions): RdsDataSource\n```\n\nAdd a new Rds data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `serverlessCluster`Required \n\n- *Type:* aws-cdk-lib.aws_rds.IServerlessCluster\n\nThe serverless cluster to interact with this data source.\n\n---\n\n###### `secretStore`Required \n\n- *Type:* aws-cdk-lib.aws_secretsmanager.ISecret\n\nThe secret store that contains the username and password for the serverless cluster.\n\n---\n\n###### `databaseName`Optional \n\n- *Type:* string\n\nThe optional name of the database to use within the cluster.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addResolver` \n\n```typescript\npublic addResolver(id: string, props: ExtendedResolverProps): Resolver\n```\n\nAdd a resolver to the api.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe resolver's id.\n\n---\n\n###### `props`Required \n\n- *Type:* aws-cdk-lib.aws_appsync.ExtendedResolverProps\n\nthe resolver properties.\n\n---\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| isConstruct | Checks if `x` is a construct. |\n\n---\n\n##### ~~`isConstruct`~~ \n\n```typescript\nimport { AmplifyGraphqlApi } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlApi.isConstruct(x: any)\n```\n\nChecks if `x` is a construct.\n\n###### `x`Required \n\n- *Type:* any\n\nAny object.\n\n---\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| node | constructs.Node | The tree node. |\n| apiId | string | Generated Api Id. |\n| generatedFunctionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Resolvers generated by the transform process, persisted on the side in order to facilitate pulling a manifest for the purposes of inspecting and producing overrides. |\n| graphqlUrl | string | Graphql URL For the generated API. |\n| realtimeUrl | string | Realtime URL For the generated API. |\n| resources | AmplifyGraphqlApiResources | Generated L1 and L2 CDK resources. |\n| apiKey | string | Generated Api Key if generated. |\n\n---\n\n##### `node`Required \n\n```typescript\npublic readonly node: Node;\n```\n\n- *Type:* constructs.Node\n\nThe tree node.\n\n---\n\n##### `apiId`Required \n\n```typescript\npublic readonly apiId: string;\n```\n\n- *Type:* string\n\nGenerated Api Id.\n\nMay be a CDK Token.\n\n---\n\n##### `generatedFunctionSlots`Required \n\n```typescript\npublic readonly generatedFunctionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nResolvers generated by the transform process, persisted on the side in order to facilitate pulling a manifest for the purposes of inspecting and producing overrides.\n\n---\n\n##### `graphqlUrl`Required \n\n```typescript\npublic readonly graphqlUrl: string;\n```\n\n- *Type:* string\n\nGraphql URL For the generated API.\n\nMay be a CDK Token.\n\n---\n\n##### `realtimeUrl`Required \n\n```typescript\npublic readonly realtimeUrl: string;\n```\n\n- *Type:* string\n\nRealtime URL For the generated API.\n\nMay be a CDK Token.\n\n---\n\n##### `resources`Required \n\n```typescript\npublic readonly resources: AmplifyGraphqlApiResources;\n```\n\n- *Type:* AmplifyGraphqlApiResources\n\nGenerated L1 and L2 CDK resources.\n\n---\n\n##### `apiKey`Optional \n\n```typescript\npublic readonly apiKey: string;\n```\n\n- *Type:* string\n\nGenerated Api Key if generated.\n\nMay be a CDK Token.\n\n---\n\n\n## Structs \n\n### AddFunctionProps \n\nInput type properties when adding a new appsync.AppsyncFunction to the generated API. This is equivalent to the Omit.\n\n#### Initializer \n\n```typescript\nimport { AddFunctionProps } from '@aws-amplify/graphql-api-construct'\n\nconst addFunctionProps: AddFunctionProps = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dataSource | aws-cdk-lib.aws_appsync.BaseDataSource | the data source linked to this AppSync Function. |\n| name | string | the name of the AppSync Function. |\n| code | aws-cdk-lib.aws_appsync.Code | The function code. |\n| description | string | the description for this AppSync Function. |\n| requestMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | the request mapping template for the AppSync Function. |\n| responseMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | the response mapping template for the AppSync Function. |\n| runtime | aws-cdk-lib.aws_appsync.FunctionRuntime | The functions runtime. |\n\n---\n\n##### `dataSource`Required \n\n```typescript\npublic readonly dataSource: BaseDataSource;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.BaseDataSource\n\nthe data source linked to this AppSync Function.\n\n---\n\n##### `name`Required \n\n```typescript\npublic readonly name: string;\n```\n\n- *Type:* string\n\nthe name of the AppSync Function.\n\n---\n\n##### `code`Optional \n\n```typescript\npublic readonly code: Code;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.Code\n- *Default:* no code is used\n\nThe function code.\n\n---\n\n##### `description`Optional \n\n```typescript\npublic readonly description: string;\n```\n\n- *Type:* string\n- *Default:* no description\n\nthe description for this AppSync Function.\n\n---\n\n##### `requestMappingTemplate`Optional \n\n```typescript\npublic readonly requestMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n- *Default:* no request mapping template\n\nthe request mapping template for the AppSync Function.\n\n---\n\n##### `responseMappingTemplate`Optional \n\n```typescript\npublic readonly responseMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n- *Default:* no response mapping template\n\nthe response mapping template for the AppSync Function.\n\n---\n\n##### `runtime`Optional \n\n```typescript\npublic readonly runtime: FunctionRuntime;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.FunctionRuntime\n- *Default:* no function runtime, VTL mapping templates used\n\nThe functions runtime.\n\n---\n\n### AmplifyDynamoDbModelDataSourceStrategy \n\nUse custom resource type 'Custom::AmplifyDynamoDBTable' to provision table.\n\n#### Initializer \n\n```typescript\nimport { AmplifyDynamoDbModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyDynamoDbModelDataSourceStrategy: AmplifyDynamoDbModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbType | string | *No description.* |\n| provisionStrategy | string | *No description.* |\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\n---\n\n##### `provisionStrategy`Required \n\n```typescript\npublic readonly provisionStrategy: string;\n```\n\n- *Type:* string\n\n---\n\n### AmplifyGraphqlApiCfnResources \n\nL1 CDK resources from the Api which were generated as part of the transform.\n\nThese are potentially stored under nested stacks, but presented organized by type instead.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiCfnResources } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiCfnResources: AmplifyGraphqlApiCfnResources = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| additionalCfnResources | {[ key: string ]: aws-cdk-lib.CfnResource} | Remaining L1 resources generated, keyed by logicalId. |\n| cfnDataSources | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnDataSource} | The Generated AppSync DataSource L1 Resources, keyed by logicalId. |\n| cfnFunctionConfigurations | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnFunctionConfiguration} | The Generated AppSync Function L1 Resources, keyed by logicalId. |\n| cfnFunctions | {[ key: string ]: aws-cdk-lib.aws_lambda.CfnFunction} | The Generated Lambda Function L1 Resources, keyed by function name. |\n| cfnGraphqlApi | aws-cdk-lib.aws_appsync.CfnGraphQLApi | The Generated AppSync Api L1 Resource. |\n| cfnGraphqlSchema | aws-cdk-lib.aws_appsync.CfnGraphQLSchema | The Generated AppSync Schema L1 Resource. |\n| cfnResolvers | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnResolver} | The Generated AppSync Resolver L1 Resources, keyed by logicalId. |\n| cfnRoles | {[ key: string ]: aws-cdk-lib.aws_iam.CfnRole} | The Generated IAM Role L1 Resources, keyed by logicalId. |\n| cfnTables | {[ key: string ]: aws-cdk-lib.aws_dynamodb.CfnTable} | The Generated DynamoDB Table L1 Resources, keyed by logicalId. |\n| cfnApiKey | aws-cdk-lib.aws_appsync.CfnApiKey | The Generated AppSync Api Key L1 Resource. |\n\n---\n\n##### `additionalCfnResources`Required \n\n```typescript\npublic readonly additionalCfnResources: {[ key: string ]: CfnResource};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.CfnResource}\n\nRemaining L1 resources generated, keyed by logicalId.\n\n---\n\n##### `cfnDataSources`Required \n\n```typescript\npublic readonly cfnDataSources: {[ key: string ]: CfnDataSource};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnDataSource}\n\nThe Generated AppSync DataSource L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnFunctionConfigurations`Required \n\n```typescript\npublic readonly cfnFunctionConfigurations: {[ key: string ]: CfnFunctionConfiguration};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnFunctionConfiguration}\n\nThe Generated AppSync Function L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnFunctions`Required \n\n```typescript\npublic readonly cfnFunctions: {[ key: string ]: CfnFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.CfnFunction}\n\nThe Generated Lambda Function L1 Resources, keyed by function name.\n\n---\n\n##### `cfnGraphqlApi`Required \n\n```typescript\npublic readonly cfnGraphqlApi: CfnGraphQLApi;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnGraphQLApi\n\nThe Generated AppSync Api L1 Resource.\n\n---\n\n##### `cfnGraphqlSchema`Required \n\n```typescript\npublic readonly cfnGraphqlSchema: CfnGraphQLSchema;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnGraphQLSchema\n\nThe Generated AppSync Schema L1 Resource.\n\n---\n\n##### `cfnResolvers`Required \n\n```typescript\npublic readonly cfnResolvers: {[ key: string ]: CfnResolver};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnResolver}\n\nThe Generated AppSync Resolver L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnRoles`Required \n\n```typescript\npublic readonly cfnRoles: {[ key: string ]: CfnRole};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.CfnRole}\n\nThe Generated IAM Role L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnTables`Required \n\n```typescript\npublic readonly cfnTables: {[ key: string ]: CfnTable};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_dynamodb.CfnTable}\n\nThe Generated DynamoDB Table L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnApiKey`Optional \n\n```typescript\npublic readonly cfnApiKey: CfnApiKey;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnApiKey\n\nThe Generated AppSync Api Key L1 Resource.\n\n---\n\n### AmplifyGraphqlApiProps \n\nInput props for the AmplifyGraphqlApi construct.\n\nSpecifies what the input to transform into an Api, and configurations for\nthe transformation process.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiProps } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiProps: AmplifyGraphqlApiProps = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| authorizationModes | AuthorizationModes | Required auth modes for the Api. |\n| definition | IAmplifyGraphqlDefinition | The definition to transform in a full Api. |\n| apiName | string | Name to be used for the AppSync Api. |\n| conflictResolution | ConflictResolution | Configure conflict resolution on the Api, which is required to enable DataStore Api functionality. |\n| functionNameMap | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | Lambda functions referenced in the definitions's. |\n| functionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Overrides for a given slot in the generated resolver pipelines. |\n| outputStorageStrategy | IBackendOutputStorageStrategy | Strategy to store construct outputs. |\n| predictionsBucket | aws-cdk-lib.aws_s3.IBucket | If using predictions, a bucket must be provided which will be used to search for assets. |\n| stackMappings | {[ key: string ]: string} | StackMappings override the assigned nested stack on a per-resource basis. |\n| transformerPlugins | any[] | Provide a list of additional custom transformers which are injected into the transform process. |\n| translationBehavior | PartialTranslationBehavior | This replaces feature flags from the Api construct, for general information on what these parameters do, refer to https://docs.amplify.aws/cli/reference/feature-flags/#graphQLTransformer. |\n\n---\n\n##### `authorizationModes`Required \n\n```typescript\npublic readonly authorizationModes: AuthorizationModes;\n```\n\n- *Type:* AuthorizationModes\n\nRequired auth modes for the Api.\n\nThis object must be a superset of the configured auth providers in the Api definition.\nFor more information, refer to https://docs.amplify.aws/cli/graphql/authorization-rules/\n\n---\n\n##### `definition`Required \n\n```typescript\npublic readonly definition: IAmplifyGraphqlDefinition;\n```\n\n- *Type:* IAmplifyGraphqlDefinition\n\nThe definition to transform in a full Api.\n\nCan be constructed via the AmplifyGraphqlDefinition class.\n\n---\n\n##### `apiName`Optional \n\n```typescript\npublic readonly apiName: string;\n```\n\n- *Type:* string\n\nName to be used for the AppSync Api.\n\nDefault: construct id.\n\n---\n\n##### `conflictResolution`Optional \n\n```typescript\npublic readonly conflictResolution: ConflictResolution;\n```\n\n- *Type:* ConflictResolution\n\nConfigure conflict resolution on the Api, which is required to enable DataStore Api functionality.\n\nFor more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/\n\n---\n\n##### `functionNameMap`Optional \n\n```typescript\npublic readonly functionNameMap: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nLambda functions referenced in the definitions's.\n\n---\n\n##### `functionSlots`Optional \n\n```typescript\npublic readonly functionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nOverrides for a given slot in the generated resolver pipelines.\n\nFor more information about what slots are available,\nrefer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#override-amplify-generated-resolvers.\n\n---\n\n##### `outputStorageStrategy`Optional \n\n```typescript\npublic readonly outputStorageStrategy: IBackendOutputStorageStrategy;\n```\n\n- *Type:* IBackendOutputStorageStrategy\n\nStrategy to store construct outputs.\n\nIf no outputStorageStrategey is provided a default strategy will be used.\n\n---\n\n##### `predictionsBucket`Optional \n\n```typescript\npublic readonly predictionsBucket: IBucket;\n```\n\n- *Type:* aws-cdk-lib.aws_s3.IBucket\n\nIf using predictions, a bucket must be provided which will be used to search for assets.\n\n---\n\n##### `stackMappings`Optional \n\n```typescript\npublic readonly stackMappings: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nStackMappings override the assigned nested stack on a per-resource basis.\n\nOnly applies to resolvers, and takes the form\n{ : }\nIt is not recommended to use this parameter unless you are encountering stack resource count limits, and worth noting that\nafter initial deployment AppSync resolvers cannot be moved between nested stacks, they will need to be removed from the app,\nthen re-added from a new stack.\n\n---\n\n##### `transformerPlugins`Optional \n\n```typescript\npublic readonly transformerPlugins: any[];\n```\n\n- *Type:* any[]\n\nProvide a list of additional custom transformers which are injected into the transform process.\n\nThese custom transformers must be implemented with aws-cdk-lib >=2.80.0, and\n\n---\n\n##### `translationBehavior`Optional \n\n```typescript\npublic readonly translationBehavior: PartialTranslationBehavior;\n```\n\n- *Type:* PartialTranslationBehavior\n\nThis replaces feature flags from the Api construct, for general information on what these parameters do, refer to https://docs.amplify.aws/cli/reference/feature-flags/#graphQLTransformer.\n\n---\n\n### AmplifyGraphqlApiResources \n\nAccessible resources from the Api which were generated as part of the transform.\n\nThese are potentially stored under nested stacks, but presented organized by type instead.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiResources } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiResources: AmplifyGraphqlApiResources = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| amplifyDynamoDbTables | {[ key: string ]: AmplifyDynamoDbTableWrapper} | The Generated Amplify DynamoDb Table wrapped if produced, keyed by name. |\n| cfnResources | AmplifyGraphqlApiCfnResources | L1 Cfn Resources, for when dipping down a level of abstraction is desirable. |\n| functions | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | The Generated Lambda Function L1 Resources, keyed by function name. |\n| graphqlApi | aws-cdk-lib.aws_appsync.IGraphqlApi | The Generated AppSync Api L2 Resource, includes the Schema. |\n| nestedStacks | {[ key: string ]: aws-cdk-lib.NestedStack} | Nested Stacks generated by the Api Construct. |\n| roles | {[ key: string ]: aws-cdk-lib.aws_iam.IRole} | The Generated IAM Role L2 Resources, keyed by logicalId. |\n| tables | {[ key: string ]: aws-cdk-lib.aws_dynamodb.ITable} | The Generated DynamoDB Table L2 Resources, keyed by logicalId. |\n\n---\n\n##### `amplifyDynamoDbTables`Required \n\n```typescript\npublic readonly amplifyDynamoDbTables: {[ key: string ]: AmplifyDynamoDbTableWrapper};\n```\n\n- *Type:* {[ key: string ]: AmplifyDynamoDbTableWrapper}\n\nThe Generated Amplify DynamoDb Table wrapped if produced, keyed by name.\n\n---\n\n##### `cfnResources`Required \n\n```typescript\npublic readonly cfnResources: AmplifyGraphqlApiCfnResources;\n```\n\n- *Type:* AmplifyGraphqlApiCfnResources\n\nL1 Cfn Resources, for when dipping down a level of abstraction is desirable.\n\n---\n\n##### `functions`Required \n\n```typescript\npublic readonly functions: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nThe Generated Lambda Function L1 Resources, keyed by function name.\n\n---\n\n##### `graphqlApi`Required \n\n```typescript\npublic readonly graphqlApi: IGraphqlApi;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi\n\nThe Generated AppSync Api L2 Resource, includes the Schema.\n\n---\n\n##### `nestedStacks`Required \n\n```typescript\npublic readonly nestedStacks: {[ key: string ]: NestedStack};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.NestedStack}\n\nNested Stacks generated by the Api Construct.\n\n---\n\n##### `roles`Required \n\n```typescript\npublic readonly roles: {[ key: string ]: IRole};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.IRole}\n\nThe Generated IAM Role L2 Resources, keyed by logicalId.\n\n---\n\n##### `tables`Required \n\n```typescript\npublic readonly tables: {[ key: string ]: ITable};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_dynamodb.ITable}\n\nThe Generated DynamoDB Table L2 Resources, keyed by logicalId.\n\n---\n\n### ApiKeyAuthorizationConfig \n\nConfiguration for Api Keys on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { ApiKeyAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst apiKeyAuthorizationConfig: ApiKeyAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| expires | aws-cdk-lib.Duration | A duration representing the time from Cloudformation deploy until expiry. |\n| description | string | Optional description for the Api Key to attach to the Api. |\n\n---\n\n##### `expires`Required \n\n```typescript\npublic readonly expires: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nA duration representing the time from Cloudformation deploy until expiry.\n\n---\n\n##### `description`Optional \n\n```typescript\npublic readonly description: string;\n```\n\n- *Type:* string\n\nOptional description for the Api Key to attach to the Api.\n\n---\n\n### AuthorizationModes \n\nAuthorization Modes to apply to the Api.\n\nAt least one modes must be provided, and if more than one are provided a defaultAuthorizationMode must be specified.\nFor more information on Amplify Api auth, refer to https://docs.amplify.aws/cli/graphql/authorization-rules/#authorization-strategies\n\n#### Initializer \n\n```typescript\nimport { AuthorizationModes } from '@aws-amplify/graphql-api-construct'\n\nconst authorizationModes: AuthorizationModes = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| adminRoles | aws-cdk-lib.aws_iam.IRole[] | A list of roles granted full R/W access to the Api. |\n| apiKeyConfig | ApiKeyAuthorizationConfig | AppSync Api Key config, required if a 'apiKey' auth provider is specified in the Api. |\n| defaultAuthorizationMode | string | Default auth mode to provide to the Api, required if more than one config type is specified. |\n| iamConfig | IAMAuthorizationConfig | IAM Auth config, required if an 'iam' auth provider is specified in the Api. |\n| lambdaConfig | LambdaAuthorizationConfig | Lambda config, required if a 'function' auth provider is specified in the Api. |\n| oidcConfig | OIDCAuthorizationConfig | Cognito OIDC config, required if a 'oidc' auth provider is specified in the Api. |\n| userPoolConfig | UserPoolAuthorizationConfig | Cognito UserPool config, required if a 'userPools' auth provider is specified in the Api. |\n\n---\n\n##### ~~`adminRoles`~~Optional \n\n- *Deprecated:* , use iamConfig.allowListedRoles instead.\n\n```typescript\npublic readonly adminRoles: IRole[];\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole[]\n\nA list of roles granted full R/W access to the Api.\n\n---\n\n##### `apiKeyConfig`Optional \n\n```typescript\npublic readonly apiKeyConfig: ApiKeyAuthorizationConfig;\n```\n\n- *Type:* ApiKeyAuthorizationConfig\n\nAppSync Api Key config, required if a 'apiKey' auth provider is specified in the Api.\n\nApplies to 'public' auth strategy.\n\n---\n\n##### `defaultAuthorizationMode`Optional \n\n```typescript\npublic readonly defaultAuthorizationMode: string;\n```\n\n- *Type:* string\n\nDefault auth mode to provide to the Api, required if more than one config type is specified.\n\n---\n\n##### `iamConfig`Optional \n\n```typescript\npublic readonly iamConfig: IAMAuthorizationConfig;\n```\n\n- *Type:* IAMAuthorizationConfig\n\nIAM Auth config, required if an 'iam' auth provider is specified in the Api.\n\nApplies to 'public' and 'private' auth strategies.\n\n---\n\n##### `lambdaConfig`Optional \n\n```typescript\npublic readonly lambdaConfig: LambdaAuthorizationConfig;\n```\n\n- *Type:* LambdaAuthorizationConfig\n\nLambda config, required if a 'function' auth provider is specified in the Api.\n\nApplies to 'custom' auth strategy.\n\n---\n\n##### `oidcConfig`Optional \n\n```typescript\npublic readonly oidcConfig: OIDCAuthorizationConfig;\n```\n\n- *Type:* OIDCAuthorizationConfig\n\nCognito OIDC config, required if a 'oidc' auth provider is specified in the Api.\n\nApplies to 'owner', 'private', and 'group' auth strategies.\n\n---\n\n##### `userPoolConfig`Optional \n\n```typescript\npublic readonly userPoolConfig: UserPoolAuthorizationConfig;\n```\n\n- *Type:* UserPoolAuthorizationConfig\n\nCognito UserPool config, required if a 'userPools' auth provider is specified in the Api.\n\nApplies to 'owner', 'private', and 'group' auth strategies.\n\n---\n\n### AutomergeConflictResolutionStrategy \n\nEnable optimistic concurrency on the project.\n\n#### Initializer \n\n```typescript\nimport { AutomergeConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst automergeConflictResolutionStrategy: AutomergeConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| handlerType | string | This conflict resolution strategy executes an auto-merge. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy executes an auto-merge.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### ConflictResolution \n\nProject level configuration for conflict resolution.\n\n#### Initializer \n\n```typescript\nimport { ConflictResolution } from '@aws-amplify/graphql-api-construct'\n\nconst conflictResolution: ConflictResolution = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| models | {[ key: string ]: AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy} | Model-specific conflict resolution overrides. |\n| project | AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy | Project-wide config for conflict resolution. |\n\n---\n\n##### `models`Optional \n\n```typescript\npublic readonly models: {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy};\n```\n\n- *Type:* {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy}\n\nModel-specific conflict resolution overrides.\n\n---\n\n##### `project`Optional \n\n```typescript\npublic readonly project: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy;\n```\n\n- *Type:* AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy\n\nProject-wide config for conflict resolution.\n\nApplies to all non-overridden models.\n\n---\n\n### ConflictResolutionStrategyBase \n\nCommon parameters for conflict resolution.\n\n#### Initializer \n\n```typescript\nimport { ConflictResolutionStrategyBase } from '@aws-amplify/graphql-api-construct'\n\nconst conflictResolutionStrategyBase: ConflictResolutionStrategyBase = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n### CustomConflictResolutionStrategy \n\nEnable custom sync on the project, powered by a lambda.\n\n#### Initializer \n\n```typescript\nimport { CustomConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst customConflictResolutionStrategy: CustomConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| conflictHandler | aws-cdk-lib.aws_lambda.IFunction | The function which will be invoked for conflict resolution. |\n| handlerType | string | This conflict resolution strategy uses a lambda handler type. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `conflictHandler`Required \n\n```typescript\npublic readonly conflictHandler: IFunction;\n```\n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe function which will be invoked for conflict resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy uses a lambda handler type.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### CustomSqlDataSourceStrategy \n\nThe input type for defining a ModelDataSourceStrategy used to resolve a field annotated with a `@sql` directive.\n\nAlthough this is a\npublic type, you should rarely need to use this. The AmplifyGraphqlDefinition factory methods (e.g., `fromString`,\n`fromFilesAndStrategy`) will automatically construct this structure for you.\n\n#### Initializer \n\n```typescript\nimport { CustomSqlDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst customSqlDataSourceStrategy: CustomSqlDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field name with which the custom SQL is associated. |\n| strategy | SQLLambdaModelDataSourceStrategy | The strategy used to create the datasource that will resolve the custom SQL statement. |\n| typeName | string | The built-in type (either \"Query\" or \"Mutation\") with which the custom SQL is associated. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field name with which the custom SQL is associated.\n\n---\n\n##### `strategy`Required \n\n```typescript\npublic readonly strategy: SQLLambdaModelDataSourceStrategy;\n```\n\n- *Type:* SQLLambdaModelDataSourceStrategy\n\nThe strategy used to create the datasource that will resolve the custom SQL statement.\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThe built-in type (either \"Query\" or \"Mutation\") with which the custom SQL is associated.\n\n---\n\n### DefaultDynamoDbModelDataSourceStrategy \n\nUse default CloudFormation type 'AWS::DynamoDB::Table' to provision table.\n\n#### Initializer \n\n```typescript\nimport { DefaultDynamoDbModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst defaultDynamoDbModelDataSourceStrategy: DefaultDynamoDbModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbType | string | *No description.* |\n| provisionStrategy | string | *No description.* |\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\n---\n\n##### `provisionStrategy`Required \n\n```typescript\npublic readonly provisionStrategy: string;\n```\n\n- *Type:* string\n\n---\n\n### FunctionSlotBase \n\nCommon slot parameters.\n\n#### Initializer \n\n```typescript\nimport { FunctionSlotBase } from '@aws-amplify/graphql-api-construct'\n\nconst functionSlotBase: FunctionSlotBase = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n### FunctionSlotOverride \n\nParams exposed to support configuring and overriding pipelined slots.\n\nThis allows configuration of the underlying function,\nincluding the request and response mapping templates.\n\n#### Initializer \n\n```typescript\nimport { FunctionSlotOverride } from '@aws-amplify/graphql-api-construct'\n\nconst functionSlotOverride: FunctionSlotOverride = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| requestMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | Override request mapping template for the function slot. |\n| responseMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | Override response mapping template for the function slot. |\n\n---\n\n##### `requestMappingTemplate`Optional \n\n```typescript\npublic readonly requestMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n\nOverride request mapping template for the function slot.\n\nExecuted before the datasource is invoked.\n\n---\n\n##### `responseMappingTemplate`Optional \n\n```typescript\npublic readonly responseMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n\nOverride response mapping template for the function slot.\n\nExecuted after the datasource is invoked.\n\n---\n\n### IAMAuthorizationConfig \n\nConfiguration for IAM Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { IAMAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst iAMAuthorizationConfig: IAMAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| authenticatedUserRole | aws-cdk-lib.aws_iam.IRole | Authenticated user role, applies to { provider: iam, allow: private } access. |\n| identityPoolId | string | ID for the Cognito Identity Pool vending auth and unauth roles. |\n| unauthenticatedUserRole | aws-cdk-lib.aws_iam.IRole | Unauthenticated user role, applies to { provider: iam, allow: public } access. |\n| allowListedRoles | string \\| aws-cdk-lib.aws_iam.IRole[] | A list of IAM roles which will be granted full read/write access to the generated model if IAM auth is enabled. |\n\n---\n\n##### `authenticatedUserRole`Required \n\n```typescript\npublic readonly authenticatedUserRole: IRole;\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole\n\nAuthenticated user role, applies to { provider: iam, allow: private } access.\n\n---\n\n##### `identityPoolId`Required \n\n```typescript\npublic readonly identityPoolId: string;\n```\n\n- *Type:* string\n\nID for the Cognito Identity Pool vending auth and unauth roles.\n\nFormat: `:`\n\n---\n\n##### `unauthenticatedUserRole`Required \n\n```typescript\npublic readonly unauthenticatedUserRole: IRole;\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole\n\nUnauthenticated user role, applies to { provider: iam, allow: public } access.\n\n---\n\n##### `allowListedRoles`Optional \n\n```typescript\npublic readonly allowListedRoles: string | IRole[];\n```\n\n- *Type:* string | aws-cdk-lib.aws_iam.IRole[]\n\nA list of IAM roles which will be granted full read/write access to the generated model if IAM auth is enabled.\n\nIf an IRole is provided, the role `name` will be used for matching.\nIf a string is provided, the raw value will be used for matching.\n\n---\n\n### LambdaAuthorizationConfig \n\nConfiguration for Custom Lambda authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { LambdaAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst lambdaAuthorizationConfig: LambdaAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| function | aws-cdk-lib.aws_lambda.IFunction | The authorizer lambda function. |\n| ttl | aws-cdk-lib.Duration | How long the results are cached. |\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: IFunction;\n```\n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe authorizer lambda function.\n\n---\n\n##### `ttl`Required \n\n```typescript\npublic readonly ttl: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nHow long the results are cached.\n\n---\n\n### MutationFunctionSlot \n\nSlot types for Mutation Resolvers.\n\n#### Initializer \n\n```typescript\nimport { MutationFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst mutationFunctionSlot: MutationFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Mutation type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Mutation type on the Api definition.\n\n---\n\n### OIDCAuthorizationConfig \n\nConfiguration for OpenId Connect Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { OIDCAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst oIDCAuthorizationConfig: OIDCAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| oidcIssuerUrl | string | Url for the OIDC token issuer. |\n| oidcProviderName | string | The issuer for the OIDC configuration. |\n| tokenExpiryFromAuth | aws-cdk-lib.Duration | The duration an OIDC token is valid after being authenticated by OIDC provider. |\n| tokenExpiryFromIssue | aws-cdk-lib.Duration | The duration an OIDC token is valid after being issued to a user. |\n| clientId | string | The client identifier of the Relying party at the OpenID identity provider. |\n\n---\n\n##### `oidcIssuerUrl`Required \n\n```typescript\npublic readonly oidcIssuerUrl: string;\n```\n\n- *Type:* string\n\nUrl for the OIDC token issuer.\n\n---\n\n##### `oidcProviderName`Required \n\n```typescript\npublic readonly oidcProviderName: string;\n```\n\n- *Type:* string\n\nThe issuer for the OIDC configuration.\n\n---\n\n##### `tokenExpiryFromAuth`Required \n\n```typescript\npublic readonly tokenExpiryFromAuth: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nThe duration an OIDC token is valid after being authenticated by OIDC provider.\n\nauth_time claim in OIDC token is required for this validation to work.\n\n---\n\n##### `tokenExpiryFromIssue`Required \n\n```typescript\npublic readonly tokenExpiryFromIssue: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nThe duration an OIDC token is valid after being issued to a user.\n\nThis validation uses iat claim of OIDC token.\n\n---\n\n##### `clientId`Optional \n\n```typescript\npublic readonly clientId: string;\n```\n\n- *Type:* string\n\nThe client identifier of the Relying party at the OpenID identity provider.\n\nA regular expression can be specified so AppSync can validate against multiple client identifiers at a time. Example\n\n---\n\n### OptimisticConflictResolutionStrategy \n\nEnable automerge on the project.\n\n#### Initializer \n\n```typescript\nimport { OptimisticConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst optimisticConflictResolutionStrategy: OptimisticConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| handlerType | string | This conflict resolution strategy the _version to perform optimistic concurrency. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy the _version to perform optimistic concurrency.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### PartialTranslationBehavior \n\nA utility interface equivalent to Partial.\n\n#### Initializer \n\n```typescript\nimport { PartialTranslationBehavior } from '@aws-amplify/graphql-api-construct'\n\nconst partialTranslationBehavior: PartialTranslationBehavior = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| allowDestructiveGraphqlSchemaUpdates | boolean | The following schema updates require replacement of the underlying DynamoDB table:. |\n| disableResolverDeduping | boolean | Disable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered. |\n| enableAutoIndexQueryNames | boolean | Automate generation of query names, and as a result attaching all indexes as queries to the generated Api. |\n| enableSearchNodeToNodeEncryption | boolean | If enabled, set nodeToNodeEncryption on the searchable domain (if one exists). |\n| enableTransformerCfnOutputs | boolean | When enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted. |\n| populateOwnerFieldForStaticGroupAuth | boolean | Ensure that the owner field is still populated even if a static iam or group authorization applies. |\n| replaceTableUponGsiUpdate | boolean | This behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true. |\n| respectPrimaryKeyAttributesOnConnectionField | boolean | Enable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app. |\n| sandboxModeEnabled | boolean | Enabling sandbox mode will enable api key auth on all models in the transformed schema. |\n| secondaryKeyAsGSI | boolean | If disabled, generated. |\n| shouldDeepMergeDirectiveConfigDefaults | boolean | Restore parity w/ GQLv1. |\n| suppressApiKeyGeneration | boolean | If enabled, disable api key resource generation even if specified as an auth rule on the construct. |\n| useSubUsernameForDefaultIdentityClaim | boolean | Ensure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool. |\n\n---\n\n##### `allowDestructiveGraphqlSchemaUpdates`Optional \n\n```typescript\npublic readonly allowDestructiveGraphqlSchemaUpdates: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThe following schema updates require replacement of the underlying DynamoDB table:.\n\nRemoving or renaming a model\n - Modifying the primary key of a model\n - Modifying a Local Secondary Index of a model (only applies to projects with secondaryKeyAsGSI turned off)\n\nALL DATA WILL BE LOST when the table replacement happens. When enabled, destructive updates are allowed.\nThis will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `disableResolverDeduping`Optional \n\n```typescript\npublic readonly disableResolverDeduping: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nDisable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered.\n\n---\n\n##### `enableAutoIndexQueryNames`Optional \n\n```typescript\npublic readonly enableAutoIndexQueryNames: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nAutomate generation of query names, and as a result attaching all indexes as queries to the generated Api.\n\nIf enabled,\n\n---\n\n##### `enableSearchNodeToNodeEncryption`Optional \n\n```typescript\npublic readonly enableSearchNodeToNodeEncryption: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, set nodeToNodeEncryption on the searchable domain (if one exists).\n\nNot recommended for use, prefer\nto use `Object.values(resources.additionalResources['AWS::Elasticsearch::Domain']).forEach((domain: CfnDomain) => {\n domain.NodeToNodeEncryptionOptions = { Enabled: True };\n});\n\n---\n\n##### `enableTransformerCfnOutputs`Optional \n\n```typescript\npublic readonly enableTransformerCfnOutputs: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nWhen enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted.\n\n---\n\n##### `populateOwnerFieldForStaticGroupAuth`Optional \n\n```typescript\npublic readonly populateOwnerFieldForStaticGroupAuth: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that the owner field is still populated even if a static iam or group authorization applies.\n\n---\n\n##### `replaceTableUponGsiUpdate`Optional \n\n```typescript\npublic readonly replaceTableUponGsiUpdate: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThis behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true.\n\nWhen enabled, any global secondary index update operation will replace the table instead of iterative deployment, which will WIPE ALL\nEXISTING DATA but cost much less time for deployment This will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `respectPrimaryKeyAttributesOnConnectionField`Optional \n\n```typescript\npublic readonly respectPrimaryKeyAttributesOnConnectionField: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app.\n\n---\n\n##### `sandboxModeEnabled`Optional \n\n```typescript\npublic readonly sandboxModeEnabled: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nEnabling sandbox mode will enable api key auth on all models in the transformed schema.\n\n---\n\n##### `secondaryKeyAsGSI`Optional \n\n```typescript\npublic readonly secondaryKeyAsGSI: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nIf disabled, generated.\n\n---\n\n##### `shouldDeepMergeDirectiveConfigDefaults`Optional \n\n```typescript\npublic readonly shouldDeepMergeDirectiveConfigDefaults: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nRestore parity w/ GQLv1.\n\n---\n\n##### `suppressApiKeyGeneration`Optional \n\n```typescript\npublic readonly suppressApiKeyGeneration: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, disable api key resource generation even if specified as an auth rule on the construct.\n\nThis is a legacy parameter from the Graphql Transformer existing in Amplify CLI, not recommended to change.\n\n---\n\n##### `useSubUsernameForDefaultIdentityClaim`Optional \n\n```typescript\npublic readonly useSubUsernameForDefaultIdentityClaim: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool.\n\n---\n\n### ProvisionedConcurrencyConfig \n\nThe configuration for the provisioned concurrency of the Lambda.\n\n#### Initializer \n\n```typescript\nimport { ProvisionedConcurrencyConfig } from '@aws-amplify/graphql-api-construct'\n\nconst provisionedConcurrencyConfig: ProvisionedConcurrencyConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| provisionedConcurrentExecutions | number | The amount of provisioned concurrency to allocate. |\n\n---\n\n##### `provisionedConcurrentExecutions`Required \n\n```typescript\npublic readonly provisionedConcurrentExecutions: number;\n```\n\n- *Type:* number\n\nThe amount of provisioned concurrency to allocate.\n\n*\n\n---\n\n### ProvisionedThroughput \n\nWrapper for provisioned throughput config in DDB.\n\n#### Initializer \n\n```typescript\nimport { ProvisionedThroughput } from '@aws-amplify/graphql-api-construct'\n\nconst provisionedThroughput: ProvisionedThroughput = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| readCapacityUnits | number | The read capacity units on the table or index. |\n| writeCapacityUnits | number | The write capacity units on the table or index. |\n\n---\n\n##### `readCapacityUnits`Required \n\n```typescript\npublic readonly readCapacityUnits: number;\n```\n\n- *Type:* number\n\nThe read capacity units on the table or index.\n\n---\n\n##### `writeCapacityUnits`Required \n\n```typescript\npublic readonly writeCapacityUnits: number;\n```\n\n- *Type:* number\n\nThe write capacity units on the table or index.\n\n---\n\n### QueryFunctionSlot \n\nSlot types for Query Resolvers.\n\n#### Initializer \n\n```typescript\nimport { QueryFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst queryFunctionSlot: QueryFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Query type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Query type on the Api definition.\n\n---\n\n### SQLLambdaModelDataSourceStrategy \n\nA strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.\n\n#### Initializer \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst sQLLambdaModelDataSourceStrategy: SQLLambdaModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbConnectionConfig | SqlModelDataSourceSecretsManagerDbConnectionConfig \\| SqlModelDataSourceSsmDbConnectionConfig | The parameters the Lambda data source will use to connect to the database. |\n| dbType | string | The type of the SQL database used to process model operations for this definition. |\n| name | string | The name of the strategy. |\n| customSqlStatements | {[ key: string ]: string} | Custom SQL statements. |\n| sqlLambdaProvisionedConcurrencyConfig | ProvisionedConcurrencyConfig | The configuration for the provisioned concurrency of the Lambda. |\n| vpcConfiguration | VpcConfig | The configuration of the VPC into which to install the Lambda. |\n\n---\n\n##### `dbConnectionConfig`Required \n\n```typescript\npublic readonly dbConnectionConfig: SqlModelDataSourceSecretsManagerDbConnectionConfig | SqlModelDataSourceSsmDbConnectionConfig;\n```\n\n- *Type:* SqlModelDataSourceSecretsManagerDbConnectionConfig | SqlModelDataSourceSsmDbConnectionConfig\n\nThe parameters the Lambda data source will use to connect to the database.\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\nThe type of the SQL database used to process model operations for this definition.\n\n---\n\n##### `name`Required \n\n```typescript\npublic readonly name: string;\n```\n\n- *Type:* string\n\nThe name of the strategy.\n\nThis will be used to name the AppSync DataSource itself, plus any associated resources like resolver Lambdas.\nThis name must be unique across all schema definitions in a GraphQL API.\n\n---\n\n##### `customSqlStatements`Optional \n\n```typescript\npublic readonly customSqlStatements: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nCustom SQL statements.\n\nThe key is the value of the `references` attribute of the `@sql` directive in the `schema`; the value is the SQL\nto be executed.\n\n---\n\n##### `sqlLambdaProvisionedConcurrencyConfig`Optional \n\n```typescript\npublic readonly sqlLambdaProvisionedConcurrencyConfig: ProvisionedConcurrencyConfig;\n```\n\n- *Type:* ProvisionedConcurrencyConfig\n\nThe configuration for the provisioned concurrency of the Lambda.\n\n---\n\n##### `vpcConfiguration`Optional \n\n```typescript\npublic readonly vpcConfiguration: VpcConfig;\n```\n\n- *Type:* VpcConfig\n\nThe configuration of the VPC into which to install the Lambda.\n\n---\n\n### SqlModelDataSourceSecretsManagerDbConnectionConfig \n\n#### Initializer \n\n```typescript\nimport { SqlModelDataSourceSecretsManagerDbConnectionConfig } from '@aws-amplify/graphql-api-construct'\n\nconst sqlModelDataSourceSecretsManagerDbConnectionConfig: SqlModelDataSourceSecretsManagerDbConnectionConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| databaseName | string | database name. |\n| port | number | port number of the database proxy, cluster, or instance. |\n| secretArn | string | The arn of the managed secret with username, password, and hostname to use when connecting to the database. |\n\n---\n\n##### `databaseName`Required \n\n```typescript\npublic readonly databaseName: string;\n```\n\n- *Type:* string\n\ndatabase name.\n\n---\n\n##### `port`Required \n\n```typescript\npublic readonly port: number;\n```\n\n- *Type:* number\n\nport number of the database proxy, cluster, or instance.\n\n---\n\n##### `secretArn`Required \n\n```typescript\npublic readonly secretArn: string;\n```\n\n- *Type:* string\n\nThe arn of the managed secret with username, password, and hostname to use when connecting to the database.\n\n*\n\n---\n\n### SqlModelDataSourceSsmDbConnectionConfig \n\nThe Secure Systems Manager parameter paths the Lambda data source will use to connect to the database.\n\nThese parameters are retrieved from Secure Systems Manager in the same region as the Lambda.\n\n#### Initializer \n\n```typescript\nimport { SqlModelDataSourceSsmDbConnectionConfig } from '@aws-amplify/graphql-api-construct'\n\nconst sqlModelDataSourceSsmDbConnectionConfig: SqlModelDataSourceSsmDbConnectionConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| databaseNameSsmPath | string | The Secure Systems Manager parameter containing the database name. |\n| hostnameSsmPath | string | The Secure Systems Manager parameter containing the hostname of the database. |\n| passwordSsmPath | string | The Secure Systems Manager parameter containing the password to use when connecting to the database. |\n| portSsmPath | string | The Secure Systems Manager parameter containing the port number of the database proxy, cluster, or instance. |\n| usernameSsmPath | string | The Secure Systems Manager parameter containing the username to use when connecting to the database. |\n\n---\n\n##### `databaseNameSsmPath`Required \n\n```typescript\npublic readonly databaseNameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the database name.\n\n---\n\n##### `hostnameSsmPath`Required \n\n```typescript\npublic readonly hostnameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the hostname of the database.\n\nFor RDS-based SQL data sources, this can be the hostname\nof a database proxy, cluster, or instance.\n\n---\n\n##### `passwordSsmPath`Required \n\n```typescript\npublic readonly passwordSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the password to use when connecting to the database.\n\n---\n\n##### `portSsmPath`Required \n\n```typescript\npublic readonly portSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the port number of the database proxy, cluster, or instance.\n\n---\n\n##### `usernameSsmPath`Required \n\n```typescript\npublic readonly usernameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the username to use when connecting to the database.\n\n---\n\n### SSESpecification \n\nRepresents the settings used to enable server-side encryption.\n\n#### Initializer \n\n```typescript\nimport { SSESpecification } from '@aws-amplify/graphql-api-construct'\n\nconst sSESpecification: SSESpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| sseEnabled | boolean | Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key. |\n| kmsMasterKeyId | string | The AWS KMS key that should be used for the AWS KMS encryption. |\n| sseType | SSEType | Server-side encryption type. |\n\n---\n\n##### `sseEnabled`Required \n\n```typescript\npublic readonly sseEnabled: boolean;\n```\n\n- *Type:* boolean\n\nIndicates whether server-side encryption is done using an AWS managed key or an AWS owned key.\n\nIf enabled (true), server-side encryption type is set to `KMS` and an AWS managed key is used ( AWS KMS charges apply).\nIf disabled (false) or not specified, server-side encryption is set to AWS owned key.\n\n---\n\n##### `kmsMasterKeyId`Optional \n\n```typescript\npublic readonly kmsMasterKeyId: string;\n```\n\n- *Type:* string\n\nThe AWS KMS key that should be used for the AWS KMS encryption.\n\nTo specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide\nthis parameter if the key is different from the default DynamoDB key `alias/aws/dynamodb` .\n\n---\n\n##### `sseType`Optional \n\n```typescript\npublic readonly sseType: SSEType;\n```\n\n- *Type:* SSEType\n\nServer-side encryption type.\n\nThe only supported value is:\n`KMS` Server-side encryption that uses AWS Key Management Service.\n The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).\n\n---\n\n### StreamSpecification \n\nRepresents the DynamoDB Streams configuration for a table in DynamoDB.\n\n#### Initializer \n\n```typescript\nimport { StreamSpecification } from '@aws-amplify/graphql-api-construct'\n\nconst streamSpecification: StreamSpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| streamViewType | aws-cdk-lib.aws_dynamodb.StreamViewType | When an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table. |\n\n---\n\n##### `streamViewType`Required \n\n```typescript\npublic readonly streamViewType: StreamViewType;\n```\n\n- *Type:* aws-cdk-lib.aws_dynamodb.StreamViewType\n\nWhen an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table.\n\nValid values for `StreamViewType` are:\n- `KEYS_ONLY` - Only the key attributes of the modified item are written to the stream.\n- `NEW_IMAGE` - The entire item, as it appears after it was modified, is written to the stream.\n- `OLD_IMAGE` - The entire item, as it appeared before it was modified, is written to the stream.\n- `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the item are written to the stream.\n\n---\n\n### SubnetAvailabilityZone \n\nSubnet configuration for VPC endpoints used by a Lambda resolver for a SQL-based data source.\n\nAlthough it is possible to create multiple\nsubnets in a single availability zone, VPC service endpoints may only be deployed to a single subnet in a given availability zone. This\nstructure ensures that the Lambda function and VPC service endpoints are mutually consistent.\n\n#### Initializer \n\n```typescript\nimport { SubnetAvailabilityZone } from '@aws-amplify/graphql-api-construct'\n\nconst subnetAvailabilityZone: SubnetAvailabilityZone = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| availabilityZone | string | The availability zone of the subnet. |\n| subnetId | string | The subnet ID to install the Lambda data source in. |\n\n---\n\n##### `availabilityZone`Required \n\n```typescript\npublic readonly availabilityZone: string;\n```\n\n- *Type:* string\n\nThe availability zone of the subnet.\n\n---\n\n##### `subnetId`Required \n\n```typescript\npublic readonly subnetId: string;\n```\n\n- *Type:* string\n\nThe subnet ID to install the Lambda data source in.\n\n---\n\n### SubscriptionFunctionSlot \n\nSlot types for Subscription Resolvers.\n\n#### Initializer \n\n```typescript\nimport { SubscriptionFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst subscriptionFunctionSlot: SubscriptionFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Subscription type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Subscription type on the Api definition.\n\n---\n\n### TimeToLiveSpecification \n\nShape for TTL config.\n\n#### Initializer \n\n```typescript\nimport { TimeToLiveSpecification } from '@aws-amplify/graphql-api-construct'\n\nconst timeToLiveSpecification: TimeToLiveSpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| enabled | boolean | Boolean determining if the ttl is enabled or not. |\n| attributeName | string | Attribute name to apply to the ttl spec. |\n\n---\n\n##### `enabled`Required \n\n```typescript\npublic readonly enabled: boolean;\n```\n\n- *Type:* boolean\n\nBoolean determining if the ttl is enabled or not.\n\n---\n\n##### `attributeName`Optional \n\n```typescript\npublic readonly attributeName: string;\n```\n\n- *Type:* string\n\nAttribute name to apply to the ttl spec.\n\n---\n\n### TranslationBehavior \n\nStrongly typed set of shared parameters for all transformers, and core layer.\n\nThis is intended to replace feature flags, to ensure param coercion happens in\na single location, and isn't spread around the transformers, where they can\nhave different default behaviors.\n\n#### Initializer \n\n```typescript\nimport { TranslationBehavior } from '@aws-amplify/graphql-api-construct'\n\nconst translationBehavior: TranslationBehavior = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| allowDestructiveGraphqlSchemaUpdates | boolean | The following schema updates require replacement of the underlying DynamoDB table:. |\n| disableResolverDeduping | boolean | Disable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered. |\n| enableAutoIndexQueryNames | boolean | Automate generation of query names, and as a result attaching all indexes as queries to the generated Api. |\n| enableSearchNodeToNodeEncryption | boolean | *No description.* |\n| enableTransformerCfnOutputs | boolean | When enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted. |\n| populateOwnerFieldForStaticGroupAuth | boolean | Ensure that the owner field is still populated even if a static iam or group authorization applies. |\n| replaceTableUponGsiUpdate | boolean | This behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true. |\n| respectPrimaryKeyAttributesOnConnectionField | boolean | Enable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app. |\n| sandboxModeEnabled | boolean | Enabling sandbox mode will enable api key auth on all models in the transformed schema. |\n| secondaryKeyAsGSI | boolean | If disabled, generated. |\n| shouldDeepMergeDirectiveConfigDefaults | boolean | Restore parity w/ GQLv1. |\n| suppressApiKeyGeneration | boolean | If enabled, disable api key resource generation even if specified as an auth rule on the construct. |\n| useSubUsernameForDefaultIdentityClaim | boolean | Ensure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool. |\n\n---\n\n##### `allowDestructiveGraphqlSchemaUpdates`Required \n\n```typescript\npublic readonly allowDestructiveGraphqlSchemaUpdates: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThe following schema updates require replacement of the underlying DynamoDB table:.\n\nRemoving or renaming a model\n - Modifying the primary key of a model\n - Modifying a Local Secondary Index of a model (only applies to projects with secondaryKeyAsGSI turned off)\n\nALL DATA WILL BE LOST when the table replacement happens. When enabled, destructive updates are allowed.\nThis will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `disableResolverDeduping`Required \n\n```typescript\npublic readonly disableResolverDeduping: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nDisable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered.\n\n---\n\n##### `enableAutoIndexQueryNames`Required \n\n```typescript\npublic readonly enableAutoIndexQueryNames: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nAutomate generation of query names, and as a result attaching all indexes as queries to the generated Api.\n\nIf enabled,\n\n---\n\n##### `enableSearchNodeToNodeEncryption`Required \n\n```typescript\npublic readonly enableSearchNodeToNodeEncryption: boolean;\n```\n\n- *Type:* boolean\n\n---\n\n##### `enableTransformerCfnOutputs`Required \n\n```typescript\npublic readonly enableTransformerCfnOutputs: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nWhen enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted.\n\n---\n\n##### `populateOwnerFieldForStaticGroupAuth`Required \n\n```typescript\npublic readonly populateOwnerFieldForStaticGroupAuth: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that the owner field is still populated even if a static iam or group authorization applies.\n\n---\n\n##### `replaceTableUponGsiUpdate`Required \n\n```typescript\npublic readonly replaceTableUponGsiUpdate: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThis behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true.\n\nWhen enabled, any GSI update operation will replace the table instead of iterative deployment, which will WIPE ALL EXISTING DATA but\ncost much less time for deployment This will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `respectPrimaryKeyAttributesOnConnectionField`Required \n\n```typescript\npublic readonly respectPrimaryKeyAttributesOnConnectionField: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app.\n\n---\n\n##### `sandboxModeEnabled`Required \n\n```typescript\npublic readonly sandboxModeEnabled: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nEnabling sandbox mode will enable api key auth on all models in the transformed schema.\n\n---\n\n##### `secondaryKeyAsGSI`Required \n\n```typescript\npublic readonly secondaryKeyAsGSI: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nIf disabled, generated.\n\n---\n\n##### `shouldDeepMergeDirectiveConfigDefaults`Required \n\n```typescript\npublic readonly shouldDeepMergeDirectiveConfigDefaults: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nRestore parity w/ GQLv1.\n\n---\n\n##### `suppressApiKeyGeneration`Required \n\n```typescript\npublic readonly suppressApiKeyGeneration: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, disable api key resource generation even if specified as an auth rule on the construct.\n\nThis is a legacy parameter from the Graphql Transformer existing in Amplify CLI, not recommended to change.\n\n---\n\n##### `useSubUsernameForDefaultIdentityClaim`Required \n\n```typescript\npublic readonly useSubUsernameForDefaultIdentityClaim: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool.\n\n---\n\n### UserPoolAuthorizationConfig \n\nConfiguration for Cognito UserPool Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { UserPoolAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst userPoolAuthorizationConfig: UserPoolAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| userPool | aws-cdk-lib.aws_cognito.IUserPool | The Cognito User Pool which is used to authenticated JWT tokens, and vends group and user information. |\n\n---\n\n##### `userPool`Required \n\n```typescript\npublic readonly userPool: IUserPool;\n```\n\n- *Type:* aws-cdk-lib.aws_cognito.IUserPool\n\nThe Cognito User Pool which is used to authenticated JWT tokens, and vends group and user information.\n\n---\n\n### VpcConfig \n\nConfiguration of the VPC in which to install a Lambda to resolve queries against a SQL-based data source.\n\nThe SQL Lambda will be deployed\ninto the specified VPC, subnets, and security groups. The specified subnets and security groups must be in the same VPC. The VPC must\nhave at least one subnet. The construct will also create VPC service endpoints in the specified subnets, as well as inbound security\nrules, to allow traffic on port 443 within each security group. This allows the Lambda to read database connection information from\nSecure Systems Manager.\n\n#### Initializer \n\n```typescript\nimport { VpcConfig } from '@aws-amplify/graphql-api-construct'\n\nconst vpcConfig: VpcConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| securityGroupIds | string[] | The security groups to install the Lambda data source in. |\n| subnetAvailabilityZoneConfig | SubnetAvailabilityZone[] | The subnets to install the Lambda data source in, one per availability zone. |\n| vpcId | string | The VPC to install the Lambda data source in. |\n\n---\n\n##### `securityGroupIds`Required \n\n```typescript\npublic readonly securityGroupIds: string[];\n```\n\n- *Type:* string[]\n\nThe security groups to install the Lambda data source in.\n\n---\n\n##### `subnetAvailabilityZoneConfig`Required \n\n```typescript\npublic readonly subnetAvailabilityZoneConfig: SubnetAvailabilityZone[];\n```\n\n- *Type:* SubnetAvailabilityZone[]\n\nThe subnets to install the Lambda data source in, one per availability zone.\n\n---\n\n##### `vpcId`Required \n\n```typescript\npublic readonly vpcId: string;\n```\n\n- *Type:* string\n\nThe VPC to install the Lambda data source in.\n\n---\n\n## Classes \n\n### AmplifyDynamoDbTableWrapper \n\nWrapper class around Custom::AmplifyDynamoDBTable custom resource, to simplify the override experience a bit.\n\nThis is NOT a construct, just an easier way to access\nthe generated construct.\nThis is a wrapper intended to mimic the `aws_cdk_lib.aws_dynamodb.Table` functionality more-or-less.\nNotable differences is the addition of TKTK properties, to account for the fact that they're constructor props\nin the CDK construct, as well as the removal of all from*, grant*, and metric* methods implemented by Table.\n\n#### Initializers \n\n```typescript\nimport { AmplifyDynamoDbTableWrapper } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyDynamoDbTableWrapper(resource: CfnResource)\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| resource | aws-cdk-lib.CfnResource | the Cfn resource. |\n\n---\n\n##### `resource`Required \n\n- *Type:* aws-cdk-lib.CfnResource\n\nthe Cfn resource.\n\n---\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| setGlobalSecondaryIndexProvisionedThroughput | Set the provisionedThroughtput for a specified GSI by name. |\n\n---\n\n##### `setGlobalSecondaryIndexProvisionedThroughput` \n\n```typescript\npublic setGlobalSecondaryIndexProvisionedThroughput(indexName: string, provisionedThroughput: ProvisionedThroughput): void\n```\n\nSet the provisionedThroughtput for a specified GSI by name.\n\n###### `indexName`Required \n\n- *Type:* string\n\nthe index to specify a provisionedThroughput config for.\n\n---\n\n###### `provisionedThroughput`Required \n\n- *Type:* ProvisionedThroughput\n\nthe config to set.\n\n---\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| isAmplifyDynamoDbTableResource | Return true and perform type narrowing if a given input appears to be capable of. |\n\n---\n\n##### `isAmplifyDynamoDbTableResource` \n\n```typescript\nimport { AmplifyDynamoDbTableWrapper } from '@aws-amplify/graphql-api-construct'\n\nAmplifyDynamoDbTableWrapper.isAmplifyDynamoDbTableResource(x: any)\n```\n\nReturn true and perform type narrowing if a given input appears to be capable of.\n\n###### `x`Required \n\n- *Type:* any\n\nthe object to check.\n\n---\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| billingMode | aws-cdk-lib.aws_dynamodb.BillingMode | Specify how you are charged for read and write throughput and how you manage capacity. |\n| deletionProtectionEnabled | boolean | Set table deletion protection. |\n| pointInTimeRecoveryEnabled | boolean | Whether point-in-time recovery is enabled. |\n| provisionedThroughput | ProvisionedThroughput | Update the provisioned throughput for the base table. |\n| sseSpecification | SSESpecification | Set the ddb server-side encryption specification on the table. |\n| streamSpecification | StreamSpecification | Set the ddb stream specification on the table. |\n| timeToLiveAttribute | TimeToLiveSpecification | The name of TTL attribute. |\n\n---\n\n##### `billingMode`Required \n\n```typescript\npublic readonly billingMode: BillingMode;\n```\n\n- *Type:* aws-cdk-lib.aws_dynamodb.BillingMode\n\nSpecify how you are charged for read and write throughput and how you manage capacity.\n\n---\n\n##### `deletionProtectionEnabled`Required \n\n```typescript\npublic readonly deletionProtectionEnabled: boolean;\n```\n\n- *Type:* boolean\n\nSet table deletion protection.\n\n---\n\n##### `pointInTimeRecoveryEnabled`Required \n\n```typescript\npublic readonly pointInTimeRecoveryEnabled: boolean;\n```\n\n- *Type:* boolean\n\nWhether point-in-time recovery is enabled.\n\n---\n\n##### `provisionedThroughput`Required \n\n```typescript\npublic readonly provisionedThroughput: ProvisionedThroughput;\n```\n\n- *Type:* ProvisionedThroughput\n\nUpdate the provisioned throughput for the base table.\n\n---\n\n##### `sseSpecification`Required \n\n```typescript\npublic readonly sseSpecification: SSESpecification;\n```\n\n- *Type:* SSESpecification\n\nSet the ddb server-side encryption specification on the table.\n\n---\n\n##### `streamSpecification`Required \n\n```typescript\npublic readonly streamSpecification: StreamSpecification;\n```\n\n- *Type:* StreamSpecification\n\nSet the ddb stream specification on the table.\n\n---\n\n##### `timeToLiveAttribute`Required \n\n```typescript\npublic readonly timeToLiveAttribute: TimeToLiveSpecification;\n```\n\n- *Type:* TimeToLiveSpecification\n\nThe name of TTL attribute.\n\n---\n\n\n### AmplifyGraphqlDefinition \n\nClass exposing utilities to produce IAmplifyGraphqlDefinition objects given various inputs.\n\n#### Initializers \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyGraphqlDefinition()\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n\n---\n\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| combine | Combines multiple IAmplifyGraphqlDefinitions into a single definition. |\n| fromFiles | Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source. |\n| fromFilesAndStrategy | Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema. |\n| fromString | Produce a schema definition from a string input. |\n\n---\n\n##### `combine` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.combine(definitions: IAmplifyGraphqlDefinition[])\n```\n\nCombines multiple IAmplifyGraphqlDefinitions into a single definition.\n\n###### `definitions`Required \n\n- *Type:* IAmplifyGraphqlDefinition[]\n\nthe definitions to combine.\n\n---\n\n##### `fromFiles` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromFiles(filePaths: string)\n```\n\nConvert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source.\n\n###### `filePaths`Required \n\n- *Type:* string\n\none or more paths to the graphql files to process.\n\n---\n\n##### `fromFilesAndStrategy` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromFilesAndStrategy(filePaths: string | string[], dataSourceStrategy?: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy)\n```\n\nConvert one or more appsync SchemaFile objects into an Amplify Graphql Schema.\n\n###### `filePaths`Required \n\n- *Type:* string | string[]\n\none or more paths to the graphql files to process.\n\n---\n\n###### `dataSourceStrategy`Optional \n\n- *Type:* DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy\n\nthe provisioning definition for datasources that resolve `@model`s in this schema.\n\nThe DynamoDB from\nCloudFormation will be used by default.\n\n---\n\n##### `fromString` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromString(schema: string, dataSourceStrategy?: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy)\n```\n\nProduce a schema definition from a string input.\n\n###### `schema`Required \n\n- *Type:* string\n\nthe graphql input as a string.\n\n---\n\n###### `dataSourceStrategy`Optional \n\n- *Type:* DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy\n\nthe provisioning definition for datasources that resolve `@model`s and custom SQL statements in this schema.\n\nThe DynamoDB from CloudFormation will be used by default.\n\n---\n\n\n\n### SQLLambdaModelDataSourceStrategyFactory \n\nClass exposing utilities to produce SQLLambdaModelDataSourceStrategy objects given various inputs.\n\n#### Initializers \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategyFactory } from '@aws-amplify/graphql-api-construct'\n\nnew SQLLambdaModelDataSourceStrategyFactory()\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n\n---\n\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| fromCustomSqlFiles | Creates a SQLLambdaModelDataSourceStrategy where the binding's `customSqlStatements` are populated from `sqlFiles`. |\n\n---\n\n##### `fromCustomSqlFiles` \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategyFactory } from '@aws-amplify/graphql-api-construct'\n\nSQLLambdaModelDataSourceStrategyFactory.fromCustomSqlFiles(sqlFiles: string[], options: SQLLambdaModelDataSourceStrategy)\n```\n\nCreates a SQLLambdaModelDataSourceStrategy where the binding's `customSqlStatements` are populated from `sqlFiles`.\n\nThe key\nof the `customSqlStatements` record is the file's base name (that is, the name of the file minus the directory and extension).\n\n###### `sqlFiles`Required \n\n- *Type:* string[]\n\nthe list of files to load SQL statements from.\n\n---\n\n###### `options`Required \n\n- *Type:* SQLLambdaModelDataSourceStrategy\n\nthe remaining SQLLambdaModelDataSourceStrategy options.\n\n---\n\n\n\n## Protocols \n\n### IAmplifyGraphqlDefinition \n\n- *Implemented By:* IAmplifyGraphqlDefinition\n\nGraphql Api definition, which can be implemented in multiple ways.\n\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dataSourceStrategies | {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy \\| AmplifyDynamoDbModelDataSourceStrategy \\| SQLLambdaModelDataSourceStrategy} | Retrieve the datasource strategy mapping. |\n| functionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Retrieve any function slots defined explicitly in the Api definition. |\n| schema | string | Return the schema definition as a graphql string, with amplify directives allowed. |\n| customSqlDataSourceStrategies | CustomSqlDataSourceStrategy[] | An array of custom Query or Mutation SQL commands to the data sources that resolves them. |\n| referencedLambdaFunctions | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | Retrieve the references to any lambda functions used in the definition. |\n\n---\n\n##### `dataSourceStrategies`Required \n\n```typescript\npublic readonly dataSourceStrategies: {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy};\n```\n\n- *Type:* {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy}\n\nRetrieve the datasource strategy mapping.\n\nThe default strategy is to use DynamoDB from CloudFormation.\n\n---\n\n##### `functionSlots`Required \n\n```typescript\npublic readonly functionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nRetrieve any function slots defined explicitly in the Api definition.\n\n---\n\n##### `schema`Required \n\n```typescript\npublic readonly schema: string;\n```\n\n- *Type:* string\n\nReturn the schema definition as a graphql string, with amplify directives allowed.\n\n---\n\n##### `customSqlDataSourceStrategies`Optional \n\n```typescript\npublic readonly customSqlDataSourceStrategies: CustomSqlDataSourceStrategy[];\n```\n\n- *Type:* CustomSqlDataSourceStrategy[]\n\nAn array of custom Query or Mutation SQL commands to the data sources that resolves them.\n\n---\n\n##### `referencedLambdaFunctions`Optional \n\n```typescript\npublic readonly referencedLambdaFunctions: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nRetrieve the references to any lambda functions used in the definition.\n\nUseful for wiring through aws_lambda.Function constructs into the definition directly,\nand generated references to invoke them.\n\n---\n\n### IBackendOutputEntry \n\n- *Implemented By:* IBackendOutputEntry\n\nEntry representing the required output from the backend for codegen generate commands to work.\n\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| payload | {[ key: string ]: string} | The string-map payload of generated config values. |\n| version | string | The protocol version for this backend output. |\n\n---\n\n##### `payload`Required \n\n```typescript\npublic readonly payload: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nThe string-map payload of generated config values.\n\n---\n\n##### `version`Required \n\n```typescript\npublic readonly version: string;\n```\n\n- *Type:* string\n\nThe protocol version for this backend output.\n\n---\n\n### IBackendOutputStorageStrategy \n\n- *Implemented By:* IBackendOutputStorageStrategy\n\nBackend output strategy used to write config required for codegen tasks.\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| addBackendOutputEntry | Add an entry to backend output. |\n\n---\n\n##### `addBackendOutputEntry` \n\n```typescript\npublic addBackendOutputEntry(keyName: string, backendOutputEntry: IBackendOutputEntry): void\n```\n\nAdd an entry to backend output.\n\n###### `keyName`Required \n\n- *Type:* string\n\nthe key.\n\n---\n\n###### `backendOutputEntry`Required \n\n- *Type:* IBackendOutputEntry\n\nthe record to store in the backend output.\n\n---\n\n\n## Enums \n\n### SSEType \n\nServer Side Encryption Type Values - `KMS` - Server-side encryption that uses AWS KMS.\n\nThe key is stored in your account and is managed by KMS (AWS KMS charges apply).\n\n#### Members \n\n| **Name** | **Description** |\n| --- | --- |\n| KMS | *No description.* |\n\n---\n\n##### `KMS` \n\n---\n\n" + "markdown": "# Amplify Graphql API Construct\n\n[![View on Construct Hub](https://constructs.dev/badge?package=%40aws-amplify%2Fgraphql-api-construct)](https://constructs.dev/packages/@aws-amplify/graphql-api-construct)\n\nThis package vends an L3 CDK Construct wrapping the behavior of the Amplify GraphQL Transformer. This enables quick development and interation of AppSync APIs which support the Amplify GraphQL Directives. For more information on schema modeling in GraphQL, please refer to the [amplify developer docs](https://docs.amplify.aws/cli/graphql/overview/).\n\nThe primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema.\n\n## Examples\n\n### Simple Todo List With Cognito Userpool-based Owner Authorization\n\nIn this example, we create a single model, which will use `user pool` auth in order to allow logged in users to create and manage their own `todos` privately.\n\nWe create a cdk App and Stack, though you may be deploying this to a custom stack, this is purely illustrative for a concise demo.\n\nWe then wire this through to import a user pool which was already deployed (creating and deploying is out of scope for this example).\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'TodoStack');\n\nnew AmplifyGraphqlApi(stack, 'TodoApp', {\n definition: AmplifyGraphqlDefinition.fromString(/* GraphQL */ `\n type Todo @model @auth(rules: [{ allow: owner }]) {\n description: String!\n completed: Boolean\n }\n `),\n authorizationModes: {\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Multiple related models, with public read access, and admin read/write access\n\nIn this example, we create a two related models, which will use which logged in users in the 'Author' and 'Admin' user groups will have\nfull access to, and customers requesting with api key will only have read permissions on.\n\n```ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'BlogStack');\n\nnew AmplifyGraphqlApi(stack, 'BlogApp', {\n definition: AmplifyGraphqlDefinition.fromString(/* GraphQL */ `\n type Blog @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n }\n\n type Post @model @auth(rules: [{ allow: public, operations: [read] }, { allow: groups, groups: [\"Author\", \"Admin\"] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n }\n `),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n### Import GraphQL Schema from files, instead of inline\n\nIn this example, we import the schema definition itself from one or more local files, rather than an inline graphql string.\n\n```graphql\n# todo.graphql\ntype Todo @model @auth(rules: [{ allow: owner }]) {\n content: String!\n done: Boolean\n}\n```\n\n```graphql\n# blog.graphql\ntype Blog @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n description: String\n posts: [Post] @hasMany\n}\n\ntype Post @model @auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {\n title: String!\n content: [String]\n blog: Blog @belongsTo\n}\n```\n\n```ts\n// app.ts\nimport { App, Stack } from 'aws-cdk-lib';\nimport { UserPool } from 'aws-cdk-lib/aws-cognito';\nimport { AmplifyGraphqlApi, AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct';\n\nconst app = new App();\nconst stack = new Stack(app, 'MultiFileStack');\n\nnew AmplifyGraphqlApi(stack, 'MultiFileDefinition', {\n definition: AmplifyGraphqlDefinition.fromFiles(path.join(__dirname, 'todo.graphql'), path.join(__dirname, 'blog.graphql')),\n authorizationModes: {\n defaultAuthorizationMode: 'API_KEY',\n apiKeyConfig: {\n description: 'Api Key for public access',\n expires: cdk.Duration.days(7),\n },\n userPoolConfig: {\n userPool: UserPool.fromUserPoolId(stack, 'ImportedUserPool', ''),\n },\n },\n});\n```\n\n# API Reference \n\n## Constructs \n\n### AmplifyGraphqlApi \n\nL3 Construct which invokes the Amplify Transformer Pattern over an input Graphql Schema.\n\nThis can be used to quickly define appsync apis which support full CRUD+List and Subscriptions, relationships,\nauth, search over data, the ability to inject custom business logic and query/mutation operations, and connect to ML services.\n\nFor more information, refer to the docs links below:\nData Modeling - https://docs.amplify.aws/cli/graphql/data-modeling/\nAuthorization - https://docs.amplify.aws/cli/graphql/authorization-rules/\nCustom Business Logic - https://docs.amplify.aws/cli/graphql/custom-business-logic/\nSearch - https://docs.amplify.aws/cli/graphql/search-and-result-aggregations/\nML Services - https://docs.amplify.aws/cli/graphql/connect-to-machine-learning-services/\n\nFor a full reference of the supported custom graphql directives - https://docs.amplify.aws/cli/graphql/directives-reference/\n\nThe output of this construct is a mapping of L2 or L1 resources generated by the transformer, which generally follow the access pattern\n\n```typescript\n const api = new AmplifyGraphQlApi(this, 'api', { });\n // Access L2 resources under `.resources`\n api.resources.tables[\"Todo\"].tableArn;\n\n // Access L1 resources under `.resources.cfnResources`\n api.resources.cfnResources.cfnGraphqlApi.xrayEnabled = true;\n Object.values(api.resources.cfnResources.cfnTables).forEach(table => {\n table.pointInTimeRecoverySpecification = { pointInTimeRecoveryEnabled: false };\n });\n```\n`resources..` - you can then perform any CDK action on these resulting resoureces.\n\n#### Initializers \n\n```typescript\nimport { AmplifyGraphqlApi } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyGraphqlApi(scope: Construct, id: string, props: AmplifyGraphqlApiProps)\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| scope | constructs.Construct | the scope to create this construct within. |\n| id | string | the id to use for this api. |\n| props | AmplifyGraphqlApiProps | the properties used to configure the generated api. |\n\n---\n\n##### `scope`Required \n\n- *Type:* constructs.Construct\n\nthe scope to create this construct within.\n\n---\n\n##### `id`Required \n\n- *Type:* string\n\nthe id to use for this api.\n\n---\n\n##### `props`Required \n\n- *Type:* AmplifyGraphqlApiProps\n\nthe properties used to configure the generated api.\n\n---\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| toString | Returns a string representation of this construct. |\n| addDynamoDbDataSource | Add a new DynamoDB data source to this API. |\n| addElasticsearchDataSource | Add a new elasticsearch data source to this API. |\n| addEventBridgeDataSource | Add an EventBridge data source to this api. |\n| addFunction | Add an appsync function to the api. |\n| addHttpDataSource | Add a new http data source to this API. |\n| addLambdaDataSource | Add a new Lambda data source to this API. |\n| addNoneDataSource | Add a new dummy data source to this API. |\n| addOpenSearchDataSource | dd a new OpenSearch data source to this API. |\n| addRdsDataSource | Add a new Rds data source to this API. |\n| addResolver | Add a resolver to the api. |\n\n---\n\n##### `toString` \n\n```typescript\npublic toString(): string\n```\n\nReturns a string representation of this construct.\n\n##### `addDynamoDbDataSource` \n\n```typescript\npublic addDynamoDbDataSource(id: string, table: ITable, options?: DataSourceOptions): DynamoDbDataSource\n```\n\nAdd a new DynamoDB data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `table`Required \n\n- *Type:* aws-cdk-lib.aws_dynamodb.ITable\n\nThe DynamoDB table backing this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### ~~`addElasticsearchDataSource`~~ \n\n```typescript\npublic addElasticsearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): ElasticsearchDataSource\n```\n\nAdd a new elasticsearch data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `domain`Required \n\n- *Type:* aws-cdk-lib.aws_elasticsearch.IDomain\n\nThe elasticsearch domain for this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addEventBridgeDataSource` \n\n```typescript\npublic addEventBridgeDataSource(id: string, eventBus: IEventBus, options?: DataSourceOptions): EventBridgeDataSource\n```\n\nAdd an EventBridge data source to this api.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `eventBus`Required \n\n- *Type:* aws-cdk-lib.aws_events.IEventBus\n\nThe EventBridge EventBus on which to put events.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addFunction` \n\n```typescript\npublic addFunction(id: string, props: AddFunctionProps): AppsyncFunction\n```\n\nAdd an appsync function to the api.\n\n###### `id`Required \n\n- *Type:* string\n\nthe function's id.\n\n---\n\n###### `props`Required \n\n- *Type:* AddFunctionProps\n\n---\n\n##### `addHttpDataSource` \n\n```typescript\npublic addHttpDataSource(id: string, endpoint: string, options?: HttpDataSourceOptions): HttpDataSource\n```\n\nAdd a new http data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `endpoint`Required \n\n- *Type:* string\n\nThe http endpoint.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.HttpDataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addLambdaDataSource` \n\n```typescript\npublic addLambdaDataSource(id: string, lambdaFunction: IFunction, options?: DataSourceOptions): LambdaDataSource\n```\n\nAdd a new Lambda data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `lambdaFunction`Required \n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe Lambda function to call to interact with this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addNoneDataSource` \n\n```typescript\npublic addNoneDataSource(id: string, options?: DataSourceOptions): NoneDataSource\n```\n\nAdd a new dummy data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\nUseful for pipeline resolvers and for backend changes that don't require a data source.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addOpenSearchDataSource` \n\n```typescript\npublic addOpenSearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): OpenSearchDataSource\n```\n\ndd a new OpenSearch data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `domain`Required \n\n- *Type:* aws-cdk-lib.aws_opensearchservice.IDomain\n\nThe OpenSearch domain for this data source.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addRdsDataSource` \n\n```typescript\npublic addRdsDataSource(id: string, serverlessCluster: IServerlessCluster, secretStore: ISecret, databaseName?: string, options?: DataSourceOptions): RdsDataSource\n```\n\nAdd a new Rds data source to this API.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe data source's id.\n\n---\n\n###### `serverlessCluster`Required \n\n- *Type:* aws-cdk-lib.aws_rds.IServerlessCluster\n\nThe serverless cluster to interact with this data source.\n\n---\n\n###### `secretStore`Required \n\n- *Type:* aws-cdk-lib.aws_secretsmanager.ISecret\n\nThe secret store that contains the username and password for the serverless cluster.\n\n---\n\n###### `databaseName`Optional \n\n- *Type:* string\n\nThe optional name of the database to use within the cluster.\n\n---\n\n###### `options`Optional \n\n- *Type:* aws-cdk-lib.aws_appsync.DataSourceOptions\n\nThe optional configuration for this data source.\n\n---\n\n##### `addResolver` \n\n```typescript\npublic addResolver(id: string, props: ExtendedResolverProps): Resolver\n```\n\nAdd a resolver to the api.\n\nThis is a proxy method to the L2 GraphqlApi Construct.\n\n###### `id`Required \n\n- *Type:* string\n\nThe resolver's id.\n\n---\n\n###### `props`Required \n\n- *Type:* aws-cdk-lib.aws_appsync.ExtendedResolverProps\n\nthe resolver properties.\n\n---\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| isConstruct | Checks if `x` is a construct. |\n\n---\n\n##### ~~`isConstruct`~~ \n\n```typescript\nimport { AmplifyGraphqlApi } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlApi.isConstruct(x: any)\n```\n\nChecks if `x` is a construct.\n\n###### `x`Required \n\n- *Type:* any\n\nAny object.\n\n---\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| node | constructs.Node | The tree node. |\n| apiId | string | Generated Api Id. |\n| generatedFunctionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Resolvers generated by the transform process, persisted on the side in order to facilitate pulling a manifest for the purposes of inspecting and producing overrides. |\n| graphqlUrl | string | Graphql URL For the generated API. |\n| realtimeUrl | string | Realtime URL For the generated API. |\n| resources | AmplifyGraphqlApiResources | Generated L1 and L2 CDK resources. |\n| apiKey | string | Generated Api Key if generated. |\n\n---\n\n##### `node`Required \n\n```typescript\npublic readonly node: Node;\n```\n\n- *Type:* constructs.Node\n\nThe tree node.\n\n---\n\n##### `apiId`Required \n\n```typescript\npublic readonly apiId: string;\n```\n\n- *Type:* string\n\nGenerated Api Id.\n\nMay be a CDK Token.\n\n---\n\n##### `generatedFunctionSlots`Required \n\n```typescript\npublic readonly generatedFunctionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nResolvers generated by the transform process, persisted on the side in order to facilitate pulling a manifest for the purposes of inspecting and producing overrides.\n\n---\n\n##### `graphqlUrl`Required \n\n```typescript\npublic readonly graphqlUrl: string;\n```\n\n- *Type:* string\n\nGraphql URL For the generated API.\n\nMay be a CDK Token.\n\n---\n\n##### `realtimeUrl`Required \n\n```typescript\npublic readonly realtimeUrl: string;\n```\n\n- *Type:* string\n\nRealtime URL For the generated API.\n\nMay be a CDK Token.\n\n---\n\n##### `resources`Required \n\n```typescript\npublic readonly resources: AmplifyGraphqlApiResources;\n```\n\n- *Type:* AmplifyGraphqlApiResources\n\nGenerated L1 and L2 CDK resources.\n\n---\n\n##### `apiKey`Optional \n\n```typescript\npublic readonly apiKey: string;\n```\n\n- *Type:* string\n\nGenerated Api Key if generated.\n\nMay be a CDK Token.\n\n---\n\n\n## Structs \n\n### AddFunctionProps \n\nInput type properties when adding a new appsync.AppsyncFunction to the generated API. This is equivalent to the Omit.\n\n#### Initializer \n\n```typescript\nimport { AddFunctionProps } from '@aws-amplify/graphql-api-construct'\n\nconst addFunctionProps: AddFunctionProps = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dataSource | aws-cdk-lib.aws_appsync.BaseDataSource | the data source linked to this AppSync Function. |\n| name | string | the name of the AppSync Function. |\n| code | aws-cdk-lib.aws_appsync.Code | The function code. |\n| description | string | the description for this AppSync Function. |\n| requestMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | the request mapping template for the AppSync Function. |\n| responseMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | the response mapping template for the AppSync Function. |\n| runtime | aws-cdk-lib.aws_appsync.FunctionRuntime | The functions runtime. |\n\n---\n\n##### `dataSource`Required \n\n```typescript\npublic readonly dataSource: BaseDataSource;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.BaseDataSource\n\nthe data source linked to this AppSync Function.\n\n---\n\n##### `name`Required \n\n```typescript\npublic readonly name: string;\n```\n\n- *Type:* string\n\nthe name of the AppSync Function.\n\n---\n\n##### `code`Optional \n\n```typescript\npublic readonly code: Code;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.Code\n- *Default:* no code is used\n\nThe function code.\n\n---\n\n##### `description`Optional \n\n```typescript\npublic readonly description: string;\n```\n\n- *Type:* string\n- *Default:* no description\n\nthe description for this AppSync Function.\n\n---\n\n##### `requestMappingTemplate`Optional \n\n```typescript\npublic readonly requestMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n- *Default:* no request mapping template\n\nthe request mapping template for the AppSync Function.\n\n---\n\n##### `responseMappingTemplate`Optional \n\n```typescript\npublic readonly responseMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n- *Default:* no response mapping template\n\nthe response mapping template for the AppSync Function.\n\n---\n\n##### `runtime`Optional \n\n```typescript\npublic readonly runtime: FunctionRuntime;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.FunctionRuntime\n- *Default:* no function runtime, VTL mapping templates used\n\nThe functions runtime.\n\n---\n\n### AmplifyDynamoDbModelDataSourceStrategy \n\nUse custom resource type 'Custom::AmplifyDynamoDBTable' to provision table.\n\n#### Initializer \n\n```typescript\nimport { AmplifyDynamoDbModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyDynamoDbModelDataSourceStrategy: AmplifyDynamoDbModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbType | string | *No description.* |\n| provisionStrategy | string | *No description.* |\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\n---\n\n##### `provisionStrategy`Required \n\n```typescript\npublic readonly provisionStrategy: string;\n```\n\n- *Type:* string\n\n---\n\n### AmplifyGraphqlApiCfnResources \n\nL1 CDK resources from the Api which were generated as part of the transform.\n\nThese are potentially stored under nested stacks, but presented organized by type instead.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiCfnResources } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiCfnResources: AmplifyGraphqlApiCfnResources = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| additionalCfnResources | {[ key: string ]: aws-cdk-lib.CfnResource} | Remaining L1 resources generated, keyed by logicalId. |\n| amplifyDynamoDbTables | {[ key: string ]: AmplifyDynamoDbTableWrapper} | The Generated Amplify DynamoDb Table L1 resource wrapper, keyed by model type name. |\n| cfnDataSources | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnDataSource} | The Generated AppSync DataSource L1 Resources, keyed by logicalId. |\n| cfnFunctionConfigurations | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnFunctionConfiguration} | The Generated AppSync Function L1 Resources, keyed by logicalId. |\n| cfnFunctions | {[ key: string ]: aws-cdk-lib.aws_lambda.CfnFunction} | The Generated Lambda Function L1 Resources, keyed by function name. |\n| cfnGraphqlApi | aws-cdk-lib.aws_appsync.CfnGraphQLApi | The Generated AppSync Api L1 Resource. |\n| cfnGraphqlSchema | aws-cdk-lib.aws_appsync.CfnGraphQLSchema | The Generated AppSync Schema L1 Resource. |\n| cfnResolvers | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnResolver} | The Generated AppSync Resolver L1 Resources, keyed by logicalId. |\n| cfnRoles | {[ key: string ]: aws-cdk-lib.aws_iam.CfnRole} | The Generated IAM Role L1 Resources, keyed by logicalId. |\n| cfnTables | {[ key: string ]: aws-cdk-lib.aws_dynamodb.CfnTable} | The Generated DynamoDB Table L1 Resources, keyed by logicalId. |\n| cfnApiKey | aws-cdk-lib.aws_appsync.CfnApiKey | The Generated AppSync Api Key L1 Resource. |\n\n---\n\n##### `additionalCfnResources`Required \n\n```typescript\npublic readonly additionalCfnResources: {[ key: string ]: CfnResource};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.CfnResource}\n\nRemaining L1 resources generated, keyed by logicalId.\n\n---\n\n##### `amplifyDynamoDbTables`Required \n\n```typescript\npublic readonly amplifyDynamoDbTables: {[ key: string ]: AmplifyDynamoDbTableWrapper};\n```\n\n- *Type:* {[ key: string ]: AmplifyDynamoDbTableWrapper}\n\nThe Generated Amplify DynamoDb Table L1 resource wrapper, keyed by model type name.\n\n---\n\n##### `cfnDataSources`Required \n\n```typescript\npublic readonly cfnDataSources: {[ key: string ]: CfnDataSource};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnDataSource}\n\nThe Generated AppSync DataSource L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnFunctionConfigurations`Required \n\n```typescript\npublic readonly cfnFunctionConfigurations: {[ key: string ]: CfnFunctionConfiguration};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnFunctionConfiguration}\n\nThe Generated AppSync Function L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnFunctions`Required \n\n```typescript\npublic readonly cfnFunctions: {[ key: string ]: CfnFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.CfnFunction}\n\nThe Generated Lambda Function L1 Resources, keyed by function name.\n\n---\n\n##### `cfnGraphqlApi`Required \n\n```typescript\npublic readonly cfnGraphqlApi: CfnGraphQLApi;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnGraphQLApi\n\nThe Generated AppSync Api L1 Resource.\n\n---\n\n##### `cfnGraphqlSchema`Required \n\n```typescript\npublic readonly cfnGraphqlSchema: CfnGraphQLSchema;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnGraphQLSchema\n\nThe Generated AppSync Schema L1 Resource.\n\n---\n\n##### `cfnResolvers`Required \n\n```typescript\npublic readonly cfnResolvers: {[ key: string ]: CfnResolver};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_appsync.CfnResolver}\n\nThe Generated AppSync Resolver L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnRoles`Required \n\n```typescript\npublic readonly cfnRoles: {[ key: string ]: CfnRole};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.CfnRole}\n\nThe Generated IAM Role L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnTables`Required \n\n```typescript\npublic readonly cfnTables: {[ key: string ]: CfnTable};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_dynamodb.CfnTable}\n\nThe Generated DynamoDB Table L1 Resources, keyed by logicalId.\n\n---\n\n##### `cfnApiKey`Optional \n\n```typescript\npublic readonly cfnApiKey: CfnApiKey;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.CfnApiKey\n\nThe Generated AppSync Api Key L1 Resource.\n\n---\n\n### AmplifyGraphqlApiProps \n\nInput props for the AmplifyGraphqlApi construct.\n\nSpecifies what the input to transform into an Api, and configurations for\nthe transformation process.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiProps } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiProps: AmplifyGraphqlApiProps = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| authorizationModes | AuthorizationModes | Required auth modes for the Api. |\n| definition | IAmplifyGraphqlDefinition | The definition to transform in a full Api. |\n| apiName | string | Name to be used for the AppSync Api. |\n| conflictResolution | ConflictResolution | Configure conflict resolution on the Api, which is required to enable DataStore Api functionality. |\n| dataStoreConfiguration | DataStoreConfiguration | Configure DataStore conflict resolution on the Api. |\n| disableOutputStorage | boolean | Disables storing construct output. |\n| functionNameMap | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | Lambda functions referenced in the definitions's. |\n| functionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Overrides for a given slot in the generated resolver pipelines. |\n| outputStorageStrategy | IBackendOutputStorageStrategy | Strategy to store construct outputs. |\n| predictionsBucket | aws-cdk-lib.aws_s3.IBucket | If using predictions, a bucket must be provided which will be used to search for assets. |\n| stackMappings | {[ key: string ]: string} | StackMappings override the assigned nested stack on a per-resource basis. |\n| transformerPlugins | any[] | Provide a list of additional custom transformers which are injected into the transform process. |\n| translationBehavior | PartialTranslationBehavior | This replaces feature flags from the Api construct, for general information on what these parameters do, refer to https://docs.amplify.aws/cli/reference/feature-flags/#graphQLTransformer. |\n\n---\n\n##### `authorizationModes`Required \n\n```typescript\npublic readonly authorizationModes: AuthorizationModes;\n```\n\n- *Type:* AuthorizationModes\n\nRequired auth modes for the Api.\n\nThis object must be a superset of the configured auth providers in the Api definition.\nFor more information, refer to https://docs.amplify.aws/cli/graphql/authorization-rules/\n\n---\n\n##### `definition`Required \n\n```typescript\npublic readonly definition: IAmplifyGraphqlDefinition;\n```\n\n- *Type:* IAmplifyGraphqlDefinition\n\nThe definition to transform in a full Api.\n\nCan be constructed via the AmplifyGraphqlDefinition class.\n\n---\n\n##### `apiName`Optional \n\n```typescript\npublic readonly apiName: string;\n```\n\n- *Type:* string\n\nName to be used for the AppSync Api.\n\nDefault: construct id.\n\n---\n\n##### ~~`conflictResolution`~~Optional \n\n- *Deprecated:* use dataStoreConfiguration instead.\n\n```typescript\npublic readonly conflictResolution: ConflictResolution;\n```\n\n- *Type:* ConflictResolution\n\nConfigure conflict resolution on the Api, which is required to enable DataStore Api functionality.\n\nFor more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/\n\n---\n\n##### `dataStoreConfiguration`Optional \n\n```typescript\npublic readonly dataStoreConfiguration: DataStoreConfiguration;\n```\n\n- *Type:* DataStoreConfiguration\n\nConfigure DataStore conflict resolution on the Api.\n\nConflict resolution is required to enable DataStore Api functionality.\nFor more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/\n\n---\n\n##### `disableOutputStorage`Optional \n\n```typescript\npublic readonly disableOutputStorage: boolean;\n```\n\n- *Type:* boolean\n\nDisables storing construct output.\n\nOutput storage should be disabled when creating multiple GraphQL APIs in a single CDK synthesis.\noutputStorageStrategy will be ignored if this is set to true.\n\n---\n\n##### `functionNameMap`Optional \n\n```typescript\npublic readonly functionNameMap: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nLambda functions referenced in the definitions's.\n\n---\n\n##### `functionSlots`Optional \n\n```typescript\npublic readonly functionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nOverrides for a given slot in the generated resolver pipelines.\n\nFor more information about what slots are available,\nrefer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#override-amplify-generated-resolvers.\n\n---\n\n##### `outputStorageStrategy`Optional \n\n```typescript\npublic readonly outputStorageStrategy: IBackendOutputStorageStrategy;\n```\n\n- *Type:* IBackendOutputStorageStrategy\n\nStrategy to store construct outputs.\n\nIf no outputStorageStrategey is provided a default strategy will be used.\n\n---\n\n##### `predictionsBucket`Optional \n\n```typescript\npublic readonly predictionsBucket: IBucket;\n```\n\n- *Type:* aws-cdk-lib.aws_s3.IBucket\n\nIf using predictions, a bucket must be provided which will be used to search for assets.\n\n---\n\n##### `stackMappings`Optional \n\n```typescript\npublic readonly stackMappings: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nStackMappings override the assigned nested stack on a per-resource basis.\n\nOnly applies to resolvers, and takes the form\n{ : }\nIt is not recommended to use this parameter unless you are encountering stack resource count limits, and worth noting that\nafter initial deployment AppSync resolvers cannot be moved between nested stacks, they will need to be removed from the app,\nthen re-added from a new stack.\n\n---\n\n##### `transformerPlugins`Optional \n\n```typescript\npublic readonly transformerPlugins: any[];\n```\n\n- *Type:* any[]\n\nProvide a list of additional custom transformers which are injected into the transform process.\n\nThese custom transformers must be implemented with aws-cdk-lib >=2.80.0, and\n\n---\n\n##### `translationBehavior`Optional \n\n```typescript\npublic readonly translationBehavior: PartialTranslationBehavior;\n```\n\n- *Type:* PartialTranslationBehavior\n\nThis replaces feature flags from the Api construct, for general information on what these parameters do, refer to https://docs.amplify.aws/cli/reference/feature-flags/#graphQLTransformer.\n\n---\n\n### AmplifyGraphqlApiResources \n\nAccessible resources from the Api which were generated as part of the transform.\n\nThese are potentially stored under nested stacks, but presented organized by type instead.\n\n#### Initializer \n\n```typescript\nimport { AmplifyGraphqlApiResources } from '@aws-amplify/graphql-api-construct'\n\nconst amplifyGraphqlApiResources: AmplifyGraphqlApiResources = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| cfnResources | AmplifyGraphqlApiCfnResources | L1 Cfn Resources, for when dipping down a level of abstraction is desirable. |\n| functions | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | The Generated Lambda Function L1 Resources, keyed by function name. |\n| graphqlApi | aws-cdk-lib.aws_appsync.IGraphqlApi | The Generated AppSync Api L2 Resource, includes the Schema. |\n| nestedStacks | {[ key: string ]: aws-cdk-lib.NestedStack} | Nested Stacks generated by the Api Construct. |\n| roles | {[ key: string ]: aws-cdk-lib.aws_iam.IRole} | The Generated IAM Role L2 Resources, keyed by logicalId. |\n| tables | {[ key: string ]: aws-cdk-lib.aws_dynamodb.ITable} | The Generated DynamoDB Table L2 Resources, keyed by logicalId. |\n\n---\n\n##### `cfnResources`Required \n\n```typescript\npublic readonly cfnResources: AmplifyGraphqlApiCfnResources;\n```\n\n- *Type:* AmplifyGraphqlApiCfnResources\n\nL1 Cfn Resources, for when dipping down a level of abstraction is desirable.\n\n---\n\n##### `functions`Required \n\n```typescript\npublic readonly functions: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nThe Generated Lambda Function L1 Resources, keyed by function name.\n\n---\n\n##### `graphqlApi`Required \n\n```typescript\npublic readonly graphqlApi: IGraphqlApi;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.IGraphqlApi\n\nThe Generated AppSync Api L2 Resource, includes the Schema.\n\n---\n\n##### `nestedStacks`Required \n\n```typescript\npublic readonly nestedStacks: {[ key: string ]: NestedStack};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.NestedStack}\n\nNested Stacks generated by the Api Construct.\n\n---\n\n##### `roles`Required \n\n```typescript\npublic readonly roles: {[ key: string ]: IRole};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_iam.IRole}\n\nThe Generated IAM Role L2 Resources, keyed by logicalId.\n\n---\n\n##### `tables`Required \n\n```typescript\npublic readonly tables: {[ key: string ]: ITable};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_dynamodb.ITable}\n\nThe Generated DynamoDB Table L2 Resources, keyed by logicalId.\n\n---\n\n### ApiKeyAuthorizationConfig \n\nConfiguration for Api Keys on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { ApiKeyAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst apiKeyAuthorizationConfig: ApiKeyAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| expires | aws-cdk-lib.Duration | A duration representing the time from Cloudformation deploy until expiry. |\n| description | string | Optional description for the Api Key to attach to the Api. |\n\n---\n\n##### `expires`Required \n\n```typescript\npublic readonly expires: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nA duration representing the time from Cloudformation deploy until expiry.\n\n---\n\n##### `description`Optional \n\n```typescript\npublic readonly description: string;\n```\n\n- *Type:* string\n\nOptional description for the Api Key to attach to the Api.\n\n---\n\n### AuthorizationModes \n\nAuthorization Modes to apply to the Api.\n\nAt least one modes must be provided, and if more than one are provided a defaultAuthorizationMode must be specified.\nFor more information on Amplify Api auth, refer to https://docs.amplify.aws/cli/graphql/authorization-rules/#authorization-strategies\n\n#### Initializer \n\n```typescript\nimport { AuthorizationModes } from '@aws-amplify/graphql-api-construct'\n\nconst authorizationModes: AuthorizationModes = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| adminRoles | aws-cdk-lib.aws_iam.IRole[] | A list of roles granted full R/W access to the Api. |\n| apiKeyConfig | ApiKeyAuthorizationConfig | AppSync Api Key config, required if a 'apiKey' auth provider is specified in the Api. |\n| defaultAuthorizationMode | string | Default auth mode to provide to the Api, required if more than one config type is specified. |\n| iamConfig | IAMAuthorizationConfig | IAM Auth config, required if an 'iam' auth provider is specified in the Api. |\n| lambdaConfig | LambdaAuthorizationConfig | Lambda config, required if a 'function' auth provider is specified in the Api. |\n| oidcConfig | OIDCAuthorizationConfig | Cognito OIDC config, required if a 'oidc' auth provider is specified in the Api. |\n| userPoolConfig | UserPoolAuthorizationConfig | Cognito UserPool config, required if a 'userPools' auth provider is specified in the Api. |\n\n---\n\n##### ~~`adminRoles`~~Optional \n\n- *Deprecated:* , use iamConfig.allowListedRoles instead.\n\n```typescript\npublic readonly adminRoles: IRole[];\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole[]\n\nA list of roles granted full R/W access to the Api.\n\n---\n\n##### `apiKeyConfig`Optional \n\n```typescript\npublic readonly apiKeyConfig: ApiKeyAuthorizationConfig;\n```\n\n- *Type:* ApiKeyAuthorizationConfig\n\nAppSync Api Key config, required if a 'apiKey' auth provider is specified in the Api.\n\nApplies to 'public' auth strategy.\n\n---\n\n##### `defaultAuthorizationMode`Optional \n\n```typescript\npublic readonly defaultAuthorizationMode: string;\n```\n\n- *Type:* string\n\nDefault auth mode to provide to the Api, required if more than one config type is specified.\n\n---\n\n##### `iamConfig`Optional \n\n```typescript\npublic readonly iamConfig: IAMAuthorizationConfig;\n```\n\n- *Type:* IAMAuthorizationConfig\n\nIAM Auth config, required if an 'iam' auth provider is specified in the Api.\n\nApplies to 'public' and 'private' auth strategies.\n\n---\n\n##### `lambdaConfig`Optional \n\n```typescript\npublic readonly lambdaConfig: LambdaAuthorizationConfig;\n```\n\n- *Type:* LambdaAuthorizationConfig\n\nLambda config, required if a 'function' auth provider is specified in the Api.\n\nApplies to 'custom' auth strategy.\n\n---\n\n##### `oidcConfig`Optional \n\n```typescript\npublic readonly oidcConfig: OIDCAuthorizationConfig;\n```\n\n- *Type:* OIDCAuthorizationConfig\n\nCognito OIDC config, required if a 'oidc' auth provider is specified in the Api.\n\nApplies to 'owner', 'private', and 'group' auth strategies.\n\n---\n\n##### `userPoolConfig`Optional \n\n```typescript\npublic readonly userPoolConfig: UserPoolAuthorizationConfig;\n```\n\n- *Type:* UserPoolAuthorizationConfig\n\nCognito UserPool config, required if a 'userPools' auth provider is specified in the Api.\n\nApplies to 'owner', 'private', and 'group' auth strategies.\n\n---\n\n### AutomergeConflictResolutionStrategy \n\nEnable optimistic concurrency on the project.\n\n#### Initializer \n\n```typescript\nimport { AutomergeConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst automergeConflictResolutionStrategy: AutomergeConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| handlerType | string | This conflict resolution strategy executes an auto-merge. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy executes an auto-merge.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### ConflictResolution \n\nProject level configuration for conflict resolution.\n\n#### Initializer \n\n```typescript\nimport { ConflictResolution } from '@aws-amplify/graphql-api-construct'\n\nconst conflictResolution: ConflictResolution = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| models | {[ key: string ]: AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy} | Model-specific conflict resolution overrides. |\n| project | AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy | Project-wide config for conflict resolution. |\n\n---\n\n##### ~~`models`~~Optional \n\n- *Deprecated:* use DataStoreConfiguration instead.\n\n```typescript\npublic readonly models: {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy};\n```\n\n- *Type:* {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy}\n\nModel-specific conflict resolution overrides.\n\n---\n\n##### ~~`project`~~Optional \n\n- *Deprecated:* use DataStoreConfiguration instead.\n\n```typescript\npublic readonly project: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy;\n```\n\n- *Type:* AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy\n\nProject-wide config for conflict resolution.\n\nApplies to all non-overridden models.\n\n---\n\n### ConflictResolutionStrategyBase \n\nCommon parameters for conflict resolution.\n\n#### Initializer \n\n```typescript\nimport { ConflictResolutionStrategyBase } from '@aws-amplify/graphql-api-construct'\n\nconst conflictResolutionStrategyBase: ConflictResolutionStrategyBase = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n### CustomConflictResolutionStrategy \n\nEnable custom sync on the project, powered by a lambda.\n\n#### Initializer \n\n```typescript\nimport { CustomConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst customConflictResolutionStrategy: CustomConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| conflictHandler | aws-cdk-lib.aws_lambda.IFunction | The function which will be invoked for conflict resolution. |\n| handlerType | string | This conflict resolution strategy uses a lambda handler type. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `conflictHandler`Required \n\n```typescript\npublic readonly conflictHandler: IFunction;\n```\n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe function which will be invoked for conflict resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy uses a lambda handler type.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### CustomSqlDataSourceStrategy \n\nThe input type for defining a ModelDataSourceStrategy used to resolve a field annotated with a `@sql` directive.\n\nAlthough this is a\npublic type, you should rarely need to use this. The AmplifyGraphqlDefinition factory methods (e.g., `fromString`,\n`fromFilesAndStrategy`) will automatically construct this structure for you.\n\n#### Initializer \n\n```typescript\nimport { CustomSqlDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst customSqlDataSourceStrategy: CustomSqlDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field name with which the custom SQL is associated. |\n| strategy | SQLLambdaModelDataSourceStrategy | The strategy used to create the datasource that will resolve the custom SQL statement. |\n| typeName | string | The built-in type (either \"Query\" or \"Mutation\") with which the custom SQL is associated. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field name with which the custom SQL is associated.\n\n---\n\n##### `strategy`Required \n\n```typescript\npublic readonly strategy: SQLLambdaModelDataSourceStrategy;\n```\n\n- *Type:* SQLLambdaModelDataSourceStrategy\n\nThe strategy used to create the datasource that will resolve the custom SQL statement.\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThe built-in type (either \"Query\" or \"Mutation\") with which the custom SQL is associated.\n\n---\n\n### DataStoreConfiguration \n\nProject level configuration for DataStore.\n\n#### Initializer \n\n```typescript\nimport { DataStoreConfiguration } from '@aws-amplify/graphql-api-construct'\n\nconst dataStoreConfiguration: DataStoreConfiguration = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| models | {[ key: string ]: AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy} | Model-specific conflict resolution overrides. |\n| project | AutomergeConflictResolutionStrategy \\| OptimisticConflictResolutionStrategy \\| CustomConflictResolutionStrategy | Project-wide config for conflict resolution. |\n\n---\n\n##### `models`Optional \n\n```typescript\npublic readonly models: {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy};\n```\n\n- *Type:* {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy}\n\nModel-specific conflict resolution overrides.\n\n---\n\n##### `project`Optional \n\n```typescript\npublic readonly project: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy;\n```\n\n- *Type:* AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy\n\nProject-wide config for conflict resolution.\n\nApplies to all non-overridden models.\n\n---\n\n### DefaultDynamoDbModelDataSourceStrategy \n\nUse default CloudFormation type 'AWS::DynamoDB::Table' to provision table.\n\n#### Initializer \n\n```typescript\nimport { DefaultDynamoDbModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst defaultDynamoDbModelDataSourceStrategy: DefaultDynamoDbModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbType | string | *No description.* |\n| provisionStrategy | string | *No description.* |\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\n---\n\n##### `provisionStrategy`Required \n\n```typescript\npublic readonly provisionStrategy: string;\n```\n\n- *Type:* string\n\n---\n\n### FunctionSlotBase \n\nCommon slot parameters.\n\n#### Initializer \n\n```typescript\nimport { FunctionSlotBase } from '@aws-amplify/graphql-api-construct'\n\nconst functionSlotBase: FunctionSlotBase = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n### FunctionSlotOverride \n\nParams exposed to support configuring and overriding pipelined slots.\n\nThis allows configuration of the underlying function,\nincluding the request and response mapping templates.\n\n#### Initializer \n\n```typescript\nimport { FunctionSlotOverride } from '@aws-amplify/graphql-api-construct'\n\nconst functionSlotOverride: FunctionSlotOverride = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| requestMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | Override request mapping template for the function slot. |\n| responseMappingTemplate | aws-cdk-lib.aws_appsync.MappingTemplate | Override response mapping template for the function slot. |\n\n---\n\n##### `requestMappingTemplate`Optional \n\n```typescript\npublic readonly requestMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n\nOverride request mapping template for the function slot.\n\nExecuted before the datasource is invoked.\n\n---\n\n##### `responseMappingTemplate`Optional \n\n```typescript\npublic readonly responseMappingTemplate: MappingTemplate;\n```\n\n- *Type:* aws-cdk-lib.aws_appsync.MappingTemplate\n\nOverride response mapping template for the function slot.\n\nExecuted after the datasource is invoked.\n\n---\n\n### IAMAuthorizationConfig \n\nConfiguration for IAM Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { IAMAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst iAMAuthorizationConfig: IAMAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| authenticatedUserRole | aws-cdk-lib.aws_iam.IRole | Authenticated user role, applies to { provider: iam, allow: private } access. |\n| identityPoolId | string | ID for the Cognito Identity Pool vending auth and unauth roles. |\n| unauthenticatedUserRole | aws-cdk-lib.aws_iam.IRole | Unauthenticated user role, applies to { provider: iam, allow: public } access. |\n| allowListedRoles | string \\| aws-cdk-lib.aws_iam.IRole[] | A list of IAM roles which will be granted full read/write access to the generated model if IAM auth is enabled. |\n\n---\n\n##### `authenticatedUserRole`Required \n\n```typescript\npublic readonly authenticatedUserRole: IRole;\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole\n\nAuthenticated user role, applies to { provider: iam, allow: private } access.\n\n---\n\n##### `identityPoolId`Required \n\n```typescript\npublic readonly identityPoolId: string;\n```\n\n- *Type:* string\n\nID for the Cognito Identity Pool vending auth and unauth roles.\n\nFormat: `:`\n\n---\n\n##### `unauthenticatedUserRole`Required \n\n```typescript\npublic readonly unauthenticatedUserRole: IRole;\n```\n\n- *Type:* aws-cdk-lib.aws_iam.IRole\n\nUnauthenticated user role, applies to { provider: iam, allow: public } access.\n\n---\n\n##### `allowListedRoles`Optional \n\n```typescript\npublic readonly allowListedRoles: string | IRole[];\n```\n\n- *Type:* string | aws-cdk-lib.aws_iam.IRole[]\n\nA list of IAM roles which will be granted full read/write access to the generated model if IAM auth is enabled.\n\nIf an IRole is provided, the role `name` will be used for matching.\nIf a string is provided, the raw value will be used for matching.\n\n---\n\n### LambdaAuthorizationConfig \n\nConfiguration for Custom Lambda authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { LambdaAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst lambdaAuthorizationConfig: LambdaAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| function | aws-cdk-lib.aws_lambda.IFunction | The authorizer lambda function. |\n| ttl | aws-cdk-lib.Duration | How long the results are cached. |\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: IFunction;\n```\n\n- *Type:* aws-cdk-lib.aws_lambda.IFunction\n\nThe authorizer lambda function.\n\n---\n\n##### `ttl`Required \n\n```typescript\npublic readonly ttl: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nHow long the results are cached.\n\n---\n\n### MutationFunctionSlot \n\nSlot types for Mutation Resolvers.\n\n#### Initializer \n\n```typescript\nimport { MutationFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst mutationFunctionSlot: MutationFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Mutation type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Mutation type on the Api definition.\n\n---\n\n### OIDCAuthorizationConfig \n\nConfiguration for OpenId Connect Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { OIDCAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst oIDCAuthorizationConfig: OIDCAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| oidcIssuerUrl | string | Url for the OIDC token issuer. |\n| oidcProviderName | string | The issuer for the OIDC configuration. |\n| tokenExpiryFromAuth | aws-cdk-lib.Duration | The duration an OIDC token is valid after being authenticated by OIDC provider. |\n| tokenExpiryFromIssue | aws-cdk-lib.Duration | The duration an OIDC token is valid after being issued to a user. |\n| clientId | string | The client identifier of the Relying party at the OpenID identity provider. |\n\n---\n\n##### `oidcIssuerUrl`Required \n\n```typescript\npublic readonly oidcIssuerUrl: string;\n```\n\n- *Type:* string\n\nUrl for the OIDC token issuer.\n\n---\n\n##### `oidcProviderName`Required \n\n```typescript\npublic readonly oidcProviderName: string;\n```\n\n- *Type:* string\n\nThe issuer for the OIDC configuration.\n\n---\n\n##### `tokenExpiryFromAuth`Required \n\n```typescript\npublic readonly tokenExpiryFromAuth: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nThe duration an OIDC token is valid after being authenticated by OIDC provider.\n\nauth_time claim in OIDC token is required for this validation to work.\n\n---\n\n##### `tokenExpiryFromIssue`Required \n\n```typescript\npublic readonly tokenExpiryFromIssue: Duration;\n```\n\n- *Type:* aws-cdk-lib.Duration\n\nThe duration an OIDC token is valid after being issued to a user.\n\nThis validation uses iat claim of OIDC token.\n\n---\n\n##### `clientId`Optional \n\n```typescript\npublic readonly clientId: string;\n```\n\n- *Type:* string\n\nThe client identifier of the Relying party at the OpenID identity provider.\n\nA regular expression can be specified so AppSync can validate against multiple client identifiers at a time. Example\n\n---\n\n### OptimisticConflictResolutionStrategy \n\nEnable automerge on the project.\n\n#### Initializer \n\n```typescript\nimport { OptimisticConflictResolutionStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst optimisticConflictResolutionStrategy: OptimisticConflictResolutionStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| detectionType | string | The conflict detection type used for resolution. |\n| handlerType | string | This conflict resolution strategy the _version to perform optimistic concurrency. |\n\n---\n\n##### `detectionType`Required \n\n```typescript\npublic readonly detectionType: string;\n```\n\n- *Type:* string\n\nThe conflict detection type used for resolution.\n\n---\n\n##### `handlerType`Required \n\n```typescript\npublic readonly handlerType: string;\n```\n\n- *Type:* string\n\nThis conflict resolution strategy the _version to perform optimistic concurrency.\n\nFor more information, refer to https://docs.aws.amazon.com/appsync/latest/devguide/conflict-detection-and-sync.html#conflict-detection-and-resolution\n\n---\n\n### PartialTranslationBehavior \n\nA utility interface equivalent to Partial.\n\n#### Initializer \n\n```typescript\nimport { PartialTranslationBehavior } from '@aws-amplify/graphql-api-construct'\n\nconst partialTranslationBehavior: PartialTranslationBehavior = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| allowDestructiveGraphqlSchemaUpdates | boolean | The following schema updates require replacement of the underlying DynamoDB table:. |\n| disableResolverDeduping | boolean | Disable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered. |\n| enableAutoIndexQueryNames | boolean | Automate generation of query names, and as a result attaching all indexes as queries to the generated Api. |\n| enableSearchNodeToNodeEncryption | boolean | If enabled, set nodeToNodeEncryption on the searchable domain (if one exists). |\n| enableTransformerCfnOutputs | boolean | When enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted. |\n| populateOwnerFieldForStaticGroupAuth | boolean | Ensure that the owner field is still populated even if a static iam or group authorization applies. |\n| replaceTableUponGsiUpdate | boolean | This behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true. |\n| respectPrimaryKeyAttributesOnConnectionField | boolean | Enable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app. |\n| sandboxModeEnabled | boolean | Enabling sandbox mode will enable api key auth on all models in the transformed schema. |\n| secondaryKeyAsGSI | boolean | If disabled, generated. |\n| shouldDeepMergeDirectiveConfigDefaults | boolean | Restore parity w/ GQLv1. |\n| suppressApiKeyGeneration | boolean | If enabled, disable api key resource generation even if specified as an auth rule on the construct. |\n| useSubUsernameForDefaultIdentityClaim | boolean | Ensure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool. |\n\n---\n\n##### `allowDestructiveGraphqlSchemaUpdates`Optional \n\n```typescript\npublic readonly allowDestructiveGraphqlSchemaUpdates: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThe following schema updates require replacement of the underlying DynamoDB table:.\n\nRemoving or renaming a model\n - Modifying the primary key of a model\n - Modifying a Local Secondary Index of a model (only applies to projects with secondaryKeyAsGSI turned off)\n\nALL DATA WILL BE LOST when the table replacement happens. When enabled, destructive updates are allowed.\nThis will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `disableResolverDeduping`Optional \n\n```typescript\npublic readonly disableResolverDeduping: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nDisable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered.\n\n---\n\n##### `enableAutoIndexQueryNames`Optional \n\n```typescript\npublic readonly enableAutoIndexQueryNames: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nAutomate generation of query names, and as a result attaching all indexes as queries to the generated Api.\n\nIf enabled,\n\n---\n\n##### `enableSearchNodeToNodeEncryption`Optional \n\n```typescript\npublic readonly enableSearchNodeToNodeEncryption: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, set nodeToNodeEncryption on the searchable domain (if one exists).\n\nNot recommended for use, prefer\nto use `Object.values(resources.additionalResources['AWS::Elasticsearch::Domain']).forEach((domain: CfnDomain) => {\n domain.NodeToNodeEncryptionOptions = { Enabled: True };\n});\n\n---\n\n##### `enableTransformerCfnOutputs`Optional \n\n```typescript\npublic readonly enableTransformerCfnOutputs: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nWhen enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted.\n\n---\n\n##### `populateOwnerFieldForStaticGroupAuth`Optional \n\n```typescript\npublic readonly populateOwnerFieldForStaticGroupAuth: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that the owner field is still populated even if a static iam or group authorization applies.\n\n---\n\n##### `replaceTableUponGsiUpdate`Optional \n\n```typescript\npublic readonly replaceTableUponGsiUpdate: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThis behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true.\n\nWhen enabled, any global secondary index update operation will replace the table instead of iterative deployment, which will WIPE ALL\nEXISTING DATA but cost much less time for deployment This will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `respectPrimaryKeyAttributesOnConnectionField`Optional \n\n```typescript\npublic readonly respectPrimaryKeyAttributesOnConnectionField: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app.\n\n---\n\n##### `sandboxModeEnabled`Optional \n\n```typescript\npublic readonly sandboxModeEnabled: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nEnabling sandbox mode will enable api key auth on all models in the transformed schema.\n\n---\n\n##### `secondaryKeyAsGSI`Optional \n\n```typescript\npublic readonly secondaryKeyAsGSI: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nIf disabled, generated.\n\n---\n\n##### `shouldDeepMergeDirectiveConfigDefaults`Optional \n\n```typescript\npublic readonly shouldDeepMergeDirectiveConfigDefaults: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nRestore parity w/ GQLv1.\n\n---\n\n##### `suppressApiKeyGeneration`Optional \n\n```typescript\npublic readonly suppressApiKeyGeneration: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, disable api key resource generation even if specified as an auth rule on the construct.\n\nThis is a legacy parameter from the Graphql Transformer existing in Amplify CLI, not recommended to change.\n\n---\n\n##### `useSubUsernameForDefaultIdentityClaim`Optional \n\n```typescript\npublic readonly useSubUsernameForDefaultIdentityClaim: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool.\n\n---\n\n### ProvisionedConcurrencyConfig \n\nThe configuration for the provisioned concurrency of the Lambda.\n\n#### Initializer \n\n```typescript\nimport { ProvisionedConcurrencyConfig } from '@aws-amplify/graphql-api-construct'\n\nconst provisionedConcurrencyConfig: ProvisionedConcurrencyConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| provisionedConcurrentExecutions | number | The amount of provisioned concurrency to allocate. |\n\n---\n\n##### `provisionedConcurrentExecutions`Required \n\n```typescript\npublic readonly provisionedConcurrentExecutions: number;\n```\n\n- *Type:* number\n\nThe amount of provisioned concurrency to allocate.\n\n*\n\n---\n\n### ProvisionedThroughput \n\nWrapper for provisioned throughput config in DDB.\n\n#### Initializer \n\n```typescript\nimport { ProvisionedThroughput } from '@aws-amplify/graphql-api-construct'\n\nconst provisionedThroughput: ProvisionedThroughput = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| readCapacityUnits | number | The read capacity units on the table or index. |\n| writeCapacityUnits | number | The write capacity units on the table or index. |\n\n---\n\n##### `readCapacityUnits`Required \n\n```typescript\npublic readonly readCapacityUnits: number;\n```\n\n- *Type:* number\n\nThe read capacity units on the table or index.\n\n---\n\n##### `writeCapacityUnits`Required \n\n```typescript\npublic readonly writeCapacityUnits: number;\n```\n\n- *Type:* number\n\nThe write capacity units on the table or index.\n\n---\n\n### QueryFunctionSlot \n\nSlot types for Query Resolvers.\n\n#### Initializer \n\n```typescript\nimport { QueryFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst queryFunctionSlot: QueryFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Query type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Query type on the Api definition.\n\n---\n\n### SQLLambdaModelDataSourceStrategy \n\nA strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.\n\n#### Initializer \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategy } from '@aws-amplify/graphql-api-construct'\n\nconst sQLLambdaModelDataSourceStrategy: SQLLambdaModelDataSourceStrategy = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dbConnectionConfig | SqlModelDataSourceSecretsManagerDbConnectionConfig \\| SqlModelDataSourceSsmDbConnectionConfig | The parameters the Lambda data source will use to connect to the database. |\n| dbType | string | The type of the SQL database used to process model operations for this definition. |\n| name | string | The name of the strategy. |\n| customSqlStatements | {[ key: string ]: string} | Custom SQL statements. |\n| sqlLambdaProvisionedConcurrencyConfig | ProvisionedConcurrencyConfig | The configuration for the provisioned concurrency of the Lambda. |\n| vpcConfiguration | VpcConfig | The configuration of the VPC into which to install the Lambda. |\n\n---\n\n##### `dbConnectionConfig`Required \n\n```typescript\npublic readonly dbConnectionConfig: SqlModelDataSourceSecretsManagerDbConnectionConfig | SqlModelDataSourceSsmDbConnectionConfig;\n```\n\n- *Type:* SqlModelDataSourceSecretsManagerDbConnectionConfig | SqlModelDataSourceSsmDbConnectionConfig\n\nThe parameters the Lambda data source will use to connect to the database.\n\n---\n\n##### `dbType`Required \n\n```typescript\npublic readonly dbType: string;\n```\n\n- *Type:* string\n\nThe type of the SQL database used to process model operations for this definition.\n\n---\n\n##### `name`Required \n\n```typescript\npublic readonly name: string;\n```\n\n- *Type:* string\n\nThe name of the strategy.\n\nThis will be used to name the AppSync DataSource itself, plus any associated resources like resolver Lambdas.\nThis name must be unique across all schema definitions in a GraphQL API.\n\n---\n\n##### `customSqlStatements`Optional \n\n```typescript\npublic readonly customSqlStatements: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nCustom SQL statements.\n\nThe key is the value of the `references` attribute of the `@sql` directive in the `schema`; the value is the SQL\nto be executed.\n\n---\n\n##### `sqlLambdaProvisionedConcurrencyConfig`Optional \n\n```typescript\npublic readonly sqlLambdaProvisionedConcurrencyConfig: ProvisionedConcurrencyConfig;\n```\n\n- *Type:* ProvisionedConcurrencyConfig\n\nThe configuration for the provisioned concurrency of the Lambda.\n\n---\n\n##### `vpcConfiguration`Optional \n\n```typescript\npublic readonly vpcConfiguration: VpcConfig;\n```\n\n- *Type:* VpcConfig\n\nThe configuration of the VPC into which to install the Lambda.\n\n---\n\n### SqlModelDataSourceSecretsManagerDbConnectionConfig \n\nThe credentials stored in Secrets Manager that the lambda data source will use to connect to the database.\n\nThe managed secret should be in the same region as the lambda.\n\n#### Initializer \n\n```typescript\nimport { SqlModelDataSourceSecretsManagerDbConnectionConfig } from '@aws-amplify/graphql-api-construct'\n\nconst sqlModelDataSourceSecretsManagerDbConnectionConfig: SqlModelDataSourceSecretsManagerDbConnectionConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| databaseName | string | The database name. |\n| hostname | string | The hostame of the database. |\n| port | number | The port number of the database proxy, cluster, or instance. |\n| secretArn | string | The ARN of the managed secret with username, password, and hostname to use when connecting to the database. |\n| keyArn | string | The ARN of the customer managed encryption key for the secret. |\n\n---\n\n##### `databaseName`Required \n\n```typescript\npublic readonly databaseName: string;\n```\n\n- *Type:* string\n\nThe database name.\n\n---\n\n##### `hostname`Required \n\n```typescript\npublic readonly hostname: string;\n```\n\n- *Type:* string\n\nThe hostame of the database.\n\n---\n\n##### `port`Required \n\n```typescript\npublic readonly port: number;\n```\n\n- *Type:* number\n\nThe port number of the database proxy, cluster, or instance.\n\n---\n\n##### `secretArn`Required \n\n```typescript\npublic readonly secretArn: string;\n```\n\n- *Type:* string\n\nThe ARN of the managed secret with username, password, and hostname to use when connecting to the database.\n\n*\n\n---\n\n##### `keyArn`Optional \n\n```typescript\npublic readonly keyArn: string;\n```\n\n- *Type:* string\n\nThe ARN of the customer managed encryption key for the secret.\n\nIf not supplied, the secret is expected to be encrypted with the default AWS-managed key. *\n\n---\n\n### SqlModelDataSourceSsmDbConnectionConfig \n\nThe Secure Systems Manager parameter paths the Lambda data source will use to connect to the database.\n\nThese parameters are retrieved from Secure Systems Manager in the same region as the Lambda.\n\n#### Initializer \n\n```typescript\nimport { SqlModelDataSourceSsmDbConnectionConfig } from '@aws-amplify/graphql-api-construct'\n\nconst sqlModelDataSourceSsmDbConnectionConfig: SqlModelDataSourceSsmDbConnectionConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| databaseNameSsmPath | string | The Secure Systems Manager parameter containing the database name. |\n| hostnameSsmPath | string | The Secure Systems Manager parameter containing the hostname of the database. |\n| passwordSsmPath | string | The Secure Systems Manager parameter containing the password to use when connecting to the database. |\n| portSsmPath | string | The Secure Systems Manager parameter containing the port number of the database proxy, cluster, or instance. |\n| usernameSsmPath | string | The Secure Systems Manager parameter containing the username to use when connecting to the database. |\n\n---\n\n##### `databaseNameSsmPath`Required \n\n```typescript\npublic readonly databaseNameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the database name.\n\n---\n\n##### `hostnameSsmPath`Required \n\n```typescript\npublic readonly hostnameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the hostname of the database.\n\nFor RDS-based SQL data sources, this can be the hostname\nof a database proxy, cluster, or instance.\n\n---\n\n##### `passwordSsmPath`Required \n\n```typescript\npublic readonly passwordSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the password to use when connecting to the database.\n\n---\n\n##### `portSsmPath`Required \n\n```typescript\npublic readonly portSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the port number of the database proxy, cluster, or instance.\n\n---\n\n##### `usernameSsmPath`Required \n\n```typescript\npublic readonly usernameSsmPath: string;\n```\n\n- *Type:* string\n\nThe Secure Systems Manager parameter containing the username to use when connecting to the database.\n\n---\n\n### SSESpecification \n\nRepresents the settings used to enable server-side encryption.\n\n#### Initializer \n\n```typescript\nimport { SSESpecification } from '@aws-amplify/graphql-api-construct'\n\nconst sSESpecification: SSESpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| sseEnabled | boolean | Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key. |\n| kmsMasterKeyId | string | The AWS KMS key that should be used for the AWS KMS encryption. |\n| sseType | SSEType | Server-side encryption type. |\n\n---\n\n##### `sseEnabled`Required \n\n```typescript\npublic readonly sseEnabled: boolean;\n```\n\n- *Type:* boolean\n\nIndicates whether server-side encryption is done using an AWS managed key or an AWS owned key.\n\nIf enabled (true), server-side encryption type is set to `KMS` and an AWS managed key is used ( AWS KMS charges apply).\nIf disabled (false) or not specified, server-side encryption is set to AWS owned key.\n\n---\n\n##### `kmsMasterKeyId`Optional \n\n```typescript\npublic readonly kmsMasterKeyId: string;\n```\n\n- *Type:* string\n\nThe AWS KMS key that should be used for the AWS KMS encryption.\n\nTo specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide\nthis parameter if the key is different from the default DynamoDB key `alias/aws/dynamodb` .\n\n---\n\n##### `sseType`Optional \n\n```typescript\npublic readonly sseType: SSEType;\n```\n\n- *Type:* SSEType\n\nServer-side encryption type.\n\nThe only supported value is:\n`KMS` Server-side encryption that uses AWS Key Management Service.\n The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).\n\n---\n\n### StreamSpecification \n\nRepresents the DynamoDB Streams configuration for a table in DynamoDB.\n\n#### Initializer \n\n```typescript\nimport { StreamSpecification } from '@aws-amplify/graphql-api-construct'\n\nconst streamSpecification: StreamSpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| streamViewType | aws-cdk-lib.aws_dynamodb.StreamViewType | When an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table. |\n\n---\n\n##### `streamViewType`Required \n\n```typescript\npublic readonly streamViewType: StreamViewType;\n```\n\n- *Type:* aws-cdk-lib.aws_dynamodb.StreamViewType\n\nWhen an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table.\n\nValid values for `StreamViewType` are:\n- `KEYS_ONLY` - Only the key attributes of the modified item are written to the stream.\n- `NEW_IMAGE` - The entire item, as it appears after it was modified, is written to the stream.\n- `OLD_IMAGE` - The entire item, as it appeared before it was modified, is written to the stream.\n- `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the item are written to the stream.\n\n---\n\n### SubnetAvailabilityZone \n\nSubnet configuration for VPC endpoints used by a Lambda resolver for a SQL-based data source.\n\nAlthough it is possible to create multiple\nsubnets in a single availability zone, VPC service endpoints may only be deployed to a single subnet in a given availability zone. This\nstructure ensures that the Lambda function and VPC service endpoints are mutually consistent.\n\n#### Initializer \n\n```typescript\nimport { SubnetAvailabilityZone } from '@aws-amplify/graphql-api-construct'\n\nconst subnetAvailabilityZone: SubnetAvailabilityZone = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| availabilityZone | string | The availability zone of the subnet. |\n| subnetId | string | The subnet ID to install the Lambda data source in. |\n\n---\n\n##### `availabilityZone`Required \n\n```typescript\npublic readonly availabilityZone: string;\n```\n\n- *Type:* string\n\nThe availability zone of the subnet.\n\n---\n\n##### `subnetId`Required \n\n```typescript\npublic readonly subnetId: string;\n```\n\n- *Type:* string\n\nThe subnet ID to install the Lambda data source in.\n\n---\n\n### SubscriptionFunctionSlot \n\nSlot types for Subscription Resolvers.\n\n#### Initializer \n\n```typescript\nimport { SubscriptionFunctionSlot } from '@aws-amplify/graphql-api-construct'\n\nconst subscriptionFunctionSlot: SubscriptionFunctionSlot = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| fieldName | string | The field to attach this function to on the Api definition. |\n| function | FunctionSlotOverride | The overridden behavior for this slot. |\n| slotIndex | number | The slot index to use to inject this into the execution pipeline. |\n| slotName | string | The slot name to inject this behavior into. |\n| typeName | string | This slot type applies to the Subscription type on the Api definition. |\n\n---\n\n##### `fieldName`Required \n\n```typescript\npublic readonly fieldName: string;\n```\n\n- *Type:* string\n\nThe field to attach this function to on the Api definition.\n\n---\n\n##### `function`Required \n\n```typescript\npublic readonly function: FunctionSlotOverride;\n```\n\n- *Type:* FunctionSlotOverride\n\nThe overridden behavior for this slot.\n\n---\n\n##### `slotIndex`Required \n\n```typescript\npublic readonly slotIndex: number;\n```\n\n- *Type:* number\n\nThe slot index to use to inject this into the execution pipeline.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `slotName`Required \n\n```typescript\npublic readonly slotName: string;\n```\n\n- *Type:* string\n\nThe slot name to inject this behavior into.\n\nFor more information on slotting, refer to https://docs.amplify.aws/cli/graphql/custom-business-logic/#extend-amplify-generated-resolvers\n\n---\n\n##### `typeName`Required \n\n```typescript\npublic readonly typeName: string;\n```\n\n- *Type:* string\n\nThis slot type applies to the Subscription type on the Api definition.\n\n---\n\n### TimeToLiveSpecification \n\nShape for TTL config.\n\n#### Initializer \n\n```typescript\nimport { TimeToLiveSpecification } from '@aws-amplify/graphql-api-construct'\n\nconst timeToLiveSpecification: TimeToLiveSpecification = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| enabled | boolean | Boolean determining if the ttl is enabled or not. |\n| attributeName | string | Attribute name to apply to the ttl spec. |\n\n---\n\n##### `enabled`Required \n\n```typescript\npublic readonly enabled: boolean;\n```\n\n- *Type:* boolean\n\nBoolean determining if the ttl is enabled or not.\n\n---\n\n##### `attributeName`Optional \n\n```typescript\npublic readonly attributeName: string;\n```\n\n- *Type:* string\n\nAttribute name to apply to the ttl spec.\n\n---\n\n### TranslationBehavior \n\nStrongly typed set of shared parameters for all transformers, and core layer.\n\nThis is intended to replace feature flags, to ensure param coercion happens in\na single location, and isn't spread around the transformers, where they can\nhave different default behaviors.\n\n#### Initializer \n\n```typescript\nimport { TranslationBehavior } from '@aws-amplify/graphql-api-construct'\n\nconst translationBehavior: TranslationBehavior = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| allowDestructiveGraphqlSchemaUpdates | boolean | The following schema updates require replacement of the underlying DynamoDB table:. |\n| disableResolverDeduping | boolean | Disable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered. |\n| enableAutoIndexQueryNames | boolean | Automate generation of query names, and as a result attaching all indexes as queries to the generated Api. |\n| enableSearchNodeToNodeEncryption | boolean | *No description.* |\n| enableTransformerCfnOutputs | boolean | When enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted. |\n| populateOwnerFieldForStaticGroupAuth | boolean | Ensure that the owner field is still populated even if a static iam or group authorization applies. |\n| replaceTableUponGsiUpdate | boolean | This behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true. |\n| respectPrimaryKeyAttributesOnConnectionField | boolean | Enable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app. |\n| sandboxModeEnabled | boolean | Enabling sandbox mode will enable api key auth on all models in the transformed schema. |\n| secondaryKeyAsGSI | boolean | If disabled, generated. |\n| shouldDeepMergeDirectiveConfigDefaults | boolean | Restore parity w/ GQLv1. |\n| suppressApiKeyGeneration | boolean | If enabled, disable api key resource generation even if specified as an auth rule on the construct. |\n| useSubUsernameForDefaultIdentityClaim | boolean | Ensure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool. |\n\n---\n\n##### `allowDestructiveGraphqlSchemaUpdates`Required \n\n```typescript\npublic readonly allowDestructiveGraphqlSchemaUpdates: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThe following schema updates require replacement of the underlying DynamoDB table:.\n\nRemoving or renaming a model\n - Modifying the primary key of a model\n - Modifying a Local Secondary Index of a model (only applies to projects with secondaryKeyAsGSI turned off)\n\nALL DATA WILL BE LOST when the table replacement happens. When enabled, destructive updates are allowed.\nThis will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `disableResolverDeduping`Required \n\n```typescript\npublic readonly disableResolverDeduping: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nDisable resolver deduping, this can sometimes cause problems because dedupe ordering isn't stable today, which can lead to circular dependencies across stacks if models are reordered.\n\n---\n\n##### `enableAutoIndexQueryNames`Required \n\n```typescript\npublic readonly enableAutoIndexQueryNames: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nAutomate generation of query names, and as a result attaching all indexes as queries to the generated Api.\n\nIf enabled,\n\n---\n\n##### `enableSearchNodeToNodeEncryption`Required \n\n```typescript\npublic readonly enableSearchNodeToNodeEncryption: boolean;\n```\n\n- *Type:* boolean\n\n---\n\n##### `enableTransformerCfnOutputs`Required \n\n```typescript\npublic readonly enableTransformerCfnOutputs: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nWhen enabled, internal cfn outputs which existed in Amplify-generated apps will continue to be emitted.\n\n---\n\n##### `populateOwnerFieldForStaticGroupAuth`Required \n\n```typescript\npublic readonly populateOwnerFieldForStaticGroupAuth: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that the owner field is still populated even if a static iam or group authorization applies.\n\n---\n\n##### `replaceTableUponGsiUpdate`Required \n\n```typescript\npublic readonly replaceTableUponGsiUpdate: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nThis behavior will only come into effect when both \"allowDestructiveGraphqlSchemaUpdates\" and this value are set to true.\n\nWhen enabled, any GSI update operation will replace the table instead of iterative deployment, which will WIPE ALL EXISTING DATA but\ncost much less time for deployment This will only affect DynamoDB tables with provision strategy \"AMPLIFY_TABLE\".\n\n---\n\n##### `respectPrimaryKeyAttributesOnConnectionField`Required \n\n```typescript\npublic readonly respectPrimaryKeyAttributesOnConnectionField: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnable custom primary key support, there's no good reason to disable this unless trying not to update a legacy app.\n\n---\n\n##### `sandboxModeEnabled`Required \n\n```typescript\npublic readonly sandboxModeEnabled: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nEnabling sandbox mode will enable api key auth on all models in the transformed schema.\n\n---\n\n##### `secondaryKeyAsGSI`Required \n\n```typescript\npublic readonly secondaryKeyAsGSI: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nIf disabled, generated.\n\n---\n\n##### `shouldDeepMergeDirectiveConfigDefaults`Required \n\n```typescript\npublic readonly shouldDeepMergeDirectiveConfigDefaults: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nRestore parity w/ GQLv1.\n\n---\n\n##### `suppressApiKeyGeneration`Required \n\n```typescript\npublic readonly suppressApiKeyGeneration: boolean;\n```\n\n- *Type:* boolean\n- *Default:* false\n\nIf enabled, disable api key resource generation even if specified as an auth rule on the construct.\n\nThis is a legacy parameter from the Graphql Transformer existing in Amplify CLI, not recommended to change.\n\n---\n\n##### `useSubUsernameForDefaultIdentityClaim`Required \n\n```typescript\npublic readonly useSubUsernameForDefaultIdentityClaim: boolean;\n```\n\n- *Type:* boolean\n- *Default:* true\n\nEnsure that oidc and userPool auth use the `sub` field in the for the username field, which disallows new users with the same id to access data from a deleted user in the pool.\n\n---\n\n### UserPoolAuthorizationConfig \n\nConfiguration for Cognito UserPool Authorization on the Graphql Api.\n\n#### Initializer \n\n```typescript\nimport { UserPoolAuthorizationConfig } from '@aws-amplify/graphql-api-construct'\n\nconst userPoolAuthorizationConfig: UserPoolAuthorizationConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| userPool | aws-cdk-lib.aws_cognito.IUserPool | The Cognito User Pool which is used to authenticated JWT tokens, and vends group and user information. |\n\n---\n\n##### `userPool`Required \n\n```typescript\npublic readonly userPool: IUserPool;\n```\n\n- *Type:* aws-cdk-lib.aws_cognito.IUserPool\n\nThe Cognito User Pool which is used to authenticated JWT tokens, and vends group and user information.\n\n---\n\n### VpcConfig \n\nConfiguration of the VPC in which to install a Lambda to resolve queries against a SQL-based data source.\n\nThe SQL Lambda will be deployed\ninto the specified VPC, subnets, and security groups. The specified subnets and security groups must be in the same VPC. The VPC must\nhave at least one subnet. The construct will also create VPC service endpoints in the specified subnets, as well as inbound security\nrules, to allow traffic on port 443 within each security group. This allows the Lambda to read database connection information from\nSecure Systems Manager.\n\n#### Initializer \n\n```typescript\nimport { VpcConfig } from '@aws-amplify/graphql-api-construct'\n\nconst vpcConfig: VpcConfig = { ... }\n```\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| securityGroupIds | string[] | The security groups to install the Lambda data source in. |\n| subnetAvailabilityZoneConfig | SubnetAvailabilityZone[] | The subnets to install the Lambda data source in, one per availability zone. |\n| vpcId | string | The VPC to install the Lambda data source in. |\n\n---\n\n##### `securityGroupIds`Required \n\n```typescript\npublic readonly securityGroupIds: string[];\n```\n\n- *Type:* string[]\n\nThe security groups to install the Lambda data source in.\n\n---\n\n##### `subnetAvailabilityZoneConfig`Required \n\n```typescript\npublic readonly subnetAvailabilityZoneConfig: SubnetAvailabilityZone[];\n```\n\n- *Type:* SubnetAvailabilityZone[]\n\nThe subnets to install the Lambda data source in, one per availability zone.\n\n---\n\n##### `vpcId`Required \n\n```typescript\npublic readonly vpcId: string;\n```\n\n- *Type:* string\n\nThe VPC to install the Lambda data source in.\n\n---\n\n## Classes \n\n### AmplifyDynamoDbTableWrapper \n\nWrapper class around Custom::AmplifyDynamoDBTable custom resource, to simplify the override experience a bit.\n\nThis is NOT a construct, just an easier way to access\nthe generated construct.\nThis is a wrapper intended to mimic the `aws_cdk_lib.aws_dynamodb.Table` functionality more-or-less.\nNotable differences is the addition of TKTK properties, to account for the fact that they're constructor props\nin the CDK construct, as well as the removal of all from*, grant*, and metric* methods implemented by Table.\n\n#### Initializers \n\n```typescript\nimport { AmplifyDynamoDbTableWrapper } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyDynamoDbTableWrapper(resource: CfnResource)\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| resource | aws-cdk-lib.CfnResource | the Cfn resource. |\n\n---\n\n##### `resource`Required \n\n- *Type:* aws-cdk-lib.CfnResource\n\nthe Cfn resource.\n\n---\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| applyRemovalPolicy | Set the deletion policy of the resource based on the removal policy specified. |\n| setGlobalSecondaryIndexProvisionedThroughput | Set the provisionedThroughtput for a specified GSI by name. |\n\n---\n\n##### `applyRemovalPolicy` \n\n```typescript\npublic applyRemovalPolicy(policy: RemovalPolicy): void\n```\n\nSet the deletion policy of the resource based on the removal policy specified.\n\n###### `policy`Required \n\n- *Type:* aws-cdk-lib.RemovalPolicy\n\nremoval policy to set.\n\n---\n\n##### `setGlobalSecondaryIndexProvisionedThroughput` \n\n```typescript\npublic setGlobalSecondaryIndexProvisionedThroughput(indexName: string, provisionedThroughput: ProvisionedThroughput): void\n```\n\nSet the provisionedThroughtput for a specified GSI by name.\n\n###### `indexName`Required \n\n- *Type:* string\n\nthe index to specify a provisionedThroughput config for.\n\n---\n\n###### `provisionedThroughput`Required \n\n- *Type:* ProvisionedThroughput\n\nthe config to set.\n\n---\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| isAmplifyDynamoDbTableResource | Return true and perform type narrowing if a given input appears to be capable of. |\n\n---\n\n##### `isAmplifyDynamoDbTableResource` \n\n```typescript\nimport { AmplifyDynamoDbTableWrapper } from '@aws-amplify/graphql-api-construct'\n\nAmplifyDynamoDbTableWrapper.isAmplifyDynamoDbTableResource(x: any)\n```\n\nReturn true and perform type narrowing if a given input appears to be capable of.\n\n###### `x`Required \n\n- *Type:* any\n\nthe object to check.\n\n---\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| billingMode | aws-cdk-lib.aws_dynamodb.BillingMode | Specify how you are charged for read and write throughput and how you manage capacity. |\n| deletionProtectionEnabled | boolean | Set table deletion protection. |\n| pointInTimeRecoveryEnabled | boolean | Whether point-in-time recovery is enabled. |\n| provisionedThroughput | ProvisionedThroughput | Update the provisioned throughput for the base table. |\n| sseSpecification | SSESpecification | Set the ddb server-side encryption specification on the table. |\n| streamSpecification | StreamSpecification | Set the ddb stream specification on the table. |\n| timeToLiveAttribute | TimeToLiveSpecification | The name of TTL attribute. |\n\n---\n\n##### `billingMode`Required \n\n```typescript\npublic readonly billingMode: BillingMode;\n```\n\n- *Type:* aws-cdk-lib.aws_dynamodb.BillingMode\n\nSpecify how you are charged for read and write throughput and how you manage capacity.\n\n---\n\n##### `deletionProtectionEnabled`Required \n\n```typescript\npublic readonly deletionProtectionEnabled: boolean;\n```\n\n- *Type:* boolean\n\nSet table deletion protection.\n\n---\n\n##### `pointInTimeRecoveryEnabled`Required \n\n```typescript\npublic readonly pointInTimeRecoveryEnabled: boolean;\n```\n\n- *Type:* boolean\n\nWhether point-in-time recovery is enabled.\n\n---\n\n##### `provisionedThroughput`Required \n\n```typescript\npublic readonly provisionedThroughput: ProvisionedThroughput;\n```\n\n- *Type:* ProvisionedThroughput\n\nUpdate the provisioned throughput for the base table.\n\n---\n\n##### `sseSpecification`Required \n\n```typescript\npublic readonly sseSpecification: SSESpecification;\n```\n\n- *Type:* SSESpecification\n\nSet the ddb server-side encryption specification on the table.\n\n---\n\n##### `streamSpecification`Required \n\n```typescript\npublic readonly streamSpecification: StreamSpecification;\n```\n\n- *Type:* StreamSpecification\n\nSet the ddb stream specification on the table.\n\n---\n\n##### `timeToLiveAttribute`Required \n\n```typescript\npublic readonly timeToLiveAttribute: TimeToLiveSpecification;\n```\n\n- *Type:* TimeToLiveSpecification\n\nThe name of TTL attribute.\n\n---\n\n\n### AmplifyGraphqlDefinition \n\nClass exposing utilities to produce IAmplifyGraphqlDefinition objects given various inputs.\n\n#### Initializers \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nnew AmplifyGraphqlDefinition()\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n\n---\n\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| combine | Combines multiple IAmplifyGraphqlDefinitions into a single definition. |\n| fromFiles | Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source. |\n| fromFilesAndStrategy | Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema. |\n| fromString | Produce a schema definition from a string input. |\n\n---\n\n##### `combine` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.combine(definitions: IAmplifyGraphqlDefinition[])\n```\n\nCombines multiple IAmplifyGraphqlDefinitions into a single definition.\n\n###### `definitions`Required \n\n- *Type:* IAmplifyGraphqlDefinition[]\n\nthe definitions to combine.\n\n---\n\n##### `fromFiles` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromFiles(filePaths: string)\n```\n\nConvert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source.\n\n###### `filePaths`Required \n\n- *Type:* string\n\none or more paths to the graphql files to process.\n\n---\n\n##### `fromFilesAndStrategy` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromFilesAndStrategy(filePaths: string | string[], dataSourceStrategy?: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy)\n```\n\nConvert one or more appsync SchemaFile objects into an Amplify Graphql Schema.\n\n###### `filePaths`Required \n\n- *Type:* string | string[]\n\none or more paths to the graphql files to process.\n\n---\n\n###### `dataSourceStrategy`Optional \n\n- *Type:* DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy\n\nthe provisioning definition for datasources that resolve `@model`s in this schema.\n\nThe DynamoDB from\nCloudFormation will be used by default.\n\n---\n\n##### `fromString` \n\n```typescript\nimport { AmplifyGraphqlDefinition } from '@aws-amplify/graphql-api-construct'\n\nAmplifyGraphqlDefinition.fromString(schema: string, dataSourceStrategy?: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy)\n```\n\nProduce a schema definition from a string input.\n\n###### `schema`Required \n\n- *Type:* string\n\nthe graphql input as a string.\n\n---\n\n###### `dataSourceStrategy`Optional \n\n- *Type:* DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy\n\nthe provisioning definition for datasources that resolve `@model`s and custom SQL statements in this schema.\n\nThe DynamoDB from CloudFormation will be used by default.\n\n---\n\n\n\n### SQLLambdaModelDataSourceStrategyFactory \n\nClass exposing utilities to produce SQLLambdaModelDataSourceStrategy objects given various inputs.\n\n#### Initializers \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategyFactory } from '@aws-amplify/graphql-api-construct'\n\nnew SQLLambdaModelDataSourceStrategyFactory()\n```\n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n\n---\n\n\n#### Static Functions \n\n| **Name** | **Description** |\n| --- | --- |\n| fromCustomSqlFiles | Creates a SQLLambdaModelDataSourceStrategy where the binding's `customSqlStatements` are populated from `sqlFiles`. |\n\n---\n\n##### `fromCustomSqlFiles` \n\n```typescript\nimport { SQLLambdaModelDataSourceStrategyFactory } from '@aws-amplify/graphql-api-construct'\n\nSQLLambdaModelDataSourceStrategyFactory.fromCustomSqlFiles(sqlFiles: string[], options: SQLLambdaModelDataSourceStrategy)\n```\n\nCreates a SQLLambdaModelDataSourceStrategy where the binding's `customSqlStatements` are populated from `sqlFiles`.\n\nThe key\nof the `customSqlStatements` record is the file's base name (that is, the name of the file minus the directory and extension).\n\n###### `sqlFiles`Required \n\n- *Type:* string[]\n\nthe list of files to load SQL statements from.\n\n---\n\n###### `options`Required \n\n- *Type:* SQLLambdaModelDataSourceStrategy\n\nthe remaining SQLLambdaModelDataSourceStrategy options.\n\n---\n\n\n\n## Protocols \n\n### IAmplifyGraphqlDefinition \n\n- *Implemented By:* IAmplifyGraphqlDefinition\n\nGraphql Api definition, which can be implemented in multiple ways.\n\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| dataSourceStrategies | {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy \\| AmplifyDynamoDbModelDataSourceStrategy \\| SQLLambdaModelDataSourceStrategy} | Retrieve the datasource strategy mapping. |\n| functionSlots | MutationFunctionSlot \\| QueryFunctionSlot \\| SubscriptionFunctionSlot[] | Retrieve any function slots defined explicitly in the Api definition. |\n| schema | string | Return the schema definition as a graphql string, with amplify directives allowed. |\n| customSqlDataSourceStrategies | CustomSqlDataSourceStrategy[] | An array of custom Query or Mutation SQL commands to the data sources that resolves them. |\n| referencedLambdaFunctions | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | Retrieve the references to any lambda functions used in the definition. |\n\n---\n\n##### `dataSourceStrategies`Required \n\n```typescript\npublic readonly dataSourceStrategies: {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy};\n```\n\n- *Type:* {[ key: string ]: DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy}\n\nRetrieve the datasource strategy mapping.\n\nThe default strategy is to use DynamoDB from CloudFormation.\n\n---\n\n##### `functionSlots`Required \n\n```typescript\npublic readonly functionSlots: MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[];\n```\n\n- *Type:* MutationFunctionSlot | QueryFunctionSlot | SubscriptionFunctionSlot[]\n\nRetrieve any function slots defined explicitly in the Api definition.\n\n---\n\n##### `schema`Required \n\n```typescript\npublic readonly schema: string;\n```\n\n- *Type:* string\n\nReturn the schema definition as a graphql string, with amplify directives allowed.\n\n---\n\n##### `customSqlDataSourceStrategies`Optional \n\n```typescript\npublic readonly customSqlDataSourceStrategies: CustomSqlDataSourceStrategy[];\n```\n\n- *Type:* CustomSqlDataSourceStrategy[]\n\nAn array of custom Query or Mutation SQL commands to the data sources that resolves them.\n\n---\n\n##### `referencedLambdaFunctions`Optional \n\n```typescript\npublic readonly referencedLambdaFunctions: {[ key: string ]: IFunction};\n```\n\n- *Type:* {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction}\n\nRetrieve the references to any lambda functions used in the definition.\n\nUseful for wiring through aws_lambda.Function constructs into the definition directly,\nand generated references to invoke them.\n\n---\n\n### IBackendOutputEntry \n\n- *Implemented By:* IBackendOutputEntry\n\nEntry representing the required output from the backend for codegen generate commands to work.\n\n\n#### Properties \n\n| **Name** | **Type** | **Description** |\n| --- | --- | --- |\n| payload | {[ key: string ]: string} | The string-map payload of generated config values. |\n| version | string | The protocol version for this backend output. |\n\n---\n\n##### `payload`Required \n\n```typescript\npublic readonly payload: {[ key: string ]: string};\n```\n\n- *Type:* {[ key: string ]: string}\n\nThe string-map payload of generated config values.\n\n---\n\n##### `version`Required \n\n```typescript\npublic readonly version: string;\n```\n\n- *Type:* string\n\nThe protocol version for this backend output.\n\n---\n\n### IBackendOutputStorageStrategy \n\n- *Implemented By:* IBackendOutputStorageStrategy\n\nBackend output strategy used to write config required for codegen tasks.\n\n#### Methods \n\n| **Name** | **Description** |\n| --- | --- |\n| addBackendOutputEntry | Add an entry to backend output. |\n\n---\n\n##### `addBackendOutputEntry` \n\n```typescript\npublic addBackendOutputEntry(keyName: string, backendOutputEntry: IBackendOutputEntry): void\n```\n\nAdd an entry to backend output.\n\n###### `keyName`Required \n\n- *Type:* string\n\nthe key.\n\n---\n\n###### `backendOutputEntry`Required \n\n- *Type:* IBackendOutputEntry\n\nthe record to store in the backend output.\n\n---\n\n\n## Enums \n\n### SSEType \n\nServer Side Encryption Type Values - `KMS` - Server-side encryption that uses AWS KMS.\n\nThe key is stored in your account and is managed by KMS (AWS KMS charges apply).\n\n#### Members \n\n| **Name** | **Description** |\n| --- | --- |\n| KMS | *No description.* |\n\n---\n\n##### `KMS` \n\n---\n\n" }, "repository": { "directory": "packages/amplify-graphql-api-construct", @@ -3951,7 +3951,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 139 + "line": 137 }, "parameters": [ { @@ -3986,7 +3986,7 @@ "kind": "class", "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 85 + "line": 83 }, "methods": [ { @@ -3998,7 +3998,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 286 + "line": 281 }, "name": "addDynamoDbDataSource", "parameters": [ @@ -4047,7 +4047,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 298 + "line": 293 }, "name": "addElasticsearchDataSource", "parameters": [ @@ -4094,7 +4094,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 308 + "line": 303 }, "name": "addEventBridgeDataSource", "parameters": [ @@ -4141,7 +4141,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 390 + "line": 385 }, "name": "addFunction", "parameters": [ @@ -4176,7 +4176,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 319 + "line": 314 }, "name": "addHttpDataSource", "parameters": [ @@ -4224,7 +4224,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 330 + "line": 325 }, "name": "addLambdaDataSource", "parameters": [ @@ -4272,7 +4272,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 341 + "line": 336 }, "name": "addNoneDataSource", "parameters": [ @@ -4311,7 +4311,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 352 + "line": 347 }, "name": "addOpenSearchDataSource", "parameters": [ @@ -4359,7 +4359,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 365 + "line": 360 }, "name": "addRdsDataSource", "parameters": [ @@ -4426,7 +4426,7 @@ }, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 381 + "line": 376 }, "name": "addResolver", "parameters": [ @@ -4467,7 +4467,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 120 + "line": 118 }, "name": "apiId", "type": { @@ -4482,7 +4482,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 100 + "line": 98 }, "name": "generatedFunctionSlots", "type": { @@ -4515,7 +4515,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 105 + "line": 103 }, "name": "graphqlUrl", "type": { @@ -4531,7 +4531,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 110 + "line": 108 }, "name": "realtimeUrl", "type": { @@ -4546,7 +4546,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 89 + "line": 87 }, "name": "resources", "type": { @@ -4562,7 +4562,7 @@ "immutable": true, "locationInModule": { "filename": "src/amplify-graphql-api.ts", - "line": 115 + "line": 113 }, "name": "apiKey", "optional": true, @@ -8171,5 +8171,5 @@ } }, "version": "1.8.1", - "fingerprint": "VIsfxprZNhSSF6JXV2vxddQyuoEc3W/sKrqgYe1h4fs=" + "fingerprint": "RYLDuPcXrKkJVdyr+N3cvr80/DnbRL4kKh9QZAl4lUY=" } \ No newline at end of file diff --git a/packages/amplify-graphql-api-construct/README.md b/packages/amplify-graphql-api-construct/README.md index a285b49216..41c150fd3a 100644 --- a/packages/amplify-graphql-api-construct/README.md +++ b/packages/amplify-graphql-api-construct/README.md @@ -6,8 +6,6 @@ This package vends an L3 CDK Construct wrapping the behavior of the Amplify Grap The primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema. -Note: only a single instance of the `AmplifyGraphqlApi` construct can be invoked within a CDK synthesis at this point in time. - ## Examples ### Simple Todo List With Cognito Userpool-based Owner Authorization @@ -872,6 +870,7 @@ const amplifyGraphqlApiCfnResources: AmplifyGraphqlApiCfnResources = { ... } | **Name** | **Type** | **Description** | | --- | --- | --- | | additionalCfnResources | {[ key: string ]: aws-cdk-lib.CfnResource} | Remaining L1 resources generated, keyed by logicalId. | +| amplifyDynamoDbTables | {[ key: string ]: AmplifyDynamoDbTableWrapper} | The Generated Amplify DynamoDb Table L1 resource wrapper, keyed by model type name. | | cfnDataSources | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnDataSource} | The Generated AppSync DataSource L1 Resources, keyed by logicalId. | | cfnFunctionConfigurations | {[ key: string ]: aws-cdk-lib.aws_appsync.CfnFunctionConfiguration} | The Generated AppSync Function L1 Resources, keyed by logicalId. | | cfnFunctions | {[ key: string ]: aws-cdk-lib.aws_lambda.CfnFunction} | The Generated Lambda Function L1 Resources, keyed by function name. | @@ -896,6 +895,18 @@ Remaining L1 resources generated, keyed by logicalId. --- +##### `amplifyDynamoDbTables`Required + +```typescript +public readonly amplifyDynamoDbTables: {[ key: string ]: AmplifyDynamoDbTableWrapper}; +``` + +- *Type:* {[ key: string ]: AmplifyDynamoDbTableWrapper} + +The Generated Amplify DynamoDb Table L1 resource wrapper, keyed by model type name. + +--- + ##### `cfnDataSources`Required ```typescript @@ -1027,6 +1038,8 @@ const amplifyGraphqlApiProps: AmplifyGraphqlApiProps = { ... } | definition | IAmplifyGraphqlDefinition | The definition to transform in a full Api. | | apiName | string | Name to be used for the AppSync Api. | | conflictResolution | ConflictResolution | Configure conflict resolution on the Api, which is required to enable DataStore Api functionality. | +| dataStoreConfiguration | DataStoreConfiguration | Configure DataStore conflict resolution on the Api. | +| disableOutputStorage | boolean | Disables storing construct output. | | functionNameMap | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | Lambda functions referenced in the definitions's. | | functionSlots | MutationFunctionSlot \| QueryFunctionSlot \| SubscriptionFunctionSlot[] | Overrides for a given slot in the generated resolver pipelines. | | outputStorageStrategy | IBackendOutputStorageStrategy | Strategy to store construct outputs. | @@ -1080,7 +1093,9 @@ Default: construct id. --- -##### `conflictResolution`Optional +##### ~~`conflictResolution`~~Optional + +- *Deprecated:* use dataStoreConfiguration instead. ```typescript public readonly conflictResolution: ConflictResolution; @@ -1094,6 +1109,36 @@ For more information, refer to https://docs.amplify.aws/lib/datastore/getting-st --- +##### `dataStoreConfiguration`Optional + +```typescript +public readonly dataStoreConfiguration: DataStoreConfiguration; +``` + +- *Type:* DataStoreConfiguration + +Configure DataStore conflict resolution on the Api. + +Conflict resolution is required to enable DataStore Api functionality. +For more information, refer to https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/ + +--- + +##### `disableOutputStorage`Optional + +```typescript +public readonly disableOutputStorage: boolean; +``` + +- *Type:* boolean + +Disables storing construct output. + +Output storage should be disabled when creating multiple GraphQL APIs in a single CDK synthesis. +outputStorageStrategy will be ignored if this is set to true. + +--- + ##### `functionNameMap`Optional ```typescript @@ -1209,7 +1254,6 @@ const amplifyGraphqlApiResources: AmplifyGraphqlApiResources = { ... } | **Name** | **Type** | **Description** | | --- | --- | --- | -| amplifyDynamoDbTables | {[ key: string ]: AmplifyDynamoDbTableWrapper} | The Generated Amplify DynamoDb Table wrapped if produced, keyed by name. | | cfnResources | AmplifyGraphqlApiCfnResources | L1 Cfn Resources, for when dipping down a level of abstraction is desirable. | | functions | {[ key: string ]: aws-cdk-lib.aws_lambda.IFunction} | The Generated Lambda Function L1 Resources, keyed by function name. | | graphqlApi | aws-cdk-lib.aws_appsync.IGraphqlApi | The Generated AppSync Api L2 Resource, includes the Schema. | @@ -1219,18 +1263,6 @@ const amplifyGraphqlApiResources: AmplifyGraphqlApiResources = { ... } --- -##### `amplifyDynamoDbTables`Required - -```typescript -public readonly amplifyDynamoDbTables: {[ key: string ]: AmplifyDynamoDbTableWrapper}; -``` - -- *Type:* {[ key: string ]: AmplifyDynamoDbTableWrapper} - -The Generated Amplify DynamoDb Table wrapped if produced, keyed by name. - ---- - ##### `cfnResources`Required ```typescript @@ -1541,7 +1573,9 @@ const conflictResolution: ConflictResolution = { ... } --- -##### `models`Optional +##### ~~`models`~~Optional + +- *Deprecated:* use DataStoreConfiguration instead. ```typescript public readonly models: {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy}; @@ -1553,7 +1587,9 @@ Model-specific conflict resolution overrides. --- -##### `project`Optional +##### ~~`project`~~Optional + +- *Deprecated:* use DataStoreConfiguration instead. ```typescript public readonly project: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy; @@ -1721,6 +1757,53 @@ The built-in type (either "Query" or "Mutation") with which the custom SQL is as --- +### DataStoreConfiguration + +Project level configuration for DataStore. + +#### Initializer + +```typescript +import { DataStoreConfiguration } from '@aws-amplify/graphql-api-construct' + +const dataStoreConfiguration: DataStoreConfiguration = { ... } +``` + +#### Properties + +| **Name** | **Type** | **Description** | +| --- | --- | --- | +| models | {[ key: string ]: AutomergeConflictResolutionStrategy \| OptimisticConflictResolutionStrategy \| CustomConflictResolutionStrategy} | Model-specific conflict resolution overrides. | +| project | AutomergeConflictResolutionStrategy \| OptimisticConflictResolutionStrategy \| CustomConflictResolutionStrategy | Project-wide config for conflict resolution. | + +--- + +##### `models`Optional + +```typescript +public readonly models: {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy}; +``` + +- *Type:* {[ key: string ]: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy} + +Model-specific conflict resolution overrides. + +--- + +##### `project`Optional + +```typescript +public readonly project: AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy; +``` + +- *Type:* AutomergeConflictResolutionStrategy | OptimisticConflictResolutionStrategy | CustomConflictResolutionStrategy + +Project-wide config for conflict resolution. + +Applies to all non-overridden models. + +--- + ### DefaultDynamoDbModelDataSourceStrategy Use default CloudFormation type 'AWS::DynamoDB::Table' to provision table. @@ -2712,6 +2795,10 @@ The configuration of the VPC into which to install the Lambda. ### SqlModelDataSourceSecretsManagerDbConnectionConfig +The credentials stored in Secrets Manager that the lambda data source will use to connect to the database. + +The managed secret should be in the same region as the lambda. + #### Initializer ```typescript @@ -2724,9 +2811,11 @@ const sqlModelDataSourceSecretsManagerDbConnectionConfig: SqlModelDataSourceSecr | **Name** | **Type** | **Description** | | --- | --- | --- | -| databaseName | string | database name. | -| port | number | port number of the database proxy, cluster, or instance. | -| secretArn | string | The arn of the managed secret with username, password, and hostname to use when connecting to the database. | +| databaseName | string | The database name. | +| hostname | string | The hostame of the database. | +| port | number | The port number of the database proxy, cluster, or instance. | +| secretArn | string | The ARN of the managed secret with username, password, and hostname to use when connecting to the database. | +| keyArn | string | The ARN of the customer managed encryption key for the secret. | --- @@ -2738,7 +2827,19 @@ public readonly databaseName: string; - *Type:* string -database name. +The database name. + +--- + +##### `hostname`Required + +```typescript +public readonly hostname: string; +``` + +- *Type:* string + +The hostame of the database. --- @@ -2750,7 +2851,7 @@ public readonly port: number; - *Type:* number -port number of the database proxy, cluster, or instance. +The port number of the database proxy, cluster, or instance. --- @@ -2762,12 +2863,26 @@ public readonly secretArn: string; - *Type:* string -The arn of the managed secret with username, password, and hostname to use when connecting to the database. +The ARN of the managed secret with username, password, and hostname to use when connecting to the database. * --- +##### `keyArn`Optional + +```typescript +public readonly keyArn: string; +``` + +- *Type:* string + +The ARN of the customer managed encryption key for the secret. + +If not supplied, the secret is expected to be encrypted with the default AWS-managed key. * + +--- + ### SqlModelDataSourceSsmDbConnectionConfig The Secure Systems Manager parameter paths the Lambda data source will use to connect to the database. @@ -3495,10 +3610,27 @@ the Cfn resource. | **Name** | **Description** | | --- | --- | +| applyRemovalPolicy | Set the deletion policy of the resource based on the removal policy specified. | | setGlobalSecondaryIndexProvisionedThroughput | Set the provisionedThroughtput for a specified GSI by name. | --- +##### `applyRemovalPolicy` + +```typescript +public applyRemovalPolicy(policy: RemovalPolicy): void +``` + +Set the deletion policy of the resource based on the removal policy specified. + +###### `policy`Required + +- *Type:* aws-cdk-lib.RemovalPolicy + +removal policy to set. + +--- + ##### `setGlobalSecondaryIndexProvisionedThroughput` ```typescript diff --git a/packages/amplify-graphql-api-construct/README_HEAD.md b/packages/amplify-graphql-api-construct/README_HEAD.md index 4f9d805bcd..1d3aa00ed6 100644 --- a/packages/amplify-graphql-api-construct/README_HEAD.md +++ b/packages/amplify-graphql-api-construct/README_HEAD.md @@ -6,8 +6,6 @@ This package vends an L3 CDK Construct wrapping the behavior of the Amplify Grap The primary way to use this construct is to invoke it with a provided schema (either as an inline graphql string, or as one or more `appsync.SchemaFile`) objects, and with authorization config provided. There are 5 supported methods for authorization of an AppSync API, all of which are supported by this construct. For more information on authorization rule definitions in Amplify, refer to the [authorization docs](https://docs.amplify.aws/cli/graphql/authorization-rules/). Note: currently at least one authorization rule is required, and if multiple are specified, a `defaultAuthorizationMode` must be specified on the api as well. Specified authorization modes must be a superset of those configured in the graphql schema. -Note: only a single instance of the `AmplifyGraphqlApi` construct can be invoked within a CDK synthesis at this point in time. - ## Examples ### Simple Todo List With Cognito Userpool-based Owner Authorization diff --git a/packages/amplify-graphql-api-construct/src/__tests__/__functional__/basic.test.ts b/packages/amplify-graphql-api-construct/src/__tests__/__functional__/basic.test.ts index 7cae02a3ee..26bbd3af51 100644 --- a/packages/amplify-graphql-api-construct/src/__tests__/__functional__/basic.test.ts +++ b/packages/amplify-graphql-api-construct/src/__tests__/__functional__/basic.test.ts @@ -1,6 +1,7 @@ import * as cdk from 'aws-cdk-lib'; import * as cognito from 'aws-cdk-lib/aws-cognito'; import { Template } from 'aws-cdk-lib/assertions'; +import { Construct } from 'constructs'; import { AmplifyGraphqlApi } from '../../amplify-graphql-api'; import { AmplifyGraphqlDefinition } from '../../amplify-graphql-definition'; @@ -141,7 +142,7 @@ describe('basic functionality', () => { expect(connectionTemplate).toBeDefined(); }); - it('throws if multiple apis are attached to the same stack', () => { + it('throws if multiple apis are attached to the same parent stack', () => { const stack = new cdk.Stack(); const definition = AmplifyGraphqlDefinition.fromString('type Todo @model @auth(rules: [{ allow: public }]) { id: ID! }'); @@ -150,11 +151,11 @@ describe('basic functionality', () => { new AmplifyGraphqlApi(stack, 'TestApi1', { definition, authorizationModes }); expect(() => new AmplifyGraphqlApi(stack, 'TestApi2', { definition, authorizationModes })).toThrowErrorMatchingInlineSnapshot( - '"Only one AmplifyGraphqlApi is expected in a stack"', + `"Only one AmplifyGraphqlApi is expected in a stack. Place the AmplifyGraphqlApis in separate nested stacks."`, ); }); - it('throws if multiple apis are attached to the same root stack within nested stacks', () => { + it('allows multiple apis are attached to the same root stack within nested stacks', () => { const stack = new cdk.Stack(); const nested1 = new cdk.NestedStack(stack, 'Nested1'); const nested2 = new cdk.NestedStack(stack, 'Nested2'); @@ -164,8 +165,45 @@ describe('basic functionality', () => { new AmplifyGraphqlApi(nested1, 'TestApi1', { definition, authorizationModes }); - expect(() => new AmplifyGraphqlApi(nested2, 'TestApi2', { definition, authorizationModes })).toThrowErrorMatchingInlineSnapshot( - '"Only one AmplifyGraphqlApi is expected in a stack"', - ); + expect(() => new AmplifyGraphqlApi(nested2, 'TestApi2', { definition, authorizationModes })).not.toThrow(); + }); + + it('allows multiple cdk pipeline stages', () => { + class BackendStack extends cdk.Stack { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const definition = AmplifyGraphqlDefinition.fromString('type Todo @model @auth(rules: [{ allow: public }]) { id: ID! }'); + const authorizationModes = { apiKeyConfig: { expires: cdk.Duration.days(7) } }; + new AmplifyGraphqlApi(this, 'MyGraphqlApi', { + definition, + authorizationModes, + }); + } + } + class MyApplication extends cdk.Stage { + constructor(scope: Construct, id: string, props?: cdk.StageProps) { + super(scope, id, props); + + new BackendStack(this, 'MyBackendStack'); + } + } + class MyPipelineStack extends cdk.Stack { + constructor(scope: Construct, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const pipeline = new cdk.pipelines.CodePipeline(this, 'Pipeline', { + synth: new cdk.pipelines.ShellStep('Synth', { + input: cdk.pipelines.CodePipelineSource.gitHub('OWNER/REPO', 'main'), + commands: ['npx cdk synth'], + }), + }); + + pipeline.addStage(new MyApplication(this, 'stageone')); + + pipeline.addStage(new MyApplication(this, 'stagetwo')); + } + } + expect(() => new MyPipelineStack(new cdk.App(), 'MyPipelineStack', {})).not.toThrow(); }); }); diff --git a/packages/amplify-graphql-api-construct/src/__tests__/internal/asset-provider.test.ts b/packages/amplify-graphql-api-construct/src/__tests__/internal/asset-provider.test.ts new file mode 100644 index 0000000000..84b0968bbe --- /dev/null +++ b/packages/amplify-graphql-api-construct/src/__tests__/internal/asset-provider.test.ts @@ -0,0 +1,18 @@ +import * as cdk from 'aws-cdk-lib'; +import { Construct } from 'constructs'; +import { AssetProvider } from '../../internal'; + +describe('AssetProvider', () => { + test('uses a unique directory for each asset manager', () => { + const stack = new cdk.Stack(); + const mockConstruct1 = new Construct(stack, 'MockConstruct1'); + const assetProvider1 = new AssetProvider(mockConstruct1); + + const mockConstruct2 = new Construct(stack, 'MockConstruct2'); + const assetProvider2 = new AssetProvider(mockConstruct2); + + // disable ts to access private field + // @ts-ignore + expect(assetProvider1.tempAssetDir).not.toEqual(assetProvider2.tempAssetDir); + }); +}); diff --git a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts index 4d1fef9349..30319088ba 100644 --- a/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts +++ b/packages/amplify-graphql-api-construct/src/amplify-graphql-api.ts @@ -2,8 +2,6 @@ import * as path from 'path'; import { Construct } from 'constructs'; import { ExecuteTransformConfig, executeTransform } from '@aws-amplify/graphql-transformer'; import { NestedStack, Stack } from 'aws-cdk-lib'; -import { Asset } from 'aws-cdk-lib/aws-s3-assets'; -import { AssetProps } from '@aws-amplify/graphql-transformer-interfaces'; import { AttributionMetadataStorage, StackMetadataBackendOutputStorageStrategy } from '@aws-amplify/backend-output-storage'; import { graphqlOutputKey } from '@aws-amplify/backend-output-schemas'; import type { GraphqlOutput, AwsAppsyncAuthenticationType } from '@aws-amplify/backend-output-schemas'; @@ -43,7 +41,7 @@ import { convertAuthorizationModesToTransformerAuthConfig, convertToResolverConfig, defaultTranslationBehavior, - AssetManager, + AssetProvider, getGeneratedResources, getGeneratedFunctionSlots, CodegenAssets, @@ -182,17 +180,14 @@ export class AmplifyGraphqlApi extends Construct { throw new Error(`or cdk --context env must have a length <= 8, found ${amplifyEnvironmentName}`); } - const assetManager = new AssetManager(); + const assetProvider = new AssetProvider(this); const executeTransformConfig: ExecuteTransformConfig = { scope: this, nestedStackProvider: { provide: (nestedStackScope: Construct, name: string) => new NestedStack(nestedStackScope, name), }, - assetProvider: { - provide: (assetScope: Construct, assetId: string, assetProps: AssetProps) => - new Asset(assetScope, assetId, { path: assetManager.addAsset(assetProps.fileName, assetProps.fileContent) }), - }, + assetProvider, synthParameters: { amplifyEnvironmentName: amplifyEnvironmentName, apiName: props.apiName ?? id, @@ -227,7 +222,7 @@ export class AmplifyGraphqlApi extends Construct { this.codegenAssets = new CodegenAssets(this, 'AmplifyCodegenAssets', { modelSchema: definition.schema }); this.resources = getGeneratedResources(this); - this.generatedFunctionSlots = getGeneratedFunctionSlots(assetManager.resolverAssets); + this.generatedFunctionSlots = getGeneratedFunctionSlots(assetProvider.resolverAssets); this.storeOutput(outputStorageStrategy); this.apiId = this.resources.cfnResources.cfnGraphqlApi.attrApiId; @@ -401,7 +396,7 @@ export class AmplifyGraphqlApi extends Construct { * @param scope the scope this construct is created in. */ const validateNoOtherAmplifyGraphqlApiInStack = (scope: Construct): void => { - const rootStack = getStackForScope(scope, true); + const rootStack = getStackForScope(scope, false); let wasOtherAmplifyGraphlApiFound = false; walkAndProcessNodes(rootStack, (node: Construct) => { @@ -411,7 +406,7 @@ const validateNoOtherAmplifyGraphqlApiInStack = (scope: Construct): void => { }); if (wasOtherAmplifyGraphlApiFound) { - throw new Error('Only one AmplifyGraphqlApi is expected in a stack'); + throw new Error('Only one AmplifyGraphqlApi is expected in a stack. Place the AmplifyGraphqlApis in separate nested stacks.'); } }; diff --git a/packages/amplify-graphql-api-construct/src/internal/asset-manager.ts b/packages/amplify-graphql-api-construct/src/internal/asset-manager.ts deleted file mode 100644 index 8da38f0d29..0000000000 --- a/packages/amplify-graphql-api-construct/src/internal/asset-manager.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as fs from 'fs'; -import * as path from 'path'; -import * as cdk from 'aws-cdk-lib'; - -const TEMP_PREFIX = 'transformer-assets'; -const FUNCTION_PREFIX = 'functions'; -const RESOLVER_PREFIX = 'resolvers'; - -/** - * The asset manager bridges the gap between creation of file assets in the transformer (which provide a name+contents tuple) - * with the path method which is used in CDK. - */ -export class AssetManager { - private readonly tempAssetDir: string = cdk.FileSystem.mkdtemp(TEMP_PREFIX); - public readonly resolverAssets: Record = {}; - - public addAsset(fileName: string, contents: string): string { - this.trackResolverAsset(fileName, contents); - const writableContents = this.isContentsAReference(fileName) ? this.dereferenceContents(contents) : contents; - const filePath = path.join(this.tempAssetDir, fileName); - const fileDirName = path.dirname(filePath); - if (!fs.existsSync(fileDirName)) { - fs.mkdirSync(fileDirName, { recursive: true }); - } - fs.writeFileSync(filePath, writableContents); - return filePath; - } - - private isContentsAReference(fileName: string): boolean { - return fileName.startsWith(FUNCTION_PREFIX); - } - - private dereferenceContents(contents: string): Buffer { - return fs.readFileSync(contents); - } - - private trackResolverAsset(fileName: string, contents: string): void { - if (fileName.startsWith(RESOLVER_PREFIX)) { - const resolverFileName = fileName.split('/')[1]; - this.resolverAssets[resolverFileName] = contents; - } - } -} diff --git a/packages/amplify-graphql-api-construct/src/internal/asset-provider.ts b/packages/amplify-graphql-api-construct/src/internal/asset-provider.ts new file mode 100644 index 0000000000..d5a04dae34 --- /dev/null +++ b/packages/amplify-graphql-api-construct/src/internal/asset-provider.ts @@ -0,0 +1,64 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { Construct } from 'constructs'; +import * as cdk from 'aws-cdk-lib'; +import { Asset } from 'aws-cdk-lib/aws-s3-assets'; +import { AssetProps, S3Asset, AssetProvider as AssetProviderInterface } from '@aws-amplify/graphql-transformer-interfaces'; + +const TEMP_PREFIX = 'transformer-assets'; +const FUNCTION_PREFIX = 'functions'; +const RESOLVER_PREFIX = 'resolvers'; + +/** + * The asset provider bridges the gap between creation of file assets in the transformer (which provide a name+contents tuple) + * with the path method which is used in CDK. + * The CDK S3 asset require the contents to be written to the file system first. + * The asset provider writes to a temporary directory before creating the CDK S3 asset. + * + */ +export class AssetProvider implements AssetProviderInterface { + private readonly tempAssetDir: string; + public readonly resolverAssets: Record = {}; + + constructor(scope: Construct) { + this.tempAssetDir = cdk.FileSystem.mkdtemp(`${TEMP_PREFIX}-${scope.node.addr}`); + } + + /** + * Creates a new CDK S3 asset. The file contents in assetProps is first stored in a temporary file that is referenced by the CDK S3 asset. + * @param assetScope the parent of the asset + * @param assetId unique ID for CDK S3 asset + * @param assetProps name and contents of file to be added to CDK S3 asset + * @returns the CDK S3 asset + */ + public provide(assetScope: Construct, assetId: string, assetProps: AssetProps): S3Asset { + return new Asset(assetScope, assetId, { path: this.addAsset(assetProps.fileName, assetProps.fileContent) }); + } + + private addAsset(fileName: string, contents: string): string { + this.trackResolverAsset(fileName, contents); + const writableContents = this.isContentsAReference(fileName) ? this.dereferenceContents(contents) : contents; + const filePath = path.join(this.tempAssetDir, fileName); + const fileDirName = path.dirname(filePath); + if (!fs.existsSync(fileDirName)) { + fs.mkdirSync(fileDirName, { recursive: true }); + } + fs.writeFileSync(filePath, writableContents); + return filePath; + } + + private isContentsAReference(fileName: string): boolean { + return fileName.startsWith(FUNCTION_PREFIX); + } + + private dereferenceContents(contents: string): Buffer { + return fs.readFileSync(contents); + } + + private trackResolverAsset(fileName: string, contents: string): void { + if (fileName.startsWith(RESOLVER_PREFIX)) { + const resolverFileName = fileName.split('/')[1]; + this.resolverAssets[resolverFileName] = contents; + } + } +} diff --git a/packages/amplify-graphql-api-construct/src/internal/index.ts b/packages/amplify-graphql-api-construct/src/internal/index.ts index cb13e9b364..d599e94f86 100644 --- a/packages/amplify-graphql-api-construct/src/internal/index.ts +++ b/packages/amplify-graphql-api-construct/src/internal/index.ts @@ -2,6 +2,6 @@ export * from './authorization-modes'; export * from './construct-exports'; export * from './default-parameters'; export * from './conflict-resolution'; -export * from './asset-manager'; +export * from './asset-provider'; export * from './codegen-assets'; export * from './model-type-name'; diff --git a/packages/amplify-graphql-transformer-core/API.md b/packages/amplify-graphql-transformer-core/API.md index 528029eb73..b92562aeef 100644 --- a/packages/amplify-graphql-transformer-core/API.md +++ b/packages/amplify-graphql-transformer-core/API.md @@ -273,7 +273,7 @@ export class GraphQLTransform { // Warning: (ae-forgotten-export) The symbol "GraphQLApi" needs to be exported by the entry point index.d.ts // // (undocumented) - protected generateGraphQlApi(stackManager: StackManagerProvider, synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters): GraphQLApi; + protected generateGraphQlApi(stackManager: StackManagerProvider, assetProvider: AssetProvider, synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters): GraphQLApi; // (undocumented) getLogs(): TransformerLog[]; // (undocumented) diff --git a/packages/amplify-graphql-transformer-core/src/__tests__/transform-host.test.ts b/packages/amplify-graphql-transformer-core/src/__tests__/transform-host.test.ts index a9c1809952..57138ac7d3 100644 --- a/packages/amplify-graphql-transformer-core/src/__tests__/transform-host.test.ts +++ b/packages/amplify-graphql-transformer-core/src/__tests__/transform-host.test.ts @@ -6,7 +6,9 @@ import { InlineTemplate } from '../cdk-compat/template-asset'; describe('addResolver', () => { const app = new App(); const stack = new Stack(app, 'test-root-stack'); - const transformHost = new DefaultTransformHost({ api: new GraphQLApi(stack, 'testId', { name: 'testApiName' }) }); + const transformHost = new DefaultTransformHost({ + api: new GraphQLApi(stack, 'testId', { name: 'testApiName', assetProvider: { provide: jest.fn() } }), + }); it('generates resolver name with hash for non-alphanumeric type names', () => { const cfnResolver = transformHost.addResolver( diff --git a/packages/amplify-graphql-transformer-core/src/__tests__/transformation/transform.test.ts b/packages/amplify-graphql-transformer-core/src/__tests__/transformation/transform.test.ts index 09a6155bb6..89230783cf 100644 --- a/packages/amplify-graphql-transformer-core/src/__tests__/transformation/transform.test.ts +++ b/packages/amplify-graphql-transformer-core/src/__tests__/transformation/transform.test.ts @@ -16,6 +16,7 @@ class TestGraphQLTransform extends GraphQLTransform { testGenerateGraphQlApi(stackManager: StackManager, output: TransformerOutput): GraphQLApi { return this.generateGraphQlApi( stackManager, + { provide: jest.fn() }, { amplifyEnvironmentName: 'NONE', apiName: 'testApi', diff --git a/packages/amplify-graphql-transformer-core/src/appsync-function.ts b/packages/amplify-graphql-transformer-core/src/appsync-function.ts index e993a1f380..b0941fef81 100644 --- a/packages/amplify-graphql-transformer-core/src/appsync-function.ts +++ b/packages/amplify-graphql-transformer-core/src/appsync-function.ts @@ -51,8 +51,8 @@ export class AppSyncFunctionConfiguration extends Construct { constructor(scope: Construct, id: string, props: FunctionConfigurationProps) { super(scope, id); - const requestTemplate = props.requestMappingTemplate.bind(this); - const responseTemplate = props.responseMappingTemplate.bind(this); + const requestTemplate = props.requestMappingTemplate.bind(this, props.api.assetProvider); + const responseTemplate = props.responseMappingTemplate.bind(this, props.api.assetProvider); this.function = new CfnFunctionConfiguration(this, `${id}.AppSyncFunction`, { name: id, apiId: props.api.apiId, diff --git a/packages/amplify-graphql-transformer-core/src/cdk-compat/schema-asset.ts b/packages/amplify-graphql-transformer-core/src/cdk-compat/schema-asset.ts index 499de43583..f6c4282cdf 100644 --- a/packages/amplify-graphql-transformer-core/src/cdk-compat/schema-asset.ts +++ b/packages/amplify-graphql-transformer-core/src/cdk-compat/schema-asset.ts @@ -2,7 +2,6 @@ import { CfnGraphQLSchema } from 'aws-cdk-lib/aws-appsync'; import { Lazy } from 'aws-cdk-lib'; import { S3Asset } from '@aws-amplify/graphql-transformer-interfaces'; import { GraphQLApi } from '../graphql-api'; -import { assetManager } from '../transformer-context/asset-manager'; import { removeAmplifyInputDefinition } from '../transformation/utils'; export class TransformerSchema { @@ -36,7 +35,7 @@ export class TransformerSchema { throw new Error('Schema not bound'); } if (!this.asset) { - this.asset = assetManager.createAsset(this.api, 'schema', { + this.asset = this.api.assetProvider.provide(this.api, 'schema', { fileName: 'schema.graphql', fileContent: removeAmplifyInputDefinition(this.definition), }); diff --git a/packages/amplify-graphql-transformer-core/src/cdk-compat/template-asset.ts b/packages/amplify-graphql-transformer-core/src/cdk-compat/template-asset.ts index cc5a58622d..967d8d40d6 100644 --- a/packages/amplify-graphql-transformer-core/src/cdk-compat/template-asset.ts +++ b/packages/amplify-graphql-transformer-core/src/cdk-compat/template-asset.ts @@ -6,9 +6,9 @@ import { S3Asset, S3MappingFunctionCodeProvider, S3MappingTemplateProvider, + AssetProvider, } from '@aws-amplify/graphql-transformer-interfaces'; import { Construct } from 'constructs'; -import { assetManager } from '../transformer-context/asset-manager'; export class S3MappingFunctionCode implements S3MappingFunctionCodeProvider { public readonly type = MappingTemplateType.S3_LOCATION; @@ -24,9 +24,9 @@ export class S3MappingFunctionCode implements S3MappingFunctionCodeProvider { this.filePath = filePath; } - bind(scope: Construct): S3Asset { + bind(scope: Construct, assetProvider: AssetProvider): S3Asset { if (!this.asset) { - this.asset = assetManager.createAsset(scope, `Code${this.fileName}`, { + this.asset = assetProvider.provide(scope, `Code${this.fileName}`, { fileContent: this.filePath, fileName: this.fileName, }); @@ -54,10 +54,10 @@ export class S3MappingTemplate implements S3MappingTemplateProvider { this.name = name || `mapping-template-${assetHash}.vtl`; } - bind(scope: Construct): string { + bind(scope: Construct, assetProvider: AssetProvider): string { // If the same AssetCode is used multiple times, retain only the first instantiation. if (!this.asset) { - this.asset = assetManager.createAsset(scope, `Template${this.name}`, { + this.asset = assetProvider.provide(scope, `Template${this.name}`, { fileContent: this.content, fileName: this.name, }); diff --git a/packages/amplify-graphql-transformer-core/src/graphql-api.ts b/packages/amplify-graphql-transformer-core/src/graphql-api.ts index bcbd4600e8..d095df3692 100644 --- a/packages/amplify-graphql-transformer-core/src/graphql-api.ts +++ b/packages/amplify-graphql-transformer-core/src/graphql-api.ts @@ -1,4 +1,9 @@ -import { APIIAMResourceProvider, GraphQLAPIProvider, TransformHostProvider } from '@aws-amplify/graphql-transformer-interfaces'; +import { + AssetProvider, + APIIAMResourceProvider, + GraphQLAPIProvider, + TransformHostProvider, +} from '@aws-amplify/graphql-transformer-interfaces'; import { ApiKeyConfig, AuthorizationConfig, @@ -119,6 +124,7 @@ export type TransformerAPIProps = GraphqlApiProps & { readonly sandboxModeEnabled?: boolean; readonly environmentName?: string; readonly disableResolverDeduping?: boolean; + readonly assetProvider: AssetProvider; }; export class GraphQLApi extends GraphqlApiBase implements GraphQLAPIProvider { /** @@ -182,6 +188,11 @@ export class GraphQLApi extends GraphqlApiBase implements GraphQLAPIProvider { */ public readonly environmentName?: string; + /** + * The asset manager to store file assets in a temporary directory. + */ + public readonly assetProvider: AssetProvider; + private schemaResource: CfnGraphQLSchema; private api: CfnGraphQLApi; @@ -221,6 +232,7 @@ export class GraphQLApi extends GraphqlApiBase implements GraphQLAPIProvider { this.graphqlUrl = this.api.attrGraphQlUrl; this.name = this.api.name; this.schema = props.schema ?? new TransformerSchema(); + this.assetProvider = props.assetProvider; this.schemaResource = this.schema.bind(this); const hasApiKey = modes.some((mode) => mode.authorizationType === AuthorizationType.API_KEY); diff --git a/packages/amplify-graphql-transformer-core/src/transform-host.ts b/packages/amplify-graphql-transformer-core/src/transform-host.ts index 27de970d80..806b74e60b 100644 --- a/packages/amplify-graphql-transformer-core/src/transform-host.ts +++ b/packages/amplify-graphql-transformer-core/src/transform-host.ts @@ -158,8 +158,8 @@ export class DefaultTransformHost implements TransformHostProvider { if (!this.api.disableResolverDeduping && this.appsyncFunctions.has(slotHash)) { const appsyncFunction = this.appsyncFunctions.get(slotHash)!; // generating duplicate appsync functions vtl files to help in custom overrides - requestMappingTemplate.bind(appsyncFunction); - responseMappingTemplate.bind(appsyncFunction); + requestMappingTemplate.bind(appsyncFunction, this.api.assetProvider); + responseMappingTemplate.bind(appsyncFunction, this.api.assetProvider); return appsyncFunction; } @@ -187,8 +187,8 @@ export class DefaultTransformHost implements TransformHostProvider { throw new Error(`DataSource ${dataSourceName} is missing in the API`); } - const requestTemplateLocation = requestMappingTemplate.bind(this.api); - const responseTemplateLocation = responseMappingTemplate.bind(this.api); + const requestTemplateLocation = requestMappingTemplate.bind(this.api, this.api.assetProvider); + const responseTemplateLocation = responseMappingTemplate.bind(this.api, this.api.assetProvider); const resolverName = toCamelCase([resourceName(typeName), resourceName(fieldName), 'Resolver']); const resourceId = resolverLogicalId ?? ResolverResourceIDs.ResolverResourceID(typeName, fieldName); @@ -263,7 +263,7 @@ export class DefaultTransformHost implements TransformHostProvider { fn.addLayers(); const cfnFn = fn.node.defaultChild as CfnFunction; setResourceName(fn, { name: functionName, setOnDefaultChild: true }); - const functionCode = new S3MappingFunctionCode(functionKey, filePath).bind(fn); + const functionCode = new S3MappingFunctionCode(functionKey, filePath).bind(fn, this.api.assetProvider); cfnFn.code = { s3Key: functionCode.s3ObjectKey, s3Bucket: functionCode.s3BucketName, diff --git a/packages/amplify-graphql-transformer-core/src/transformation/transform.ts b/packages/amplify-graphql-transformer-core/src/transformation/transform.ts index 97ac783f15..0e4fdd93de 100644 --- a/packages/amplify-graphql-transformer-core/src/transformation/transform.ts +++ b/packages/amplify-graphql-transformer-core/src/transformation/transform.ts @@ -300,7 +300,13 @@ export class GraphQLTransform { // Synth the API and make it available to allow transformer plugins to manipulate the API const output: TransformerOutput = context.output as TransformerOutput; - const api = this.generateGraphQlApi(context.stackManager, context.synthParameters, output, context.transformParameters); + const api = this.generateGraphQlApi( + context.stackManager, + context.assetProvider, + context.synthParameters, + output, + context.transformParameters, + ); // generate resolvers (context as TransformerContext).bind(api); @@ -335,6 +341,7 @@ export class GraphQLTransform { protected generateGraphQlApi( stackManager: StackManagerProvider, + assetProvider: AssetProvider, synthParameters: SynthParameters, output: TransformerOutput, transformParameters: TransformParameters, @@ -357,6 +364,7 @@ export class GraphQLTransform { sandboxModeEnabled: this.transformParameters.sandboxModeEnabled, environmentName: env, disableResolverDeduping: this.transformParameters.disableResolverDeduping, + assetProvider, }); const authModes = [authorizationConfig.defaultAuthorization, ...(authorizationConfig.additionalAuthorizationModes || [])].map( (mode) => mode?.authorizationType, diff --git a/packages/amplify-graphql-transformer-core/src/transformer-context/asset-manager.ts b/packages/amplify-graphql-transformer-core/src/transformer-context/asset-manager.ts deleted file mode 100644 index 0cb1f6ffaa..0000000000 --- a/packages/amplify-graphql-transformer-core/src/transformer-context/asset-manager.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { AssetProvider, S3Asset, AssetProps } from '@aws-amplify/graphql-transformer-interfaces'; -import { Construct } from 'constructs'; - -export class AssetManager { - private assetProvider: AssetProvider | undefined; - - public createAsset(scope: Construct, name: string, props: AssetProps): S3Asset { - return this.getAssetProvider().provide(scope, name, props); - } - - private getAssetProvider(): AssetProvider { - if (!this.assetProvider) { - throw new Error('AssetProvider not initialized'); - } - return this.assetProvider; - } - - public setAssetProvider(provider: AssetProvider): void { - this.assetProvider = provider; - } -} - -export const assetManager = new AssetManager(); diff --git a/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts b/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts index 9c722ab32e..dcc03024e5 100644 --- a/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts +++ b/packages/amplify-graphql-transformer-core/src/transformer-context/index.ts @@ -29,7 +29,6 @@ import { TransformerContextProviderRegistry } from './provider-registry'; import { ResolverManager } from './resolver'; import { TransformerResourceHelper } from './resource-helper'; import { StackManager } from './stack-manager'; -import { assetManager } from './asset-manager'; export { TransformerResolver, NONE_DATA_SOURCE_NAME } from './resolver'; export { StackManager } from './stack-manager'; @@ -79,6 +78,8 @@ export class TransformerContext implements TransformerContextProvider { public readonly stackManager: StackManagerProvider; + public readonly assetProvider: AssetProvider; + public readonly resourceHelper: TransformerResourceHelper; public readonly transformParameters: TransformParameters; @@ -120,7 +121,6 @@ export class TransformerContext implements TransformerContextProvider { synthParameters, transformParameters, } = options; - assetManager.setAssetProvider(assetProvider); this.authConfig = authConfig; this.sqlDirectiveDataSourceStrategies = sqlDirectiveDataSourceStrategies ?? []; this.dataSources = new TransformerDataSourceManager(); @@ -135,6 +135,7 @@ export class TransformerContext implements TransformerContextProvider { this.resolvers = new ResolverManager(); this.resourceHelper = new TransformerResourceHelper(synthParameters); this.stackManager = new StackManager(scope, nestedStackProvider, parameterProvider, stackMapping); + this.assetProvider = assetProvider; this.synthParameters = synthParameters; this.transformParameters = transformParameters; } diff --git a/packages/amplify-graphql-transformer-interfaces/API.md b/packages/amplify-graphql-transformer-interfaces/API.md index 9b1ef1b83a..f1d8cdc6c8 100644 --- a/packages/amplify-graphql-transformer-interfaces/API.md +++ b/packages/amplify-graphql-transformer-interfaces/API.md @@ -141,9 +141,10 @@ export type AssetProps = { }; // @public (undocumented) -export type AssetProvider = { +export interface AssetProvider { + // (undocumented) provide: (scope: Construct, name: string, props: AssetProps) => S3Asset; -}; +} // Warning: (ae-forgotten-export) The symbol "NoneDataSourceProvider" needs to be exported by the entry point index.d.ts // @@ -199,6 +200,8 @@ export interface GraphQLAPIProvider extends IConstruct { // (undocumented) readonly apiId: string; // (undocumented) + readonly assetProvider: AssetProvider; + // (undocumented) grant: (grantee: IGrantable, resources: APIIAMResourceProvider, ...actions: string[]) => Grant; // (undocumented) grantMutation: (grantee: IGrantable, ...fields: string[]) => Grant; @@ -350,7 +353,7 @@ export type S3Asset = { // @public (undocumented) export interface S3MappingFunctionCodeProvider { // (undocumented) - bind: (scope: Construct) => IAsset; + bind: (scope: Construct, assetProvider: AssetProvider) => IAsset; // (undocumented) type: MappingTemplateType.S3_LOCATION; } @@ -358,7 +361,7 @@ export interface S3MappingFunctionCodeProvider { // @public (undocumented) export interface S3MappingTemplateProvider { // (undocumented) - bind: (scope: Construct) => string; + bind: (scope: Construct, assetProvider: AssetProvider) => string; // (undocumented) getTemplateHash: () => string; // (undocumented) @@ -918,7 +921,7 @@ export interface VpcConfig { // Warnings were encountered during analysis: // -// src/graphql-api-provider.ts:35:3 - (ae-forgotten-export) The symbol "OpenIDConnectConfig" needs to be exported by the entry point index.d.ts +// src/graphql-api-provider.ts:36:3 - (ae-forgotten-export) The symbol "OpenIDConnectConfig" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/packages/amplify-graphql-transformer-interfaces/src/asset-provider.ts b/packages/amplify-graphql-transformer-interfaces/src/asset-provider.ts index 919a96dbfd..dd48df110d 100644 --- a/packages/amplify-graphql-transformer-interfaces/src/asset-provider.ts +++ b/packages/amplify-graphql-transformer-interfaces/src/asset-provider.ts @@ -13,6 +13,6 @@ export type S3Asset = { s3ObjectUrl: string; }; -export type AssetProvider = { +export interface AssetProvider { provide: (scope: Construct, name: string, props: AssetProps) => S3Asset; -}; +} diff --git a/packages/amplify-graphql-transformer-interfaces/src/graphql-api-provider.ts b/packages/amplify-graphql-transformer-interfaces/src/graphql-api-provider.ts index 9a5ed61120..f37f47ac5f 100644 --- a/packages/amplify-graphql-transformer-interfaces/src/graphql-api-provider.ts +++ b/packages/amplify-graphql-transformer-interfaces/src/graphql-api-provider.ts @@ -3,6 +3,7 @@ import { Construct, IConstruct } from 'constructs'; import { Grant, IGrantable, IRole } from 'aws-cdk-lib/aws-iam'; // eslint-disable-next-line import/no-cycle import { TransformHostProvider } from './transform-host-provider'; +import { AssetProvider } from './asset-provider'; // Auth Config Modes export type AppSyncAuthMode = 'API_KEY' | 'AMAZON_COGNITO_USER_POOLS' | 'AWS_IAM' | 'OPENID_CONNECT' | 'AWS_LAMBDA'; @@ -113,13 +114,13 @@ export interface InlineMappingTemplateProvider { export interface S3MappingTemplateProvider { type: TemplateType.S3_LOCATION; - bind: (scope: Construct) => string; + bind: (scope: Construct, assetProvider: AssetProvider) => string; getTemplateHash: () => string; } export interface S3MappingFunctionCodeProvider { type: TemplateType.S3_LOCATION; - bind: (scope: Construct) => IAsset; + bind: (scope: Construct, assetProvider: AssetProvider) => IAsset; } export type MappingTemplateProvider = InlineMappingTemplateProvider | S3MappingTemplateProvider; @@ -128,6 +129,7 @@ export interface GraphQLAPIProvider extends IConstruct { readonly apiId: string; readonly host: TransformHostProvider; readonly name: string; + readonly assetProvider: AssetProvider; // getDefaultAuthorization(): Readonly; // getAdditionalAuthorizationModes(): Readonly;