Skip to main content

API Reference

Resources

BucketRef

A reference to an external S3 bucket.

Initializers

bring aws;

new aws.BucketRef(bucketName: str);
NameTypeDescription
bucketNamestrNo description.

bucketNameRequired
  • Type: str

Methods

Inflight Methods
NameDescription
bucketRegionGet the region of the bucket.

bucketRegion
inflight bucketRegion(): str

Get the region of the bucket.

Static Functions

NameDescription
onLiftTypeA hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
toInflightGenerates 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

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

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
bucketArnstrThe ARN of this bucket.
bucketNamestrThe 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);
NameTypeDescription
propsDomainPropsNo description.

propsRequired

Static Functions

NameDescription
onLiftTypeA hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
toInflightGenerates 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

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

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
domainNamestrThe domain name.
acmCertificateArnstrThe AWS Certificate Manager (ACM) certificate arn value.
hostedZoneIdstrThe hosted zone id value.
iamCertificatestrThe 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);
NameTypeDescription
functionArnstrNo description.

functionArnRequired
  • Type: str

Methods

Inflight Methods
NameDescription
invokeInvokes the function with a payload and waits for the result.
invokeAsyncKicks off the execution of the function with a payload and returns immediately while the function is running.

invoke
inflight invoke(payload?: str): str?

Invokes the function with a payload and waits for the result.

payloadOptional
  • Type: str

payload to pass to the function.

If not defined, an empty string will be passed.


invokeAsync
inflight invokeAsync(payload?: str): void

Kicks off the execution of the function with a payload and returns immediately while the function is running.

payloadOptional
  • Type: str

payload to pass to the function.

If not defined, an empty string will be passed.


Static Functions

NameDescription
onLiftTypeA hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
toInflightGenerates 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

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

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
functionArnstrThe 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);
NameTypeDescription
queueArnstrNo description.

queueArnRequired
  • Type: str

Methods

Inflight Methods
NameDescription
queueUrlGet the queue URL.

queueUrl
inflight queueUrl(): str

Get the queue URL.

Static Functions

NameDescription
onLiftTypeA hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
toInflightGenerates 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

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

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
queueArnstrThe 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);
NameTypeDescription
secretArnstrNo description.

secretArnRequired
  • Type: str

Methods

Inflight Methods
NameDescription
valueRetrieve the value of the secret.
valueJsonRetrieve the Json value of the secret.

value
inflight value(options?: GetSecretValueOptions): str

Retrieve the value of the secret.

optionsOptional

valueJson
inflight valueJson(options?: GetSecretValueOptions): Json

Retrieve the Json value of the secret.

optionsOptional

Static Functions

NameDescription
onLiftTypeA hook called by the Wing compiler once for each inflight host that needs to use this type inflight.
toInflightGenerates 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

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

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
secretArnstrThe 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();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Api.


ApiEndpointHandler

A helper class for working with AWS api endpoint handlers.

Initializers

bring aws;

new aws.ApiEndpointHandler();
NameTypeDescription

Static Functions

NameDescription
toFunctionHandlerReturns 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

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

NameDescription
isAwsInflightHostReturns 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();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Bucket.


BucketEventHandler

Utility class to work with bucket event handlers.

Initializers

bring aws;

new aws.BucketEventHandler();
NameTypeDescription

Static Functions

NameDescription
toTopicOnMessageHandlerConverts 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

the handler to convert.


eventTypeRequired

the event type.


Counter

A helper class for working with AWS Counters.

Initializers

bring aws;

new aws.Counter();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Counter.


Function

A helper class for working with AWS functions.

Initializers

bring aws;

new aws.Function();
NameTypeDescription

Static Functions

NameDescription
fromIf the inflight host is an AWS Lambda, return a helper interface for working with it.

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

The inflight host.


Queue

A helper class for working with AWS queues.

Initializers

bring aws;

new aws.Queue();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Queue.


QueueSetConsumerHandler

Utility class for working with the queue consumer handler.

Initializers

bring aws;

new aws.QueueSetConsumerHandler();
NameTypeDescription

Static Functions

NameDescription
toFunctionHandlerConverts 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

The queue consumer handler.


Table

A helper class for working with AWS tables.

Initializers

bring aws;

new aws.Table();
NameTypeDescription

Static Functions

NameDescription
fromIf the table is an AWS DynamoDB, return a helper interface for working with it.

from
bring aws;

aws.Table.from(table: Table);

If the table is an AWS DynamoDB, return a helper interface for working with it.

tableRequired

