API Reference
Resources 
BucketRef 
A reference to an external S3 bucket.
Initializers 
bring aws;
new aws.BucketRef(bucketName: str);
| Name | Type | Description | 
|---|---|---|
 | str | No description. | 
bucketNameRequired 
- Type: str
 
Methods 
Inflight Methods
| Name | Description | 
|---|---|
 | Get the region of the bucket. | 
bucketRegion 
inflight bucketRegion(): str
Get the region of the bucket.
Static Functions 
| Name | Description | 
|---|---|
 | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | 
 | Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource. | 
onLiftType 
bring aws;
aws.BucketRef.onLiftType(host: IInflightHost, ops: MutArray<str>);
A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
The list of requested inflight methods
needed by the inflight host are given by ops.
This method is commonly used for adding permissions, environment variables, or other capabilities to the inflight host.
hostRequired 
- Type: IInflightHost
 
opsRequired 
- Type: MutArray<str>
 
toInflight 
bring aws;
aws.BucketRef.toInflight(obj: IResource);
Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource.
NOTE: This statement must be executed within an async context.
objRequired 
- Type: IResource
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | The ARN of this bucket. | 
 | str | The Name of this bucket. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
bucketArnRequired 
bucketArn: str;
- Type: str
 
The ARN of this bucket.
bucketNameRequired 
bucketName: str;
- Type: str
 
The Name of this bucket.
Domain 
AWS implementation of cloud.Domain.
Initializers 
bring aws;
new aws.Domain(props: DomainProps);
| Name | Type | Description | 
|---|---|---|
 |  | No description. | 
propsRequired 
- Type: DomainProps
 
Static Functions 
| Name | Description | 
|---|---|
 | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | 
 | Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource. | 
onLiftType 
bring aws;
aws.Domain.onLiftType(host: IInflightHost, ops: MutArray<str>);
A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
The list of requested inflight methods
needed by the inflight host are given by ops.
This method is commonly used for adding permissions, environment variables, or other capabilities to the inflight host.
hostRequired 
- Type: IInflightHost
 
opsRequired 
- Type: MutArray<str>
 
toInflight 
bring aws;
aws.Domain.toInflight(obj: IResource);
Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource.
NOTE: This statement must be executed within an async context.
objRequired 
- Type: IResource
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | The domain name. | 
 | str | The AWS Certificate Manager (ACM) certificate arn value. | 
 | str | The hosted zone id value. | 
 | str | The IAM certificate identifier value. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
domainNameRequired 
domainName: str;
- Type: str
 
The domain name.
acmCertificateArnOptional 
acmCertificateArn: str;
- Type: str
 
The AWS Certificate Manager (ACM) certificate arn value.
hostedZoneIdOptional 
hostedZoneId: str;
- Type: str
 
The hosted zone id value.
iamCertificateOptional 
iamCertificate: str;
- Type: str
 
The IAM certificate identifier value.
FunctionRef 
A reference to an external Lambda function.
Initializers 
bring aws;
new aws.FunctionRef(functionArn: str);
| Name | Type | Description | 
|---|---|---|
 | str | No description. | 
functionArnRequired 
- Type: str
 
Methods 
Inflight Methods
| Name | Description | 
|---|---|
 | Invokes the function with a payload and waits for the result. | 
 | Kicks off the execution of the function with a payload and returns immediately while the function is running. | 
invoke 
inflight invoke(payload?: Json): Json?
Invokes the function with a payload and waits for the result.
payloadOptional 
- Type: Json
 
payload to pass to the function.
If not defined, an empty string will be passed.
invokeAsync 
inflight invokeAsync(payload?: Json): void
Kicks off the execution of the function with a payload and returns immediately while the function is running.
payloadOptional 
- Type: Json
 
payload to pass to the function.
If not defined, an empty string will be passed.
Static Functions 
| Name | Description | 
|---|---|
 | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | 
 | Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource. | 
onLiftType 
bring aws;
aws.FunctionRef.onLiftType(host: IInflightHost, ops: MutArray<str>);
A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
The list of requested inflight methods
needed by the inflight host are given by ops.
This method is commonly used for adding permissions, environment variables, or other capabilities to the inflight host.
hostRequired 
- Type: IInflightHost
 
