Class: AWSCDK::ECR::OnImageScanCompletedOptions

Inherits:
AWSCDK::Events::OnEventOptions
  • Object
show all
Defined in:
ecr/on_image_scan_completed_options.rb

Overview

Options for the OnImageScanCompleted method.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, target: nil, image_tags: nil) ⇒ OnImageScanCompletedOptions

Returns a new instance of OnImageScanCompletedOptions.

Parameters:

  • cross_stack_scope (Constructs::Construct, nil) (defaults to: nil)

    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, nil) (defaults to: nil)

    A description of the rule's purpose.

  • event_pattern (AWSCDK::Events::EventPattern, nil) (defaults to: nil)

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

  • rule_name (String, nil) (defaults to: nil)

    A name for the rule.

  • target (AWSCDK::Events::IRuleTarget, nil) (defaults to: nil)

    The target to register for the event.

  • image_tags (Array<String>, nil) (defaults to: nil)

    Only watch changes to the image tags specified.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ecr/on_image_scan_completed_options.rb', line 13

def initialize(cross_stack_scope: nil, description: nil, event_pattern: nil, rule_name: nil, target: nil, image_tags: nil)
  @cross_stack_scope = cross_stack_scope
  Jsii::Type.check_type(@cross_stack_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "crossStackScope") unless @cross_stack_scope.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @event_pattern = event_pattern.is_a?(Hash) ? ::AWSCDK::Events::EventPattern.new(**event_pattern.transform_keys(&:to_sym)) : event_pattern
  Jsii::Type.check_type(@event_pattern, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLkV2ZW50UGF0dGVybiJ9")), "eventPattern") unless @event_pattern.nil?
  @rule_name = rule_name
  Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName") unless @rule_name.nil?
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLklSdWxlVGFyZ2V0In0=")), "target") unless @target.nil?
  @image_tags = image_tags
  Jsii::Type.check_type(@image_tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "imageTags") unless @image_tags.nil?
end

Instance Attribute Details

#cross_stack_scopeConstructs::Construct? (readonly)

Note:

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.

Returns:

  • (Constructs::Construct, nil)


34
35
36
# File 'ecr/on_image_scan_completed_options.rb', line 34

def cross_stack_scope
  @cross_stack_scope
end

#descriptionString? (readonly)

Note:

Default: - No description

A description of the rule's purpose.

Returns:

  • (String, nil)


39
40
41
# File 'ecr/on_image_scan_completed_options.rb', line 39

def description
  @description
end

#event_patternAWSCDK::Events::EventPattern? (readonly)

Note:

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.



49
50
51
# File 'ecr/on_image_scan_completed_options.rb', line 49

def event_pattern
  @event_pattern
end

#image_tagsArray<String>? (readonly)

Note:

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.

Returns:

  • (Array<String>, nil)


66
67
68
# File 'ecr/on_image_scan_completed_options.rb', line 66

def image_tags
  @image_tags
end

#rule_nameString? (readonly)

Note:

Default: AWS CloudFormation generates a unique physical ID.

A name for the rule.

Returns:

  • (String, nil)


54
55
56
# File 'ecr/on_image_scan_completed_options.rb', line 54

def rule_name
  @rule_name
end

#targetAWSCDK::Events::IRuleTarget? (readonly)

Note:

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

The target to register for the event.

Returns:



59
60
61
# File 'ecr/on_image_scan_completed_options.rb', line 59

def target
  @target
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'ecr/on_image_scan_completed_options.rb', line 68

def self.jsii_properties
  {
    :cross_stack_scope => "crossStackScope",
    :description => "description",
    :event_pattern => "eventPattern",
    :rule_name => "ruleName",
    :target => "target",
    :image_tags => "imageTags",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'ecr/on_image_scan_completed_options.rb', line 79

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "crossStackScope" => @cross_stack_scope,
    "description" => @description,
    "eventPattern" => @event_pattern,
    "ruleName" => @rule_name,
    "target" => @target,
    "imageTags" => @image_tags,
  })
  result.compact
end