Package @pulumi/aws-serverless

var awsServerless = require("@pulumi/aws-serverless");
import * as awsServerless from "@pulumi/aws-serverless";

class BucketEventSubscription

extends EventSubscription

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

extends EventSubscription

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: (t: T) => pulumi.Output<U>): 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

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: {
    sourceIPAddress: string;
};

property responseElements

responseElements: {
    x-amz-id-2: string;
    x-amz-request-id: string;
};

property s3

s3: {
    bucket: {
        arn: string;
        name: string;
        ownerIdentity: {
            principalId: string;
        };
    };
    configurationId: string;
    object: {
        eTag: string;
        key: string;
        sequencer: string;
        size: number;
        versionId: undefined | string;
    };
    s3SchemaVersion: string;
};

property userIdentity

userIdentity: {
    principalId: string;
};

interface BucketSubscriptionArgs

extends SimpleBucketSubscriptionArgs

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

interface SNSMessageAttribute

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

interface TopicRecord

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 = (event: E, context: aws.serverless.Context, callback: (error: any, result: R) => void) => Promise<R> | void;

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.