opsRequired 
- Type: MutArray<str>
 
toInflight 
bring aws;
aws.FunctionRef.toInflight(obj: IResource);
Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource.
NOTE: This statement must be executed within an async context.
objRequired 
- Type: IResource
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | The ARN of this function. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
functionArnRequired 
functionArn: str;
- Type: str
 
The ARN of this function.
QueueRef 
A reference to an external SQS queue.
Initializers 
bring aws;
new aws.QueueRef(queueArn: str);
| Name | Type | Description | 
|---|---|---|
 | str | No description. | 
queueArnRequired 
- Type: str
 
Methods 
Inflight Methods
| Name | Description | 
|---|---|
 | Get the queue URL. | 
queueUrl 
inflight queueUrl(): str
Get the queue URL.
Static Functions 
| Name | Description | 
|---|---|
 | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | 
 | Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource. | 
onLiftType 
bring aws;
aws.QueueRef.onLiftType(host: IInflightHost, ops: MutArray<str>);
A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
The list of requested inflight methods
needed by the inflight host are given by ops.
This method is commonly used for adding permissions, environment variables, or other capabilities to the inflight host.
hostRequired 
- Type: IInflightHost
 
opsRequired 
- Type: MutArray<str>
 
toInflight 
bring aws;
aws.QueueRef.toInflight(obj: IResource);
Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource.
NOTE: This statement must be executed within an async context.
objRequired 
- Type: IResource
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | The ARN of this queue. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
queueArnRequired 
queueArn: str;
- Type: str
 
The ARN of this queue.
SecretRef 
A reference to an existing secret.
Initializers 
bring aws;
new aws.SecretRef(secretArn: str);
| Name | Type | Description | 
|---|---|---|
 | str | No description. | 
secretArnRequired 
- Type: str
 
Methods 
Inflight Methods
| Name | Description | 
|---|---|
 | Retrieve the value of the secret. | 
 | Retrieve the Json value of the secret. | 
value 
inflight value(options?: GetSecretValueOptions): str
Retrieve the value of the secret.
optionsOptional 
- Type: GetSecretValueOptions
 
valueJson 
inflight valueJson(options?: GetSecretValueOptions): Json
Retrieve the Json value of the secret.
optionsOptional 
- Type: GetSecretValueOptions
 
Static Functions 
| Name | Description | 
|---|---|
 | A hook called by the Wing compiler once for each inflight host that needs to use this type inflight. | 
 | Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource. | 
onLiftType 
bring aws;
aws.SecretRef.onLiftType(host: IInflightHost, ops: MutArray<str>);
A hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
The list of requested inflight methods
needed by the inflight host are given by ops.
This method is commonly used for adding permissions, environment variables, or other capabilities to the inflight host.
hostRequired 
- Type: IInflightHost
 
opsRequired 
- Type: MutArray<str>
 
toInflight 
bring aws;
aws.SecretRef.toInflight(obj: IResource);
Generates an asynchronous JavaScript statement which can be used to create an inflight client for a resource.
NOTE: This statement must be executed within an async context.
objRequired 
- Type: IResource
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | The ARN of the secret. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
secretArnRequired 
secretArn: str;
- Type: str
 
The ARN of the secret.
Classes 
Api 
A helper class for working with AWS apis.
Initializers 
bring aws;
new aws.Api();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the api is an AWS RestApi, return a helper interface for working with it. | 
from 
bring aws;
aws.Api.from(api: Api);
If the api is an AWS RestApi, return a helper interface for working with it.
apiRequired 
- Type: Api
 
The cloud.Api.
ApiEndpointHandler 
A helper class for working with AWS api endpoint handlers.
Initializers 
bring aws;
new aws.ApiEndpointHandler();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | Returns a cloud.Function handler for handling requests from a cloud.Api. | 
toFunctionHandler 
bring aws;
aws.ApiEndpointHandler.toFunctionHandler(handler: IApiEndpointHandler, headers?: MutMap<str>);
Returns a cloud.Function handler for handling requests from a cloud.Api.
handlerRequired 
- Type: IApiEndpointHandler
 
The onRequest handler.
headersOptional 
- Type: MutMap<str>
 
