API Reference
Resources
Api
- Implements: IAwsApi
Base class for AWS API.
Initializers
bring aws;
new aws.Api(props?: ApiProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: ApiProps
Methods
| Name | Description |
|---|---|
| Add a inflight handler to the api for CONNECT requests on the given path. |
| Add a inflight handler to the api for DELETE requests on the given path. |
| Add a inflight handler to the api for GET requests on the given path. |
| Add a inflight handler to the api for HEAD requests on the given path. |
| Add a inflight handler to the api for OPTIONS requests on the given path. |
| Add a inflight handler to the api for PATCH requests on the given path. |
| Add a inflight handler to the api for POST requests on the given path. |
| Add a inflight handler to the api for PUT requests on the given path. |
connect
connect(path: str, inflight: IApiEndpointHandler, props?: ApiConnectOptions): void
Add a inflight handler to the api for CONNECT requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiConnectOptions
delete
delete(path: str, inflight: IApiEndpointHandler, props?: ApiDeleteOptions): void
Add a inflight handler to the api for DELETE requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiDeleteOptions
get
get(path: str, inflight: IApiEndpointHandler, props?: ApiGetOptions): void
Add a inflight handler to the api for GET requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiGetOptions
head
head(path: str, inflight: IApiEndpointHandler, props?: ApiHeadOptions): void
Add a inflight handler to the api for HEAD requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiHeadOptions
options
options(path: str, inflight: IApiEndpointHandler, props?: ApiOptionsOptions): void
Add a inflight handler to the api for OPTIONS requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiOptionsOptions
patch
patch(path: str, inflight: IApiEndpointHandler, props?: ApiPatchOptions): void
Add a inflight handler to the api for PATCH requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiPatchOptions
post
post(path: str, inflight: IApiEndpointHandler, props?: ApiPostOptions): void
Add a inflight handler to the api for POST requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiPostOptions
put
put(path: str, inflight: IApiEndpointHandler, props?: ApiPutOptions): void
Add a inflight handler to the api for PUT requests on the given path.
pathRequired
- Type: str
inflightRequired
- Type: IApiEndpointHandler
propsOptional
- Type: ApiPutOptions
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. |
| Generates an object containing default CORS response headers and OPTIONS response headers. |
| Converts input path to a valid OpenAPI path (replaces : based path params with {}). |
| If the api is an AWS RestApi, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Api.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.Api.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
renderCorsHeaders
bring aws;
aws.Api.renderCorsHeaders(corsOptions?: ApiCorsOptions);
Generates an object containing default CORS response headers and OPTIONS response headers.
corsOptionsOptional
- Type: ApiCorsOptions
The CORS options to generate the headers from.
renderOpenApiPath
bring aws;
aws.Api.renderOpenApiPath(path: str);
Converts input path to a valid OpenAPI path (replaces : based path params with {}).
pathRequired
- Type: str
The path to convert (assumes path is valid).
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | The base URL of the API endpoint. |
| str | RestApi deployment id. |
| str | Invoke URL. |
| str | RestApi arn. |
| str | RestApi id. |
| str | RestApi id. |
| str | RestApi stage name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
urlRequired
url: str;
- Type: str
The base URL of the API endpoint.
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.
Bucket
- Implements: IAwsBucket
Base class for AWS Buckets.
Initializers
bring aws;
new aws.Bucket(props?: BucketProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: BucketProps
Methods
| Name | Description |
|---|---|
| Add cors configuration to the bucket. |
| Add a file to the bucket from system folder. |
| Add a file to the bucket that is uploaded when the app is deployed. |
| Run an inflight whenever a file is uploaded to the bucket. |
| Run an inflight whenever a file is deleted from the bucket. |
| Run an inflight whenever a file is uploaded, modified, or deleted from the bucket. |
| Run an inflight whenever a file is updated in the bucket. |
addCorsRule
addCorsRule(value: BucketCorsOptions): void
Add cors configuration to the bucket.
valueRequired
- Type: BucketCorsOptions
addFile
addFile(key: str, path: str, encoding?: str): void
Add a file to the bucket from system folder.
keyRequired
- Type: str
The key or name to associate with the file.
pathRequired
- Type: str
The path to the file on the local system.
encodingOptional
- Type: str
The encoding to use when reading the file.
Defaults to "utf-8".
addObject
addObject(path: str, content: str): void
Add a file to the bucket that is uploaded when the app is deployed.
TODO: In the future this will support uploading any Blob type or
referencing a file from the local filesystem.
pathRequired
- Type: str
contentRequired
- Type: str
onCreate
onCreate(fn: IBucketEventHandler, opts?: BucketOnCreateOptions): void
Run an inflight whenever a file is uploaded to the bucket.
fnRequired
- Type: IBucketEventHandler
optsOptional
- Type: BucketOnCreateOptions
onDelete
onDelete(fn: IBucketEventHandler, opts?: BucketOnDeleteOptions): void
Run an inflight whenever a file is deleted from the bucket.
fnRequired
- Type: IBucketEventHandler
optsOptional
- Type: BucketOnDeleteOptions
onEvent
onEvent(fn: IBucketEventHandler, opts?: BucketOnEventOptions): void
Run an inflight whenever a file is uploaded, modified, or deleted from the bucket.
fnRequired
- Type: IBucketEventHandler
optsOptional
- Type: BucketOnEventOptions
onUpdate
onUpdate(fn: IBucketEventHandler, opts?: BucketOnUpdateOptions): void
Run an inflight whenever a file is updated in the bucket.
fnRequired
- Type: IBucketEventHandler
optsOptional
- Type: BucketOnUpdateOptions
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. |
| If the bucket is an AWS Bucket, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Bucket.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.Bucket.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | AWS Bucket arn. |
| str | Bucket domain name. |
| str | AWS Bucket name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
bucketArnRequired
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketDomainNameRequired
bucketDomainName: str;
- Type: str
Bucket domain name.
bucketNameRequired
bucketName: str;
- Type: str
AWS Bucket name.
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 domain name 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.
bucketDomainNameRequired
bucketDomainName: str;
- Type: str
The domain name of this bucket.
bucketNameRequired
bucketName: str;
- Type: str
The Name of this bucket.
Counter
- Implements: IAwsCounter
Base class for AWS Counters.
Initializers
bring aws;
new aws.Counter(props?: CounterProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: CounterProps
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. |
| If the table is an AWS Counter, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Counter.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.Counter.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| num | The initial value of the counter. |
| str | AWS Dynamodb arn. |
| str | AWS Dynamodb name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
initialRequired
initial: num;
- Type: num
The initial value of the counter.
dynamoTableArnRequired
dynamoTableArn: str;
- Type: str
AWS Dynamodb arn.
dynamoTableNameRequired
dynamoTableName: str;
- Type: str
AWS Dynamodb name.
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.
Function
- Implements: IAwsFunction
Base class for AWS Functions.
Initializers
bring aws;
new aws.Function(handler: IFunctionHandler, props?: FunctionProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
| | No description. |
handlerRequired
- Type: IFunctionHandler
propsOptional
- Type: FunctionProps
Methods
| Name | Description |
|---|---|
| Add an environment variable to the function. |
| Add a Lambda layer to the function. |
| Adds the host to the specified network. |
| Add policy statements to the function's IAM role. |
addEnvironment
addEnvironment(name: str, value: str): void
Add an environment variable to the function.
nameRequired
- Type: str
valueRequired
- Type: str
addLambdaLayer
addLambdaLayer(layerArn: str): void
Add a Lambda layer to the function.
layerArnRequired
- Type: str
addNetwork
addNetwork(config: NetworkConfig): void
Adds the host to the specified network.
configRequired
- Type: NetworkConfig
addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policiesRequired
- Type: PolicyStatement
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. |
| 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. |
onLiftType
bring aws;
aws.Function.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.Function.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| MutMap<str> | Returns the set of environment variables for this function. |
| str | AWS Function arn. |
| str | AWS Function name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
envRequired
env: MutMap<str>;
- Type: MutMap<str>
Returns the set of environment variables for this function.
functionArnRequired
functionArn: str;
- Type: str
AWS Function arn.
functionNameRequired
functionName: str;
- Type: str
AWS Function name.
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.
Queue
- Implements: IAwsQueue
Base class for AWS Queues.
Initializers
bring aws;
new aws.Queue(props?: QueueProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: QueueProps
Methods
| Name | Description |
|---|---|
| Create a function to consume messages from this queue. |
setConsumer
setConsumer(handler: IQueueSetConsumerHandler, props?: QueueSetConsumerOptions): Function
Create a function to consume messages from this queue.
handlerRequired
- Type: IQueueSetConsumerHandler
propsOptional
- Type: QueueSetConsumerOptions
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. |
| If the queue is an AWS SQS, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Queue.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.Queue.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | AWS Queue arn. |
| str | AWS Queue name. |
| str | AWS Queue url. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
queueArnRequired
queueArn: str;
- Type: str
AWS Queue arn.
queueNameRequired
queueName: str;
- Type: str
AWS Queue name.
queueUrlRequired
queueUrl: str;
- Type: str
AWS Queue url.
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.
Secret
- Implements: IAwsSecret
Base class for AWS Secrets.
Initializers
bring aws;
new aws.Secret(props?: SecretProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: SecretProps
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.Secret.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.Secret.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 | Get secret name. |
| str | AWS Secret ARN. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
nameOptional
name: str;
- Type: str
Get secret name.
secretArnRequired
secretArn: str;
- Type: str
AWS Secret ARN.
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.
Service
- Implements: IAwsService
Base class for AWS Services.
Initializers
bring aws;
new aws.Service(handler: IServiceHandler, props?: ServiceProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
| | No description. |
handlerRequired
- Type: IServiceHandler
propsOptional
- Type: ServiceProps
Methods
| Name | Description |
|---|---|
| Add an environment variable to the function. |
| Adds the host to the specified network. |
| Add policy statements to the function's IAM role. |
addEnvironment
addEnvironment(name: str, value: str): void
Add an environment variable to the function.
nameRequired
- Type: str
valueRequired
- Type: str
addNetwork
addNetwork(config: NetworkConfig): void
Adds the host to the specified network.
configRequired
- Type: NetworkConfig
addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policiesRequired
- Type: PolicyStatement
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.Service.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.Service.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. |
| MutMap<str> | Returns the set of environment variables for this function. |
| str | AWS ECS cluster name. |
| str | AWS ECS service name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
envRequired
env: MutMap<str>;
- Type: MutMap<str>
Returns the set of environment variables for this function.
clusterNameRequired
clusterName: str;
- Type: str
AWS ECS cluster name.
serviceNameRequired
serviceName: str;
- Type: str
AWS ECS service name.
Topic
- Implements: IAwsTopic
Base class for AWS Topics.
Initializers
bring aws;
new aws.Topic(props?: TopicProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsOptional
- Type: TopicProps
Methods
| Name | Description |
|---|---|
| Run an inflight whenever an message is published to the topic. |
| Subscribing queue to the topic. |
onMessage
onMessage(inflight: ITopicOnMessageHandler, props?: TopicOnMessageOptions): Function
Run an inflight whenever an message is published to the topic.
inflightRequired
- Type: ITopicOnMessageHandler
propsOptional
- Type: TopicOnMessageOptions
subscribeQueue
subscribeQueue(queue: Queue, props?: TopicSubscribeQueueOptions): void
Subscribing queue to the topic.
queueRequired
- Type: Queue
propsOptional
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. |
| If the topic is an AWS SNS, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Topic.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.Topic.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | AWS Topic arn. |
| str | AWS Topic name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
topicArnRequired
topicArn: str;
- Type: str
AWS Topic arn.
topicNameRequired
topicName: str;
- Type: str
AWS Topic name.
Website
- Implements: IAwsWebsite
Base class for AWS Websites.
Initializers
bring aws;
new aws.Website(props: WebsiteProps);
| Name | Type | Description |
|---|---|---|
| | No description. |
propsRequired
- Type: WebsiteProps
Methods
| Name | Description |
|---|---|
| Add a file to the website during deployment. |
| Add a JSON file with custom values during the website's deployment. |
addFile
addFile(path: str, data: str, options?: AddFileOptions): str
Add a file to the website during deployment.
If the path conflicts with file path from the website's static assets, an error will be thrown.
pathRequired
- Type: str
the file path it will be uploaded as.
dataRequired
- Type: str
the data to write to the file.
optionsOptional
- Type: AddFileOptions
configure the file's options.
addJson
addJson(path: str, data: Json): str
Add a JSON file with custom values during the website's deployment.
If the path conflicts with file path from the website's static assets, an error will be thrown.
pathRequired
- Type: str
the file path it will be uploaded as.
dataRequired
- Type: Json
the data to write to the file.
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. |
| If the bucket is an AWS Bucket, return a helper interface for working with it. |
onLiftType
bring aws;
aws.Website.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.Website.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
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.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | Absolute local path to the website's static files. |
| str | The website's url. |
| str | AWS Bucket arn. |
| str | AWS Bucket name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
pathRequired
path: str;
- Type: str
Absolute local path to the website's static files.
urlRequired
url: str;
- Type: str
The website's url.
bucketArnRequired
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketNameRequired
bucketName: str;
- Type: str
AWS Bucket name.
Classes
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
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.
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.
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.
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
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: Bucket, IAwsBucket
A shared interface for AWS buckets.
Properties
| Name | Type | Description |
|---|---|---|
| str | AWS Bucket arn. |
| str | Bucket domain name. |
| str | AWS Bucket name. |
bucketArnRequired
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketDomainNameRequired
bucketDomainName: str;
- Type: str
Bucket domain name.
bucketNameRequired
bucketName: str;
- Type: str
AWS Bucket name.
IAwsCounter
- Implemented By: Counter, 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: Function, 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: Function, Service, IAwsFunction, IAwsInflightHost, IAwsService
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
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.
IAwsSecret
- Implemented By: Secret, IAwsSecret
Shared interface for AWS Secrets.
Properties
| Name | Type | Description |
|---|---|---|
| str | AWS Secret ARN. |
secretArnRequired
secretArn: str;
- Type: str
AWS Secret ARN.
IAwsService
-
Extends: IAwsInflightHost
-
Implemented By: Service, IAwsService
Shared interface for AWS Services.
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| str | AWS ECS cluster name. |
| str | AWS ECS service name. |
nodeRequired
node: Node;
- Type: constructs.Node
The tree node.
clusterNameRequired
clusterName: str;
- Type: str
AWS ECS cluster name.
serviceNameRequired
serviceName: str;
- Type: str
AWS ECS service name.
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: Website, 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.