@aws-amplify/graphql-api-construct
Version:
AppSync GraphQL Api Construct using Amplify GraphQL Transformer.
27 lines (26 loc) • 1.29 kB
TypeScript
import { Construct } from 'constructs';
import { AssetProps, S3Asset, AssetProvider as AssetProviderInterface } from '@aws-amplify/graphql-transformer-interfaces';
/**
* 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 declare class AssetProvider implements AssetProviderInterface {
private readonly tempAssetDir;
readonly resolverAssets: Record<string, string>;
constructor(scope: Construct);
/**
* 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
*/
provide(assetScope: Construct, assetId: string, assetProps: AssetProps): S3Asset;
private addAsset;
private isContentsAReference;
private dereferenceContents;
private trackResolverAsset;
}