Fork me on GitHub

Package @pulumi/aws-serverless

Node.js:

var awsServerless = require("@pulumi/aws-serverless");

ES6 modules:

import * as awsServerless from "@pulumi/aws-serverless";

Index

bucket.ts function.ts topic.ts utils.ts

class BucketEventSubscription

A component corresponding to a single underlying aws.s3.BucketNotification created for a bucket. Note: due to the AWS requirement that all notifications for a bucket be defined at once, the actual aws.s3.BucketNotification instances will only be created once the pulumi program runs to completion and all subscriptions have been heard about.

constructor

public new BucketEventSubscription(name: string, bucket: s3.Bucket, func: lambda.Function, args: BucketSubscriptionArgs, opts?: pulumi.ResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

method registerOutputs

protected registerOutputs(outputs: Inputs | Promise<Inputs> | Output<Inputs> | undefined): void

property func

public func: lambda.Function;

property permission

public permission: lambda.Permission;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TopicEventSubscription

constructor

public new TopicEventSubscription(name: string, topic: sns.Topic, func: lambda.Function, args: TopicSubscriptionArgs, opts?: pulumi.ResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

method registerOutputs

protected registerOutputs(outputs: Inputs | Promise<Inputs> | Output<Inputs> | undefined): void

property func

public func: lambda.Function;

property permission

public permission: lambda.Permission;

property subscription

public subscription: sns.TopicSubscription;

The underlying sns object created for the subscription.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function createLambdaFunction

createLambdaFunction<E,R>(name: string, handler: Handler<E, R>, opts?: ResourceOptions, functionOptions?: aws.serverless.FunctionOptions): aws.lambda.Function

function onDelete

onDelete(name: string, bucket: s3.Bucket, handler: BucketEventHandler, args?: BucketDeleteArgs, opts?: pulumi.ResourceOptions): BucketEventSubscription

function onEvent

onEvent(name: string, bucket: s3.Bucket, handler: BucketEventHandler, args: BucketSubscriptionArgs, opts?: pulumi.ResourceOptions): BucketEventSubscription

Creates a new subscription to the given bucket using the lambda provided, along with optional options to control the behavior of the subscription. This function should be used when full control over the subscription is wanted, and other helpers (like onPut/onDelete) are not sufficient.

function onPut

onPut(name: string, bucket: s3.Bucket, handler: BucketEventHandler, args?: BucketPutArgs, opts?: pulumi.ResourceOptions): BucketEventSubscription

function outputFromObject

outputFromObject<T,U>(obj: Record<string, T>, func: { ... }): pulumi.Output<Record<string, U>>

function sha1hash

sha1hash(s: string): string

function subscribe

subscribe(name: string, topic: sns.Topic, handler: TopicEventHandler, args?: TopicSubscriptionArgs, opts?: pulumi.ResourceOptions): TopicEventSubscription

Creates a new subscription to the given topic using the lambda provided, along with optional options to control the behavior of the subscription.

interface BucketEvent

property Records

Records?: BucketRecord[];

interface BucketRecord

property awsRegion

awsRegion: string;

property eventName

eventName: string;

property eventSource

eventSource: string;

property eventTime

eventTime: string;

property eventVersion

eventVersion: string;

property requestParameters

requestParameters: { ... };

property responseElements

responseElements: { ... };

property s3

s3: { ... };

property userIdentity

userIdentity: { ... };

interface BucketSubscriptionArgs

property events

events: string[];

Events to subscribe to. For example: “s3:ObjectCreated:*”. Cannot be empty.

property filterPrefix

filterPrefix?: undefined | string;

An optional prefix or suffix to filter down notifications. See aws.s3.BucketNotification.lambdaFunctions for more details.

property filterSuffix

filterSuffix?: undefined | string;

interface SNSItem

property Message

Message: string;

property MessageAttributes

MessageAttributes: { ... };

property MessageId

MessageId: string;

property Signature

Signature: string;

property SignatureVersion

SignatureVersion: string;

property SigningCertUrl

SigningCertUrl: string;

property Subject

Subject: string;

property Timestamp

Timestamp: string;

property TopicArn

TopicArn: string;

property Type

Type: string;

property UnsubscribeUrl

UnsubscribeUrl: string;

interface SNSMessageAttribute

property Type

Type: string;

property Value

Value: string;

interface SimpleBucketSubscriptionArgs

Arguments to help customize a notification subscription for a bucket.

property filterPrefix

filterPrefix?: undefined | string;

An optional prefix or suffix to filter down notifications. See aws.s3.BucketNotification.lambdaFunctions for more details.

property filterSuffix

filterSuffix?: undefined | string;

interface TopicEvent

property Records

Records: TopicRecord[];

interface TopicRecord

property EventSource

EventSource: string;

property EventSubscriptionArn

EventSubscriptionArn: string;

property EventVersion

EventVersion: string;

property Sns

Sns: SNSItem;

type BucketDeleteArgs

type BucketDeleteArgs = SimpleBucketSubscriptionArgs;

Arguments to specifically control a subscription to ‘delete’ notifications on a bucket. Specifically, ‘events’ should not be provided as they will be assumed to be “s3:ObjectRemoved:*”. If different events are desired, the ‘subscribe’ function should be used instead.

type BucketEventHandler

type BucketEventHandler = Handler<BucketEvent, void>;

type BucketPutArgs

type BucketPutArgs = SimpleBucketSubscriptionArgs;

Arguments to specifically control a subscription to ‘put’ notifications on a bucket. Specifically, ‘events’ should not be provided as they will be assumed to be “s3:ObjectCreated:*”. If different events are desired, the ‘subscribe’ function should be used instead.

type Callback

type Callback = { ... };

A synchronous or asynchronous function that can be converted into an AWS lambda. Async callbacks are only supported with an AWS lambda runtime of 8.10 or higher. On those runtimes a Promise can be returned, ‘callback’ parameter can be ignored, and AWS will appropriately handle things. For AWS lambda pre-8.10, a synchronous function must be provided. The synchronous function should return nothing, and should instead invoke ‘callback’ when complete.

type Handler

type Handler = Callback<E, R> | aws.lambda.Function;

Handler represents the appropriate type for functions that can take either an AWS lambda function instance, or a JS function object that will then be used to create the AWS lambda function.

type TopicEventHandler

type TopicEventHandler = Handler<TopicEvent, void>;

type TopicSubscriptionArgs

type TopicSubscriptionArgs = { ... };

Arguments to control the topic subscription. Currently empty, but still defined in case of future need.