# API Reference ## Constructs ### AmplifyExportedBackend * Used to include the backend generated by running `amplify export --out ` into the cdk app. > #### Initializers ```typescript import { AmplifyExportedBackend } from '@aws-amplify/cdk-exported-backend' new AmplifyExportedBackend(scope: Construct, id: string, props: AmplifyExportedBackendProps) ``` ##### `scope`Required - *Type:* [`constructs.Construct`](#constructs.Construct) The parent construct of this template. --- ##### `id`Required - *Type:* `string` The ID of this construct. --- ##### `props`Required - *Type:* [`@aws-amplify/cdk-exported-backend.AmplifyExportedBackendProps`](#@aws-amplify/cdk-exported-backend.AmplifyExportedBackendProps) Initialization properties. --- #### Methods ##### `apiRestNestedStack` ```typescript public apiRestNestedStack(resourceName: string) ``` ###### `resourceName`Required - *Type:* `string` --- ##### `authNestedStack` ```typescript public authNestedStack() ``` ##### `graphqlNestedStacks` ```typescript public graphqlNestedStacks() ``` ##### `lambdaFunctionNestedStackByName` ```typescript public lambdaFunctionNestedStackByName(functionName: string) ``` ###### `functionName`Required - *Type:* `string` the function name to get from the nested stack. --- ##### `lambdaFunctionNestedStacks` ```typescript public lambdaFunctionNestedStacks() ``` ##### `nestedStackByCategortService` ```typescript public nestedStackByCategortService(category: string, service: string) ``` ###### `category`Required - *Type:* `string` --- ###### `service`Required - *Type:* `string` --- ##### `nestedStacksByCategory` ```typescript public nestedStacksByCategory(category: string, resourceName?: string) ``` ###### `category`Required - *Type:* `string` Categories defined in Amplify CLI like function, api, auth etc. --- ###### `resourceName`Optional - *Type:* `string` --- #### Properties ##### `cfnInclude`Required ```typescript public readonly cfnInclude: CfnInclude; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnInclude`](#aws-cdk-lib.cloudformation_include.CfnInclude) cfnInclude of the Amplify backend. --- ##### `rootStack`Required ```typescript public readonly rootStack: Stack; ``` - *Type:* [`aws-cdk-lib.Stack`](#aws-cdk-lib.Stack) The root stack created. --- ## Structs ### AmplifyExportedBackendProps #### Initializer ```typescript import { AmplifyExportedBackendProps } from '@aws-amplify/cdk-exported-backend' const amplifyExportedBackendProps: AmplifyExportedBackendProps = { ... } ``` ##### `analyticsReporting`Optional ```typescript public readonly analyticsReporting: boolean; ``` - *Type:* `boolean` - *Default:* `analyticsReporting` setting of containing `App`, or value of 'aws:cdk:version-reporting' context key Include runtime versioning information in this Stack. --- ##### `crossRegionReferences`Optional ```typescript public readonly crossRegionReferences: boolean; ``` - *Type:* `boolean` - *Default:* false Enable this flag to allow native cross region stack references. Enabling this will create a CloudFormation custom resource in both the producing stack and consuming stack in order to perform the export/import This feature is currently experimental --- ##### `description`Optional ```typescript public readonly description: string; ``` - *Type:* `string` - *Default:* No description. A description of the stack. --- ##### `env`Optional ```typescript public readonly env: Environment; ``` - *Type:* [`aws-cdk-lib.Environment`](#aws-cdk-lib.Environment) - *Default:* The environment of the containing `Stage` if available, otherwise create the stack will be environment-agnostic. The AWS environment (account/region) where this stack will be deployed. Set the `region`/`account` fields of `env` to either a concrete value to select the indicated environment (recommended for production stacks), or to the values of environment variables `CDK_DEFAULT_REGION`/`CDK_DEFAULT_ACCOUNT` to let the target environment depend on the AWS credentials/configuration that the CDK CLI is executed under (recommended for development stacks). If the `Stack` is instantiated inside a `Stage`, any undefined `region`/`account` fields from `env` will default to the same field on the encompassing `Stage`, if configured there. If either `region` or `account` are not set nor inherited from `Stage`, the Stack will be considered "*environment-agnostic*"". Environment-agnostic stacks can be deployed to any environment but may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups such as `ec2.Vpc.fromLookup` and will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements. --- ##### `permissionsBoundary`Optional ```typescript public readonly permissionsBoundary: PermissionsBoundary; ``` - *Type:* [`aws-cdk-lib.PermissionsBoundary`](#aws-cdk-lib.PermissionsBoundary) - *Default:* no permissions boundary is applied Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. --- ##### `stackName`Optional ```typescript public readonly stackName: string; ``` - *Type:* `string` - *Default:* Derived from construct path. Name to deploy the stack with. --- ##### `synthesizer`Optional ```typescript public readonly synthesizer: IStackSynthesizer; ``` - *Type:* [`aws-cdk-lib.IStackSynthesizer`](#aws-cdk-lib.IStackSynthesizer) - *Default:* The synthesizer specified on `App`, or `DefaultStackSynthesizer` otherwise. Synthesis method to use while deploying this stack. The Stack Synthesizer controls aspects of synthesis and deployment, like how assets are referenced and what IAM roles to use. For more information, see the README of the main CDK package. If not specified, the `defaultStackSynthesizer` from `App` will be used. If that is not specified, `DefaultStackSynthesizer` is used if `@aws-cdk/core:newStyleStackSynthesis` is set to `true` or the CDK major version is v2. In CDK v1 `LegacyStackSynthesizer` is the default if no other synthesizer is specified. --- ##### `tags`Optional ```typescript public readonly tags: {[ key: string ]: string}; ``` - *Type:* {[ key: string ]: `string`} - *Default:* {} Stack tags that will be applied to all the taggable resources and the stack itself. --- ##### `terminationProtection`Optional ```typescript public readonly terminationProtection: boolean; ``` - *Type:* `boolean` - *Default:* false Whether to enable termination protection for this stack. --- ##### `amplifyEnvironment`Required ```typescript public readonly amplifyEnvironment: string; ``` - *Type:* `string` - *Default:* is 'dev' The Amplify CLI environment deploy to The amplify backend requires a stage to deploy. --- ##### `path`Required ```typescript public readonly path: string; ``` - *Type:* `string` The path to the exported folder that contains the artifacts for the Amplify CLI backend ex: ./amplify-synth-out/. --- ### CategoryStackMapping #### Initializer ```typescript import { CategoryStackMapping } from '@aws-amplify/cdk-exported-backend' const categoryStackMapping: CategoryStackMapping = { ... } ``` ##### `category`Required ```typescript public readonly category: string; ``` - *Type:* `string` --- ##### `resourceName`Required ```typescript public readonly resourceName: string; ``` - *Type:* `string` --- ##### `service`Required ```typescript public readonly service: string; ``` - *Type:* `string` --- ### ExportManifest #### Initializer ```typescript import { ExportManifest } from '@aws-amplify/cdk-exported-backend' const exportManifest: ExportManifest = { ... } ``` ##### `props`Required ```typescript public readonly props: CfnIncludeProps; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnIncludeProps`](#aws-cdk-lib.cloudformation_include.CfnIncludeProps) --- ##### `stackName`Required ```typescript public readonly stackName: string; ``` - *Type:* `string` --- ### ExportTag #### Initializer ```typescript import { ExportTag } from '@aws-amplify/cdk-exported-backend' const exportTag: ExportTag = { ... } ``` ##### `key`Required ```typescript public readonly key: string; ``` - *Type:* `string` --- ##### `value`Required ```typescript public readonly value: string; ``` - *Type:* `string` --- ### ProviderCredential #### Initializer ```typescript import { ProviderCredential } from '@aws-amplify/cdk-exported-backend' const providerCredential: ProviderCredential = { ... } ``` ##### `clientId`Required ```typescript public readonly clientId: string; ``` - *Type:* `string` --- ##### `clientSecret`Required ```typescript public readonly clientSecret: string; ``` - *Type:* `string` --- ##### `providerName`Required ```typescript public readonly providerName: string; ``` - *Type:* `string` --- ## Classes ### APIGraphQLIncludedNestedStack #### Initializers ```typescript import { APIGraphQLIncludedNestedStack } from '@aws-amplify/cdk-exported-backend' new APIGraphQLIncludedNestedStack(includedStack: IncludedNestedStack) ``` ##### `includedStack`Required - *Type:* [`aws-cdk-lib.cloudformation_include.IncludedNestedStack`](#aws-cdk-lib.cloudformation_include.IncludedNestedStack) --- #### Methods ##### `appSyncAPIKey` ```typescript public appSyncAPIKey() ``` ##### `getResourceConstruct` ```typescript public getResourceConstruct(logicalId: string) ``` ###### `logicalId`Required - *Type:* `string` --- ##### `graphQLAPI` ```typescript public graphQLAPI() ``` ##### `graphQLSchema` ```typescript public graphQLSchema() ``` ##### `modelNestedStack` ```typescript public modelNestedStack(tableName: string) ``` ###### `tableName`Required - *Type:* `string` is the model name in your Graph QL API. --- #### Properties ##### `includedTemplate`Required ```typescript public readonly includedTemplate: CfnInclude; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnInclude`](#aws-cdk-lib.cloudformation_include.CfnInclude) --- ##### `stack`Required ```typescript public readonly stack: NestedStack; ``` - *Type:* [`aws-cdk-lib.NestedStack`](#aws-cdk-lib.NestedStack) --- ### APIRestIncludedStack #### Initializers ```typescript import { APIRestIncludedStack } from '@aws-amplify/cdk-exported-backend' new APIRestIncludedStack(includedStack: IncludedNestedStack, resourceName: string) ``` ##### `includedStack`Required - *Type:* [`aws-cdk-lib.cloudformation_include.IncludedNestedStack`](#aws-cdk-lib.cloudformation_include.IncludedNestedStack) --- ##### `resourceName`Required - *Type:* `string` --- #### Methods ##### `apiDeployment` ```typescript public apiDeployment() ``` ##### `getResourceConstruct` ```typescript public getResourceConstruct(logicalId: string) ``` ###### `logicalId`Required - *Type:* `string` --- ##### `restAPI` ```typescript public restAPI() ``` #### Properties ##### `includedTemplate`Required ```typescript public readonly includedTemplate: CfnInclude; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnInclude`](#aws-cdk-lib.cloudformation_include.CfnInclude) --- ##### `resourceName`Required ```typescript public readonly resourceName: string; ``` - *Type:* `string` --- ##### `stack`Required ```typescript public readonly stack: NestedStack; ``` - *Type:* [`aws-cdk-lib.NestedStack`](#aws-cdk-lib.NestedStack) --- ### AuthIncludedNestedStack #### Initializers ```typescript import { AuthIncludedNestedStack } from '@aws-amplify/cdk-exported-backend' new AuthIncludedNestedStack(includedStack: IncludedNestedStack) ``` ##### `includedStack`Required - *Type:* [`aws-cdk-lib.cloudformation_include.IncludedNestedStack`](#aws-cdk-lib.cloudformation_include.IncludedNestedStack) --- #### Methods ##### `getResourceConstruct` ```typescript public getResourceConstruct(logicalId: string) ``` ###### `logicalId`Required - *Type:* `string` --- ##### `hostedUiProviderCredentials` ```typescript public hostedUiProviderCredentials(credentials: ProviderCredential[]) ``` ###### `credentials`Required - *Type:* [`@aws-amplify/cdk-exported-backend.ProviderCredential`](#@aws-amplify/cdk-exported-backend.ProviderCredential)[] --- ##### `identityPool` ```typescript public identityPool() ``` ##### `userPool` ```typescript public userPool() ``` #### Properties ##### `includedTemplate`Required ```typescript public readonly includedTemplate: CfnInclude; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnInclude`](#aws-cdk-lib.cloudformation_include.CfnInclude) --- ##### `stack`Required ```typescript public readonly stack: NestedStack; ``` - *Type:* [`aws-cdk-lib.NestedStack`](#aws-cdk-lib.NestedStack) --- ### LambdaFunctionIncludedNestedStack #### Initializers ```typescript import { LambdaFunctionIncludedNestedStack } from '@aws-amplify/cdk-exported-backend' new LambdaFunctionIncludedNestedStack(includedStack: IncludedNestedStack) ``` ##### `includedStack`Required - *Type:* [`aws-cdk-lib.cloudformation_include.IncludedNestedStack`](#aws-cdk-lib.cloudformation_include.IncludedNestedStack) --- #### Methods ##### `getResourceConstruct` ```typescript public getResourceConstruct(logicalId: string) ``` ###### `logicalId`Required - *Type:* `string` --- ##### `lambdaFunction` ```typescript public lambdaFunction() ``` #### Properties ##### `includedTemplate`Required ```typescript public readonly includedTemplate: CfnInclude; ``` - *Type:* [`aws-cdk-lib.cloudformation_include.CfnInclude`](#aws-cdk-lib.cloudformation_include.CfnInclude) --- ##### `stack`Required ```typescript public readonly stack: NestedStack; ``` - *Type:* [`aws-cdk-lib.NestedStack`](#aws-cdk-lib.NestedStack) ---