HTTP response headers to add to all responses (used by CORS).
AwsInflightHost 
Represents an inflight host on AWS.
Static Functions 
| Name | Description | 
|---|---|
 | Returns true if obj implements IAwsInflightHost. | 
isAwsInflightHost 
bring aws;
aws.AwsInflightHost.isAwsInflightHost(obj: any);
Returns true if obj implements IAwsInflightHost.
objRequired 
- Type: any
 
Bucket 
A helper class for working with AWS buckets.
Initializers 
bring aws;
new aws.Bucket();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the bucket is an AWS Bucket, return a helper interface for working with it. | 
from 
bring aws;
aws.Bucket.from(bucket: Bucket);
If the bucket is an AWS Bucket, return a helper interface for working with it.
bucketRequired 
- Type: Bucket
 
The cloud.Bucket.
BucketEventHandler 
Utility class to work with bucket event handlers.
Initializers 
bring aws;
new aws.BucketEventHandler();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | Converts a cloud.IBucketEventHandler to a cloud.ITopicOnMessageHandler. | 
toTopicOnMessageHandler 
bring aws;
aws.BucketEventHandler.toTopicOnMessageHandler(handler: IBucketEventHandler, eventType: BucketEventType);
Converts a cloud.IBucketEventHandler to a cloud.ITopicOnMessageHandler.
handlerRequired 
- Type: IBucketEventHandler
 
the handler to convert.
eventTypeRequired 
- Type: BucketEventType
 
the event type.
Counter 
A helper class for working with AWS Counters.
Initializers 
bring aws;
new aws.Counter();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the table is an AWS Counter, return a helper interface for working with it. | 
from 
bring aws;
aws.Counter.from(counter: Counter);
If the table is an AWS Counter, return a helper interface for working with it.
counterRequired 
- Type: Counter
 
The cloud.Counter.
Function 
A helper class for working with AWS functions.
Initializers 
bring aws;
new aws.Function();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | Returns the current Lambda invocation context, if the host is an AWS Lambda. | 
 | If the inflight host is an AWS Lambda, return a helper interface for working with it. | 
context 
bring aws;
aws.Function.context();
Returns the current Lambda invocation context, if the host is an AWS Lambda.
https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
from 
bring aws;
aws.Function.from(host: IInflightHost);
If the inflight host is an AWS Lambda, return a helper interface for working with it.
hostRequired 
- Type: IInflightHost
 
The inflight host.
Queue 
A helper class for working with AWS queues.
Initializers 
bring aws;
new aws.Queue();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the queue is an AWS SQS, return a helper interface for working with it. | 
from 
bring aws;
aws.Queue.from(queue: Queue);
If the queue is an AWS SQS, return a helper interface for working with it.
queueRequired 
- Type: Queue
 
The cloud.Queue.
QueueSetConsumerHandler 
Utility class for working with the queue consumer handler.
Initializers 
bring aws;
new aws.QueueSetConsumerHandler();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | Converts a queue consumer handler to a function handler. | 
toFunctionHandler 
bring aws;
aws.QueueSetConsumerHandler.toFunctionHandler(handler: IQueueSetConsumerHandler);
Converts a queue consumer handler to a function handler.
handlerRequired 
- Type: IQueueSetConsumerHandler
 
The queue consumer handler.
Topic 
A helper class for working with AWS topics.
Initializers 
bring aws;
new aws.Topic();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the topic is an AWS SNS, return a helper interface for working with it. | 
from 
bring aws;
aws.Topic.from(topic: Topic);
If the topic is an AWS SNS, return a helper interface for working with it.
topicRequired 
- Type: Topic
 
The cloud.Topic.
TopicOnMessageHandler 
A helper class for working with AWS topic on message handlers.
Initializers 
bring aws;
new aws.TopicOnMessageHandler();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | Returns a cloud.Function handler for handling messages from a cloud.Topic. | 
toFunctionHandler 
bring aws;
aws.TopicOnMessageHandler.toFunctionHandler(handler: ITopicOnMessageHandler);
Returns a cloud.Function handler for handling messages from a cloud.Topic.
handlerRequired 
- Type: ITopicOnMessageHandler
 
