Skip to content

Latest commit

 

History

History
537 lines (326 loc) · 24.5 KB

File metadata and controls

537 lines (326 loc) · 24.5 KB

API Reference

Constructs

CodePipelineExecutionStateChangeDetectionEventRule

Initializers

import { CodePipelineExecutionStateChangeDetectionEventRule } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

new CodePipelineExecutionStateChangeDetectionEventRule(scope: Construct, id: string, props: CodePipelineExecutionStateChangeDetectionEventRuleProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props CodePipelineExecutionStateChangeDetectionEventRuleProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
applyRemovalPolicy Apply the given removal policy to this resource.
addEventPattern Adds an event pattern filter to this rule.
addTarget Adds a target to the rule. The abstract class RuleTarget can be extended to define new targets.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
public applyRemovalPolicy(policy: RemovalPolicy): void

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

addEventPattern
public addEventPattern(eventPattern?: EventPattern): void

Adds an event pattern filter to this rule.

If a pattern was already specified, these values are merged into the existing pattern.

For example, if the rule already contains the pattern:

{ "resources": [ "r1" ], "detail": { "hello": [ 1 ] } }

And addEventPattern is called with the pattern:

{ "resources": [ "r2" ], "detail": { "foo": [ "bar" ] } }

The resulting event pattern will be:

{ "resources": [ "r1", "r2" ], "detail": { "hello": [ 1 ], "foo": [ "bar" ] } }

eventPatternOptional
  • Type: aws-cdk-lib.aws_events.EventPattern

addTarget
public addTarget(target?: IRuleTarget): void

Adds a target to the rule. The abstract class RuleTarget can be extended to define new targets.

No-op if target is undefined.

targetOptional
  • Type: aws-cdk-lib.aws_events.IRuleTarget

Static Functions

Name Description
isConstruct Checks if x is a construct.
isOwnedResource Returns true if the construct was created by CDK, and false otherwise.
isResource Check whether the given construct is a Resource.
fromEventRuleArn Import an existing EventBridge Rule provided an ARN.

isConstruct
import { CodePipelineExecutionStateChangeDetectionEventRule } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

CodePipelineExecutionStateChangeDetectionEventRule.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isOwnedResource
import { CodePipelineExecutionStateChangeDetectionEventRule } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

CodePipelineExecutionStateChangeDetectionEventRule.isOwnedResource(construct: IConstruct)

Returns true if the construct was created by CDK, and false otherwise.

constructRequired
  • Type: constructs.IConstruct

isResource
import { CodePipelineExecutionStateChangeDetectionEventRule } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

CodePipelineExecutionStateChangeDetectionEventRule.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

fromEventRuleArn
import { CodePipelineExecutionStateChangeDetectionEventRule } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

CodePipelineExecutionStateChangeDetectionEventRule.fromEventRuleArn(scope: Construct, id: string, eventRuleArn: string)

Import an existing EventBridge Rule provided an ARN.

scopeRequired
  • Type: constructs.Construct

The parent creating construct (usually this).


idRequired
  • Type: string

The construct's name.


eventRuleArnRequired
  • Type: string

Event Rule ARN (i.e. arn:aws:events:::rule/MyScheduledRule).


Properties

Name Type Description
node constructs.Node The tree node.
env aws-cdk-lib.ResourceEnvironment The environment this resource belongs to.
stack aws-cdk-lib.Stack The stack in which this resource is defined.
ruleArn string The value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.
ruleName string The name event rule.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
public readonly env: ResourceEnvironment;
  • Type: aws-cdk-lib.ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


ruleArnRequired
public readonly ruleArn: string;
  • Type: string

The value of the event rule Amazon Resource Name (ARN), such as arn:aws:events:us-east-2:123456789012:rule/example.


ruleNameRequired
public readonly ruleName: string;
  • Type: string

The name event rule.


Structs

CodePipelineExecutionStateChangeDetectionEventRuleProps

Initializer

import { CodePipelineExecutionStateChangeDetectionEventRuleProps } from '@gammarers/aws-codesuite-state-change-detection-event-rules'

const codePipelineExecutionStateChangeDetectionEventRuleProps: CodePipelineExecutionStateChangeDetectionEventRuleProps = { ... }

Properties

Name Type Description
crossStackScope constructs.Construct The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
description string A description of the rule's purpose.
eventPattern aws-cdk-lib.aws_events.EventPattern Additional restrictions for the event to route to the specified target.
ruleName string A name for the rule.
enabled boolean Indicates whether the rule is enabled.
eventBus aws-cdk-lib.aws_events.IEventBus The event bus to associate with this rule.
schedule aws-cdk-lib.aws_events.Schedule The schedule or rate (frequency) that determines when EventBridge runs the rule.
targets aws-cdk-lib.aws_events.IRuleTarget[] Targets to invoke when this rule matches an event.
targetStates CodePipelineExecutionState[] No description.

crossStackScopeOptional
public readonly crossStackScope: Construct;
  • Type: constructs.Construct
  • Default: none (the main scope will be used, even for cross-stack Events)

The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).

This helps dealing with cycles that often arise in these situations.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: No description

A description of the rule's purpose.


eventPatternOptional
public readonly eventPattern: EventPattern;
  • Type: aws-cdk-lib.aws_events.EventPattern
  • Default: No additional filtering based on an event pattern.

Additional restrictions for the event to route to the specified target.

The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.

https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html


ruleNameOptional
public readonly ruleName: string;
  • Type: string
  • Default: AWS CloudFormation generates a unique physical ID.

A name for the rule.


enabledOptional
public readonly enabled: boolean;
  • Type: boolean
  • Default: true

Indicates whether the rule is enabled.


eventBusOptional
public readonly eventBus: IEventBus;
  • Type: aws-cdk-lib.aws_events.IEventBus
  • Default: The default event bus.

The event bus to associate with this rule.


scheduleOptional
public readonly schedule: Schedule;
  • Type: aws-cdk-lib.aws_events.Schedule
  • Default: None.

The schedule or rate (frequency) that determines when EventBridge runs the rule.

You must specify this property, the eventPattern property, or both.

For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.

https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html


targetsOptional
public readonly targets: IRuleTarget[];
  • Type: aws-cdk-lib.aws_events.IRuleTarget[]
  • Default: No targets.

Targets to invoke when this rule matches an event.

Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]).


targetStatesOptional
public readonly targetStates: CodePipelineExecutionState[];

Enums

CodePipelineExecutionState

Members

Name Description
CANCELED No description.
FAILED No description.
RESUMED No description.
STARTED No description.
STOPPED No description.
STOPPING No description.
SUCCEEDED No description.
SUPERSEDED No description.

CANCELED

FAILED

RESUMED

STARTED

STOPPED

STOPPING

SUCCEEDED

SUPERSEDED