The ex.Table.


Topic

A helper class for working with AWS topics.

Initializers

bring aws;

new aws.Topic();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Topic.


TopicOnMessageHandler

A helper class for working with AWS topic on message handlers.

Initializers

bring aws;

new aws.TopicOnMessageHandler();
NameTypeDescription

Static Functions

NameDescription
toFunctionHandlerReturns 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

The onMessage handler.


Website

A helper class for working with AWS buckets.

Initializers

bring aws;

new aws.Website();
NameTypeDescription

Static Functions

NameDescription
fromIf 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

The cloud.Bucket.


Structs

AwsWebsiteProps

Options for AWS Website.

Initializer

bring aws;

let AwsWebsiteProps = aws.AwsWebsiteProps{ ... };

Properties

NameTypeDescription
pathstrLocal path to the website's static files, relative to the Wing source file or absolute.
errorDocumentstrName of the error document for the website.
domainDomainThe 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

NameTypeDescription
securityGroupIdsMutArray<str>List of security groups to place function in.
subnetIdsMutArray<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

NameTypeDescription
actionsMutArray<str>Actions.
effectEffectEffect ("Allow" or "Deny").
resourcesMutArray<str>Resources.

actionsOptional
actions: MutArray<str>;
  • Type: MutArray<str>

Actions.


effectOptional
effect: Effect;

Effect ("Allow" or "Deny").


resourcesOptional
resources: MutArray<str>;
  • Type: MutArray<str>

Resources.


Protocols

IAwsApi

A shared interface for AWS api.

Properties

NameTypeDescription
deploymentIdstrRestApi deployment id.
invokeUrlstrInvoke URL.
restApiArnstrRestApi arn.
restApiIdstrRestApi id.
restApiNamestrRestApi id.
stageNamestrRestApi 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

A shared interface for AWS buckets.

Properties

NameTypeDescription
bucketArnstrAWS Bucket arn.
bucketNamestrAWS Bucket name.

bucketArnRequired
bucketArn: str;
  • Type: str

AWS Bucket arn.


bucketNameRequired
bucketName: str;
  • Type: str

AWS Bucket name.


IAwsCounter

A shared interface for AWS Counter.

Properties

NameTypeDescription
dynamoTableArnstrAWS Dynamodb arn.
dynamoTableNamestrAWS Dynamodb name.

dynamoTableArnRequired
dynamoTableArn: str;
  • Type: str

AWS Dynamodb arn.


dynamoTableNameRequired
dynamoTableName: str;
  • Type: str

AWS Dynamodb name.


IAwsFunction

A shared interface for AWS functions.

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.
functionArnstrAWS Function arn.
functionNamestrAWS 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

Represents an IInflightHost on AWS.

Methods

NameDescription
addNetworkAdds the host to the specified network.
addPolicyStatementsAdd policy statements to the function's IAM role.

addNetwork
addNetwork(config: NetworkConfig): void

Adds the host to the specified network.

configRequired

The network configuration.


addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void

Add policy statements to the function's IAM role.

policiesRequired

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
node: Node;
  • Type: constructs.Node

The tree node.


IAwsQueue

A shared interface for AWS queues.

Properties

NameTypeDescription
queueArnstrAWS Queue arn.
queueNamestrAWS Queue name.
queueUrlstrAWS 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.


IAwsTable

A shared interface for AWS tables.

Properties

NameTypeDescription
dynamoTableArnstrAWS Table arn.
dynamoTableNamestrAWS Table name.

dynamoTableArnRequired
dynamoTableArn: str;
  • Type: str

AWS Table arn.


dynamoTableNameRequired
dynamoTableName: str;
  • Type: str

AWS Table name.


IAwsTopic

A shared interface for AWS topics.

Properties

NameTypeDescription
topicArnstrAWS Topic arn.
topicNamestrAWS Topic name.

topicArnRequired
topicArn: str;
  • Type: str

AWS Topic arn.


topicNameRequired
topicName: str;
  • Type: str

AWS Topic name.


IAwsWebsite

A shared interface for AWS website.

Properties

NameTypeDescription
bucketArnstrAWS Bucket arn.
bucketNamestrAWS Bucket name.

bucketArnRequired
bucketArn: str;
  • Type: str

AWS Bucket arn.


bucketNameRequired
bucketName: str;
  • Type: str

AWS Bucket name.


Enums

Effect

The Effect element of an AWS IAM policy statement.

Members

NameDescription
ALLOWAllow.
DENYDeny.

ALLOW

Allow.


DENY

Deny.