OnImageScanCompletedOptions

class aws_cdk.aws_ecr.OnImageScanCompletedOptions(*, cross_stack_scope=None, description=None, event_pattern=None, rule_name=None, target=None, image_tags=None)

Bases: OnEventOptions

Options for the OnImageScanCompleted method.

Parameters:
  • cross_stack_scope (Optional[Construct]) – 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. Default: - none (the main scope will be used, even for cross-stack Events)

  • description (Optional[str]) – A description of the rule’s purpose. Default: - No description

  • event_pattern (Union[EventPattern, Dict[str, Any], None]) – 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. Default: - No additional filtering based on an event pattern.

  • rule_name (Optional[str]) – A name for the rule. Default: AWS CloudFormation generates a unique physical ID.

  • target (Optional[IRuleTarget]) – The target to register for the event. Default: - No target is added to the rule. Use addTarget() to add a target.

  • image_tags (Optional[Sequence[str]]) – Only watch changes to the image tags specified. Leave it undefined to watch the full repository. Default: - Watch the changes to the repository with all image tags

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecr as ecr
from aws_cdk import aws_events as events
import constructs as constructs

# construct: constructs.Construct
# detail: Any
# rule_target: events.IRuleTarget

on_image_scan_completed_options = ecr.OnImageScanCompletedOptions(
    cross_stack_scope=construct,
    description="description",
    event_pattern=events.EventPattern(
        account=["account"],
        detail={
            "detail_key": detail
        },
        detail_type=["detailType"],
        id=["id"],
        region=["region"],
        resources=["resources"],
        source=["source"],
        time=["time"],
        version=["version"]
    ),
    image_tags=["imageTags"],
    rule_name="ruleName",
    target=rule_target
)

Attributes

cross_stack_scope

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.

Default:
  • none (the main scope will be used, even for cross-stack Events)

description

A description of the rule’s purpose.

Default:
  • No description

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.

Default:
  • No additional filtering based on an event pattern.

See:

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

image_tags

Only watch changes to the image tags specified.

Leave it undefined to watch the full repository.

Default:
  • Watch the changes to the repository with all image tags

rule_name

A name for the rule.

Default:

AWS CloudFormation generates a unique physical ID.

target

The target to register for the event.

Default:
  • No target is added to the rule. Use addTarget() to add a target.