API Reference
Resources
Api
- Implements: IAwsApi
Base class for AWS API.
Initializers
bring aws;
new aws.Api(props?: ApiProps);
Name | Type | Description |
---|---|---|
|
| No description. |
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
path
Required
- Type: str
inflight
Required
- Type: IApiEndpointHandler
props
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
renderCorsHeaders
bring aws;
aws.Api.renderCorsHeaders(corsOptions?: ApiCorsOptions);
Generates an object containing default CORS response headers and OPTIONS response headers.
corsOptions
Optional
- 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 {}
).
path
Required
- 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.
api
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
url
Required
url: str;
- Type: str
The base URL of the API endpoint.
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.
Bucket
- Implements: IAwsBucket
Base class for AWS Buckets.
Initializers
bring aws;
new aws.Bucket(props?: BucketProps);
Name | Type | Description |
---|---|---|
|
| No description. |
props
Optional
- 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.
value
Required
- Type: BucketCorsOptions
addFile
addFile(key: str, path: str, encoding?: str): void
Add a file to the bucket from system folder.
key
Required
- Type: str
The key or name to associate with the file.
path
Required
- Type: str
The path to the file on the local system.
encoding
Optional
- 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.
path
Required
- Type: str
content
Required
- Type: str
onCreate
onCreate(fn: IBucketEventHandler, opts?: BucketOnCreateOptions): void
Run an inflight whenever a file is uploaded to the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnCreateOptions
onDelete
onDelete(fn: IBucketEventHandler, opts?: BucketOnDeleteOptions): void
Run an inflight whenever a file is deleted from the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnDeleteOptions
onEvent
onEvent(fn: IBucketEventHandler, opts?: BucketOnEventOptions): void
Run an inflight whenever a file is uploaded, modified, or deleted from the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnEventOptions
onUpdate
onUpdate(fn: IBucketEventHandler, opts?: BucketOnUpdateOptions): void
Run an inflight whenever a file is updated in the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
bucket
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
bucketArn
Required
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketDomainName
Required
bucketDomainName: str;
- Type: str
Bucket domain name.
bucketName
Required
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. |
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.
Counter
- Implements: IAwsCounter
Base class for AWS Counters.
Initializers
bring aws;
new aws.Counter(props?: CounterProps);
Name | Type | Description |
---|---|---|
|
| No description. |
props
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
counter
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
initial
Required
initial: num;
- Type: num
The initial value of the counter.
dynamoTableArn
Required
dynamoTableArn: str;
- Type: str
AWS Dynamodb arn.
dynamoTableName
Required
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. |
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.
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. |
handler
Required
- Type: IFunctionHandler
props
Optional
- 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.
name
Required
- Type: str
value
Required
- Type: str
addLambdaLayer
addLambdaLayer(layerArn: str): void
Add a Lambda layer to the function.
layerArn
Required
- Type: str
addNetwork
addNetwork(config: NetworkConfig): void
Adds the host to the specified network.
config
Required
- Type: NetworkConfig
addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policies
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
host
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
env
Required
env: MutMap<str>;
- Type: MutMap<str>
Returns the set of environment variables for this function.
functionArn
Required
functionArn: str;
- Type: str
AWS Function arn.
functionName
Required
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. |
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.
Queue
- Implements: IAwsQueue
Base class for AWS Queues.
Initializers
bring aws;
new aws.Queue(props?: QueueProps);
Name | Type | Description |
---|---|---|
|
| No description. |
props
Optional
- 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.
handler
Required
- Type: IQueueSetConsumerHandler
props
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
queue
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
queueArn
Required
queueArn: str;
- Type: str
AWS Queue arn.
queueName
Required
queueName: str;
- Type: str
AWS Queue name.
queueUrl
Required
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. |
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.
Secret
- Implements: IAwsSecret
Base class for AWS Secrets.
Initializers
bring aws;
new aws.Secret(props?: SecretProps);
Name | Type | Description |
---|---|---|
|
| No description. |
props
Optional
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- Type: IResource
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | Get secret name. |
| str | AWS Secret ARN. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
name
Optional
name: str;
- Type: str
Get secret name.
secretArn
Required
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. |
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.
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. |
handler
Required
- Type: IServiceHandler
props
Optional
- 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.
name
Required
- Type: str
value
Required
- Type: str
addNetwork
addNetwork(config: NetworkConfig): void
Adds the host to the specified network.
config
Required
- Type: NetworkConfig
addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policies
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
env
Required
env: MutMap<str>;
- Type: MutMap<str>
Returns the set of environment variables for this function.
clusterName
Required
clusterName: str;
- Type: str
AWS ECS cluster name.
serviceName
Required
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. |
props
Optional
- 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.
inflight
Required
- Type: ITopicOnMessageHandler
props
Optional
- Type: TopicOnMessageOptions
subscribeQueue
subscribeQueue(queue: Queue, props?: TopicSubscribeQueueOptions): void
Subscribing queue to the topic.
queue
Required
- Type: Queue
props
Optional
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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
topic
Required
- Type: Topic
The cloud.Topic.
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | AWS Topic arn. |
| str | AWS Topic name. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
topicArn
Required
topicArn: str;
- Type: str
AWS Topic arn.
topicName
Required
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. |
props
Required
- 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.
path
Required
- Type: str
the file path it will be uploaded as.
data
Required
- Type: str
the data to write to the file.
options
Optional
- 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.
path
Required
- Type: str
the file path it will be uploaded as.
data
Required
- 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.
host
Required
- Type: IInflightHost
ops
Required
- 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.
obj
Required
- 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.
website
Required
- 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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
path
Required
path: str;
- Type: str
Absolute local path to the website's static files.
url
Required
url: str;
- Type: str
The website's url.
bucketArn
Required
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketName
Required
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
.
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
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.
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.
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.
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
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: Bucket, 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.
bucketDomainName
Required
bucketDomainName: str;
- Type: str
Bucket domain name.
bucketName
Required
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. |
dynamoTableArn
Required
dynamoTableArn: str;
- Type: str
AWS Dynamodb arn.
dynamoTableName
Required
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.
layerArn
Required
- Type: str
The ARN of the layer.
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| str | AWS Function arn. |
| str | AWS Function name. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
functionArn
Required
functionArn: str;
- Type: str
AWS Function arn.
functionName
Required
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.
config
Required
- Type: NetworkConfig
The network configuration.
addPolicyStatements
addPolicyStatements(...policies: Array<PolicyStatement>): void
Add policy statements to the function's IAM role.
policies
Required
- Type: PolicyStatement
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
node
Required
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. |
queueArn
Required
queueArn: str;
- Type: str
AWS Queue arn.
queueName
Required
queueName: str;
- Type: str
AWS Queue name.
queueUrl
Required
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. |
secretArn
Required
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. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
clusterName
Required
clusterName: str;
- Type: str
AWS ECS cluster name.
serviceName
Required
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. |
topicArn
Required
topicArn: str;
- Type: str
AWS Topic arn.
topicName
Required
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. |
bucketArn
Required
bucketArn: str;
- Type: str
AWS Bucket arn.
bucketName
Required
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. |
awsRequestId
Required
awsRequestId: str;
- Type: str
The identifier of the invocation request.
functionName
Required
functionName: str;
- Type: str
The name of the Lambda function.
functionVersion
Required
functionVersion: str;
- Type: str
The version of the function.
invokedFunctionArn
Required
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.
logGroupName
Required
logGroupName: str;
- Type: str
The log group for the function.
logStreamName
Required
logStreamName: str;
- Type: str
The log stream for the function instance.
memoryLimitInMB
Required
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.