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. |
bucketName
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | The ARN of this bucket. |
| str | The domain name of this bucket. |
| str | The Name of this bucket. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
bucketArn
Required
bucketArn: str;
- Type: str
The ARN of this bucket.
bucketDomainName
Required
bucketDomainName: str;
- Type: str
The domain name of this bucket.
bucketName
Required
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. |
props
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
domainName
Required
domainName: str;
- Type: str
The domain name.
acmCertificateArn
Optional
acmCertificateArn: str;
- Type: str
The AWS Certificate Manager (ACM) certificate arn value.
hostedZoneId
Optional
hostedZoneId: str;
- Type: str
The hosted zone id value.
iamCertificate
Optional
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. |
functionArn
Required
- 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.
payload
Optional
- 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.
payload
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | The ARN of this function. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
functionArn
Required
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. |
queueArn
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | The ARN of this queue. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
queueArn
Required
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. |
secretArn
Required
- 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.
options
Optional
- Type: GetSecretValueOptions
valueJson
inflight valueJson(options?: GetSecretValueOptions): Json
Retrieve the Json value of the secret.
options
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | The ARN of the secret. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
secretArn
Required
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.
api
Required
- 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
.
handler
Required
- Type: IApiEndpointHandler
The onRequest
handler.
headers
Optional
- 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
.
obj
Required
- 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.
bucket
Required
- 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
.
handler
Required
- Type: IBucketEventHandler
the handler to convert.
eventType
Required
- 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.
counter
Required
- 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.
host
Required
- 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.
queue
Required
- 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.
handler
Required
- 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.
topic
Required
- 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
.
handler
Required
- 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.
website
Required
- 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. |
path
Required
path: str;
- Type: str
Local path to the website's static files, relative to the Wing source file or absolute.
Example
"./dist"
errorDocument
Optional
errorDocument: str;
- Type: str
- Default: undefined
Name of the error document for the website.
Example
"404.html"
domain
Optional
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. |
securityGroupIds
Required
securityGroupIds: MutArray<str>;
- Type: MutArray<str>
List of security groups to place function in.
subnetIds
Required
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. |
actions
Optional
actions: MutArray<str>;
- Type: MutArray<str>
Actions.
effect
Optional
effect: Effect;
- Type: Effect
Effect ("Allow" or "Deny").
resources
Optional
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. |
deploymentId
Required
deploymentId: str;
- Type: str
RestApi deployment id.
invokeUrl
Required
invokeUrl: str;
- Type: str
Invoke URL.
restApiArn
Required
restApiArn: str;
- Type: str
RestApi arn.
restApiId
Required
restApiId: str;
- Type: str
RestApi id.
restApiName
Required
restApiName: str;
- Type: str
RestApi id.
stageName
Required
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 | Bucket domain name. |
| str | AWS Bucket name. |
bucketArn
Required
bucketArn: str;
- Type: str
AWS Bucket arn.