The onMessage handler.
Website 
A helper class for working with AWS buckets.
Initializers 
bring aws;
new aws.Website();
| Name | Type | Description | 
|---|
Static Functions 
| Name | Description | 
|---|---|
 | If the bucket is an AWS Bucket, return a helper interface for working with it. | 
from 
bring aws;
aws.Website.from(website: Website);
If the bucket is an AWS Bucket, return a helper interface for working with it.
websiteRequired 
- Type: Website
 
The cloud.Bucket.
Structs 
AwsWebsiteProps 
Options for AWS Website.
Initializer 
bring aws;
let AwsWebsiteProps = aws.AwsWebsiteProps{ ... };
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | Local path to the website's static files, relative to the Wing source file or absolute. | 
 | str | Name of the error document for the website. | 
 |  | The website's custom domain object. | 
pathRequired 
path: str;
- Type: str
 
Local path to the website's static files, relative to the Wing source file or absolute.
Example
"./dist"
errorDocumentOptional 
errorDocument: str;
- Type: str
 - Default: undefined
 
Name of the error document for the website.
Example
"404.html"
domainOptional 
domain: Domain;
- Type: Domain
 - Default: undefined
 
The website's custom domain object.
NetworkConfig 
Function network configuration used to hold data on subnets and security groups that should be used when a function is deployed within a VPC.
Initializer 
bring aws;
let NetworkConfig = aws.NetworkConfig{ ... };
Properties 
| Name | Type | Description | 
|---|---|---|
 | MutArray<str> | List of security groups to place function in. | 
 | MutArray<str> | List of subnets to attach on function. | 
securityGroupIdsRequired 
securityGroupIds: MutArray<str>;
- Type: MutArray<str>
 
List of security groups to place function in.
subnetIdsRequired 
subnetIds: MutArray<str>;
- Type: MutArray<str>
 
List of subnets to attach on function.
PolicyStatement 
AWS IAM Policy Statement.
Initializer 
bring aws;
let PolicyStatement = aws.PolicyStatement{ ... };
Properties 
| Name | Type | Description | 
|---|---|---|
 | MutArray<str> | Actions. | 
 |  | Effect ("Allow" or "Deny"). | 
 | MutArray<str> | Resources. | 
actionsOptional 
actions: MutArray<str>;
- Type: MutArray<str>
 
Actions.
effectOptional 
effect: Effect;
- Type: Effect
 
Effect ("Allow" or "Deny").
resourcesOptional 
resources: MutArray<str>;
- Type: MutArray<str>
 
Resources.
Protocols 
IAwsApi 
- Implemented By: IAwsApi
 
A shared interface for AWS api.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | RestApi deployment id. | 
 | str | Invoke URL. | 
 | str | RestApi arn. | 
 | str | RestApi id. | 
 | str | RestApi id. | 
 | str | RestApi stage name. | 
deploymentIdRequired 
deploymentId: str;
- Type: str
 
RestApi deployment id.
invokeUrlRequired 
invokeUrl: str;
- Type: str
 
Invoke URL.
restApiArnRequired 
restApiArn: str;
- Type: str
 
RestApi arn.
restApiIdRequired 
restApiId: str;
- Type: str
 
RestApi id.
restApiNameRequired 
restApiName: str;
- Type: str
 
RestApi id.
stageNameRequired 
stageName: str;
- Type: str
 
RestApi stage name.
IAwsBucket 
- Implemented By: IAwsBucket
 
A shared interface for AWS buckets.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | AWS Bucket arn. | 
 | str | AWS Bucket name. | 
bucketArnRequired 
bucketArn: str;
- Type: str
 
AWS Bucket arn.
bucketNameRequired 
bucketName: str;
- Type: str
 
AWS Bucket name.
IAwsCounter 
- Implemented By: IAwsCounter
 
A shared interface for AWS Counter.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | AWS Dynamodb arn. | 
 | str | AWS Dynamodb name. | 
dynamoTableArnRequired 
dynamoTableArn: str;
- Type: str
 
AWS Dynamodb arn.
dynamoTableNameRequired 
dynamoTableName: str;
- Type: str
 
AWS Dynamodb name.
IAwsFunction 
- 
Extends: IAwsInflightHost
 - 
Implemented By: IAwsFunction
 
