aws-cdk-lib.aws_ecr.OnImageScanCompletedOptions

interface OnImageScanCompletedOptions

LanguageType name
.NETAmazon.CDK.AWS.ECR.OnImageScanCompletedOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecr#OnImageScanCompletedOptions
Javasoftware.amazon.awscdk.services.ecr.OnImageScanCompletedOptions
Pythonaws_cdk.aws_ecr.OnImageScanCompletedOptions
TypeScript (source)aws-cdk-lib » aws_ecr » OnImageScanCompletedOptions

Options for the OnImageScanCompleted method.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecr as ecr } from 'aws-cdk-lib';
import { aws_events as events } from 'aws-cdk-lib';
import * as constructs from 'constructs';

declare const construct: constructs.Construct;
declare const detail: any;
declare const ruleTarget: events.IRuleTarget;
const onImageScanCompletedOptions: ecr.OnImageScanCompletedOptions = {
  crossStackScope: construct,
  description: 'description',
  eventPattern: {
    account: ['account'],
    detail: {
      detailKey: detail,
    },
    detailType: ['detailType'],
    id: ['id'],
    region: ['region'],
    resources: ['resources'],
    source: ['source'],
    time: ['time'],
    version: ['version'],
  },
  imageTags: ['imageTags'],
  ruleName: 'ruleName',
  target: ruleTarget,
};

Properties

NameTypeDescription
crossStackScope?ConstructThe scope to use if the source of the rule and its target are in different Stacks (but in the same account & region).
description?stringA description of the rule's purpose.
eventPattern?EventPatternAdditional restrictions for the event to route to the specified target.
imageTags?string[]Only watch changes to the image tags specified.
ruleName?stringA name for the rule.
target?IRuleTargetThe target to register for the event.

crossStackScope?

Type: Construct (optional, 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.


description?

Type: string (optional, default: No description)

A description of the rule's purpose.


eventPattern?

Type: EventPattern (optional, 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.

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


imageTags?

Type: string[] (optional, default: Watch the changes to the repository with all image tags)

Only watch changes to the image tags specified.

Leave it undefined to watch the full repository.


ruleName?

Type: string (optional, default: AWS CloudFormation generates a unique physical ID.)

A name for the rule.


target?

Type: IRuleTarget (optional, default: No target is added to the rule. Use addTarget() to add a target.)

The target to register for the event.