334 lines
11 KiB
TypeScript
334 lines
11 KiB
TypeScript
import type { Construct } from 'constructs';
|
|
import type { BaseArchiveProps } from './archive';
|
|
import { Archive } from './archive';
|
|
import { EventBusGrants } from './events-grants.generated';
|
|
import type { EventBusReference, IEventBusRef } from './events.generated';
|
|
import * as iam from '../../aws-iam';
|
|
import type * as kms from '../../aws-kms';
|
|
import type * as sqs from '../../aws-sqs';
|
|
import type { IResource } from '../../core';
|
|
import { Resource } from '../../core';
|
|
/**
|
|
* Whether EventBridge include detailed event information in the records it generates.
|
|
* Detailed data can be useful for troubleshooting and debugging.
|
|
* This information includes details of the event itself, as well as target details.
|
|
*/
|
|
export declare enum IncludeDetail {
|
|
/**
|
|
* FULL: Include all details related to event itself and the request EventBridge sends to the target.
|
|
* Detailed data can be useful for troubleshooting and debugging.
|
|
*/
|
|
FULL = "FULL",
|
|
/**
|
|
* NONE: Does not include any details.
|
|
*/
|
|
NONE = "NONE"
|
|
}
|
|
/**
|
|
* The level of logging detail to include. This applies to all log destinations for the event bus.
|
|
*/
|
|
export declare enum Level {
|
|
/**
|
|
* INFO: EventBridge sends any logs related to errors, as well as major steps performed during event processing
|
|
*/
|
|
INFO = "INFO",
|
|
/**
|
|
* ERROR: EventBridge sends any logs related to errors generated during event processing and target delivery.
|
|
*/
|
|
ERROR = "ERROR",
|
|
/**
|
|
* TRACE: EventBridge sends any logs generated during all steps in the event processing.
|
|
*/
|
|
TRACE = "TRACE",
|
|
/**
|
|
* OFF: EventBridge does not send any logs. This is the default.
|
|
*/
|
|
OFF = "OFF"
|
|
}
|
|
/**
|
|
* Interface for Logging Configuration of the Event Bus
|
|
*/
|
|
export interface LogConfig {
|
|
/**
|
|
* Whether EventBridge include detailed event information in the records it generates.
|
|
* @default no details
|
|
*/
|
|
readonly includeDetail?: IncludeDetail;
|
|
/**
|
|
* Logging level
|
|
* @default OFF
|
|
*/
|
|
readonly level?: Level;
|
|
}
|
|
/**
|
|
* Interface which all EventBus based classes MUST implement
|
|
*/
|
|
export interface IEventBus extends IResource, IEventBusRef {
|
|
/**
|
|
* The physical ID of this event bus resource
|
|
*
|
|
* @attribute
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-name
|
|
*/
|
|
readonly eventBusName: string;
|
|
/**
|
|
* The ARN of this event bus resource
|
|
*
|
|
* @attribute
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Arn-fn::getatt
|
|
*/
|
|
readonly eventBusArn: string;
|
|
/**
|
|
* The JSON policy of this event bus resource
|
|
*
|
|
* @attribute
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Policy-fn::getatt
|
|
*/
|
|
readonly eventBusPolicy: string;
|
|
/**
|
|
* The partner event source to associate with this event bus resource
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-eventsourcename
|
|
*/
|
|
readonly eventSourceName?: string;
|
|
/**
|
|
* Create an EventBridge archive to send events to.
|
|
* When you create an archive, incoming events might not immediately start being sent to the archive.
|
|
* Allow a short period of time for changes to take effect.
|
|
*
|
|
* @param props Properties of the archive
|
|
*/
|
|
archive(id: string, props: BaseArchiveProps): Archive;
|
|
/**
|
|
* Grants an IAM Principal to send custom events to the eventBus
|
|
* so that they can be matched to rules.
|
|
*
|
|
* @param grantee The principal (no-op if undefined)
|
|
* @param sid The Statement ID used if we need to add a trust policy on the event bus.
|
|
*
|
|
*/
|
|
grantPutEventsTo(grantee: iam.IGrantable, sid?: string): iam.Grant;
|
|
}
|
|
/**
|
|
* Properties to define an event bus
|
|
*/
|
|
export interface EventBusProps {
|
|
/**
|
|
* The name of the event bus you are creating
|
|
* Note: If 'eventSourceName' is passed in, you cannot set this
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-name
|
|
* @default - automatically generated name
|
|
*/
|
|
readonly eventBusName?: string;
|
|
/**
|
|
* The partner event source to associate with this event bus resource
|
|
* Note: If 'eventBusName' is passed in, you cannot set this
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-eventsourcename
|
|
* @default - no partner event source
|
|
*/
|
|
readonly eventSourceName?: string;
|
|
/**
|
|
* Dead-letter queue for the event bus
|
|
*
|
|
* @see https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-event-delivery.html#eb-rule-dlq
|
|
*
|
|
* @default - no dead-letter queue
|
|
*/
|
|
readonly deadLetterQueue?: sqs.IQueue;
|
|
/**
|
|
* The event bus description.
|
|
*
|
|
* The description can be up to 512 characters long.
|
|
*
|
|
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-description
|
|
*
|
|
* @default - no description
|
|
*/
|
|
readonly description?: string;
|
|
/**
|
|
* The customer managed key that encrypt events on this event bus.
|
|
*
|
|
* @default - Use an AWS managed key
|
|
*/
|
|
readonly kmsKey?: kms.IKey;
|
|
/**
|
|
* The Logging Configuration of the Èvent Bus.
|
|
* @default - no logging
|
|
*/
|
|
readonly logConfig?: LogConfig;
|
|
}
|
|
/**
|
|
* Interface with properties necessary to import a reusable EventBus
|
|
*/
|
|
export interface EventBusAttributes {
|
|
/**
|
|
* The physical ID of this event bus resource
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-name
|
|
*/
|
|
readonly eventBusName: string;
|
|
/**
|
|
* The ARN of this event bus resource
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Arn-fn::getatt
|
|
*/
|
|
readonly eventBusArn: string;
|
|
/**
|
|
* The JSON policy of this event bus resource
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#Policy-fn::getatt
|
|
*/
|
|
readonly eventBusPolicy: string;
|
|
/**
|
|
* The partner event source to associate with this event bus resource
|
|
*
|
|
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-eventbus.html#cfn-events-eventbus-eventsourcename
|
|
* @default - no partner event source
|
|
*/
|
|
readonly eventSourceName?: string;
|
|
}
|
|
declare abstract class EventBusBase extends Resource implements IEventBus, iam.IResourceWithPolicy {
|
|
/**
|
|
* The physical ID of this event bus resource
|
|
*/
|
|
abstract readonly eventBusName: string;
|
|
/**
|
|
* The ARN of the event bus, such as:
|
|
* arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1.
|
|
*/
|
|
abstract readonly eventBusArn: string;
|
|
/**
|
|
* The policy for the event bus in JSON form.
|
|
*/
|
|
abstract readonly eventBusPolicy: string;
|
|
/**
|
|
* The name of the partner event source
|
|
*/
|
|
abstract readonly eventSourceName?: string;
|
|
/**
|
|
* Collection of grant methods for an EventBus
|
|
*/
|
|
readonly grants: EventBusGrants;
|
|
get eventBusRef(): EventBusReference;
|
|
archive(id: string, props: BaseArchiveProps): Archive;
|
|
/**
|
|
* [disable-awslint:no-grants]
|
|
*/
|
|
grantPutEventsTo(grantee: iam.IGrantable, sid?: string): iam.Grant;
|
|
/**
|
|
* Adds a statement to the resource policy associated with this event bus.
|
|
* A resource policy will be automatically created upon the first call to `addToResourcePolicy`.
|
|
*
|
|
* Note that this does not work with imported event buss.
|
|
*
|
|
* @param statement The policy statement to add
|
|
*/
|
|
abstract addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult;
|
|
}
|
|
/**
|
|
* Define an EventBridge EventBus
|
|
*
|
|
* @resource AWS::Events::EventBus
|
|
*/
|
|
export declare class EventBus extends EventBusBase {
|
|
/**
|
|
* Uniquely identifies this class.
|
|
*/
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
/**
|
|
* Import an existing event bus resource
|
|
* @param scope Parent construct
|
|
* @param id Construct ID
|
|
* @param eventBusArn ARN of imported event bus
|
|
*/
|
|
static fromEventBusArn(scope: Construct, id: string, eventBusArn: string): IEventBus;
|
|
/**
|
|
* Import an existing event bus resource
|
|
* @param scope Parent construct
|
|
* @param id Construct ID
|
|
* @param eventBusName Name of imported event bus
|
|
*/
|
|
static fromEventBusName(scope: Construct, id: string, eventBusName: string): IEventBus;
|
|
/**
|
|
* Import an existing event bus resource
|
|
* @param scope Parent construct
|
|
* @param id Construct ID
|
|
* @param attrs Imported event bus properties
|
|
*/
|
|
static fromEventBusAttributes(scope: Construct, id: string, attrs: EventBusAttributes): IEventBus;
|
|
/**
|
|
* Permits an IAM Principal to send custom events to EventBridge
|
|
* so that they can be matched to rules.
|
|
*
|
|
* @param grantee The principal (no-op if undefined)
|
|
*/
|
|
static grantAllPutEvents(grantee: iam.IGrantable): iam.Grant;
|
|
private static eventBusProps;
|
|
/**
|
|
* The CfnEventBus resource
|
|
*/
|
|
private readonly _resource;
|
|
/**
|
|
* The physical ID of this event bus resource
|
|
*/
|
|
get eventBusName(): string;
|
|
/**
|
|
* The ARN of the event bus, such as:
|
|
* arn:aws:events:us-east-2:123456789012:event-bus/aws.partner/PartnerName/acct1/repo1.
|
|
*/
|
|
get eventBusArn(): string;
|
|
/**
|
|
* The policy for the event bus in JSON form.
|
|
*/
|
|
get eventBusPolicy(): string;
|
|
/**
|
|
* The name of the partner event source
|
|
*/
|
|
get eventSourceName(): string | undefined;
|
|
constructor(scope: Construct, id: string, props?: EventBusProps);
|
|
/**
|
|
* Adds a statement to the IAM resource policy associated with this event bus.
|
|
*/
|
|
addToResourcePolicy(statement: iam.PolicyStatement): iam.AddToResourcePolicyResult;
|
|
}
|
|
/**
|
|
* Properties to associate Event Buses with a policy
|
|
*/
|
|
export interface EventBusPolicyProps {
|
|
/**
|
|
* The event bus to which the policy applies
|
|
*/
|
|
readonly eventBus: IEventBus;
|
|
/**
|
|
* An IAM Policy Statement to apply to the Event Bus
|
|
*/
|
|
readonly statement: iam.PolicyStatement;
|
|
/**
|
|
* An identifier string for the external account that
|
|
* you are granting permissions to.
|
|
*/
|
|
readonly statementId: string;
|
|
}
|
|
/**
|
|
* The policy for an Event Bus
|
|
*
|
|
* Policies define the operations that are allowed on this resource.
|
|
*
|
|
* You almost never need to define this construct directly.
|
|
*
|
|
* All AWS resources that support resource policies have a method called
|
|
* `addToResourcePolicy()`, which will automatically create a new resource
|
|
* policy if one doesn't exist yet, otherwise it will add to the existing
|
|
* policy.
|
|
*
|
|
* Prefer to use `addToResourcePolicy()` instead.
|
|
*/
|
|
export declare class EventBusPolicy extends Resource {
|
|
/** Uniquely identifies this class. */
|
|
static readonly PROPERTY_INJECTION_ID: string;
|
|
constructor(scope: Construct, id: string, props: EventBusPolicyProps);
|
|
}
|
|
export {};
|