A shared interface for AWS functions.
Methods 
| Name | Description | 
|---|---|
 | Add a Lambda layer to the function. | 
addLambdaLayer 
addLambdaLayer(layerArn: str): void
Add a Lambda layer to the function.
layerArnRequired 
- Type: str
 
The ARN of the layer.
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
 | str | AWS Function arn. | 
 | str | AWS Function name. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
functionArnRequired 
functionArn: str;
- Type: str
 
AWS Function arn.
functionNameRequired 
functionName: str;
- Type: str
 
AWS Function name.
IAwsInflightHost 
- 
Extends: IInflightHost
 - 
Implemented By: IAwsFunction, IAwsInflightHost
 
Represents an IInflightHost on AWS.
Methods 
| Name | Description | 
|---|---|
 | Adds the host to the specified network. | 
 | Add policy statements to the function's IAM role. | 
addNetwork 
addNetwork(config: NetworkConfig): void
Adds the host to the specified network.
configRequired 
- Type: NetworkConfig
 
The network configuration.
addPolicyStatements 
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policiesRequired 
- Type: PolicyStatement
 
Properties 
| Name | Type | Description | 
|---|---|---|
 | constructs.Node | The tree node. | 
nodeRequired 
node: Node;
- Type: constructs.Node
 
The tree node.
IAwsQueue 
- Implemented By: IAwsQueue
 
A shared interface for AWS queues.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | AWS Queue arn. | 
 | str | AWS Queue name. | 
 | str | AWS Queue url. | 
queueArnRequired 
queueArn: str;
- Type: str
 
AWS Queue arn.
queueNameRequired 
queueName: str;
- Type: str
 
AWS Queue name.
queueUrlRequired 
queueUrl: str;
- Type: str
 
AWS Queue url.
IAwsTopic 
- Implemented By: IAwsTopic
 
A shared interface for AWS topics.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | AWS Topic arn. | 
 | str | AWS Topic name. | 
topicArnRequired 
topicArn: str;
- Type: str
 
AWS Topic arn.
topicNameRequired 
topicName: str;
- Type: str
 
AWS Topic name.
IAwsWebsite 
- Implemented By: IAwsWebsite
 
A shared interface for AWS website.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | AWS Bucket arn. | 
 | str | AWS Bucket name. | 
bucketArnRequired 
bucketArn: str;
- Type: str
 
AWS Bucket arn.
bucketNameRequired 
bucketName: str;
- Type: str
 
AWS Bucket name.
ILambdaContext 
- Implemented By: ILambdaContext
 
The AWS Lambda context object.
Methods 
| Name | Description | 
|---|---|
 | Returns the number of milliseconds left before the execution times out. | 
remainingTimeInMillis 
remainingTimeInMillis(): num
Returns the number of milliseconds left before the execution times out.
Properties 
| Name | Type | Description | 
|---|---|---|
 | str | The identifier of the invocation request. | 
 | str | The name of the Lambda function. | 
 | str | The version of the function. | 
 | str | The Amazon Resource Name (ARN) that's used to invoke the function. | 
 | str | The log group for the function. | 
 | str | The log stream for the function instance. | 
 | str | The amount of memory that's allocated for the function. | 
awsRequestIdRequired 
awsRequestId: str;
- Type: str
 
The identifier of the invocation request.
functionNameRequired 
functionName: str;
- Type: str
 
The name of the Lambda function.
functionVersionRequired 
functionVersion: str;
- Type: str
 
The version of the function.
invokedFunctionArnRequired 
invokedFunctionArn: str;
- Type: str
 
The Amazon Resource Name (ARN) that's used to invoke the function.
Indicates if the invoker specified a version number or alias.
logGroupNameRequired 
logGroupName: str;
- Type: str
 
The log group for the function.
logStreamNameRequired 
logStreamName: str;
- Type: str
 
The log stream for the function instance.
memoryLimitInMBRequired 
memoryLimitInMB: str;
- Type: str
 
The amount of memory that's allocated for the function.
Enums 
Effect 
The Effect element of an AWS IAM policy statement.
Members 
| Name | Description | 
|---|---|
 | Allow. | 
 | Deny. | 
ALLOW 
Allow.
DENY 
Deny.