aws-cdk-lib.aws_appsync.AssetCode

class AssetCode

LanguageType name
.NETAmazon.CDK.AWS.AppSync.AssetCode
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappsync#AssetCode
Javasoftware.amazon.awscdk.services.appsync.AssetCode
Pythonaws_cdk.aws_appsync.AssetCode
TypeScript (source)aws-cdk-lib » aws_appsync » AssetCode

Extends Code

Represents a local file with source code used for an AppSync Function or Resolver.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_appsync as appsync } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const dockerImage: cdk.DockerImage;
declare const grantable: iam.IGrantable;
declare const localBundling: cdk.ILocalBundling;
const assetCode = new appsync.AssetCode('path', /* all optional props */ {
  assetHash: 'assetHash',
  assetHashType: cdk.AssetHashType.SOURCE,
  bundling: {
    image: dockerImage,

    // the properties below are optional
    bundlingFileAccess: cdk.BundlingFileAccess.VOLUME_COPY,
    command: ['command'],
    entrypoint: ['entrypoint'],
    environment: {
      environmentKey: 'environment',
    },
    local: localBundling,
    network: 'network',
    outputType: cdk.BundlingOutput.ARCHIVED,
    securityOpt: 'securityOpt',
    user: 'user',
    volumes: [{
      containerPath: 'containerPath',
      hostPath: 'hostPath',

      // the properties below are optional
      consistency: cdk.DockerVolumeConsistency.CONSISTENT,
    }],
    volumesFrom: ['volumesFrom'],
    workingDirectory: 'workingDirectory',
  },
  deployTime: false,
  exclude: ['exclude'],
  followSymlinks: cdk.SymlinkFollowMode.NEVER,
  ignoreMode: cdk.IgnoreMode.GLOB,
  readers: [grantable],
});

Initializer

new AssetCode(path: string, options?: AssetOptions)

Parameters

  • path string — The path to the asset file.
  • options AssetOptions

Properties

NameTypeDescription
pathstringThe path to the asset file.

path

Type: string

The path to the asset file.

Methods

NameDescription
bind(scope)Bind source code to an AppSync Function or resolver.

bind(scope)

public bind(scope: Construct): CodeConfig

Parameters

  • scope Construct

Returns

  • CodeConfig

Bind source code to an AppSync Function or resolver.