Class: AWSCDK::Events::CfnEventBusPolicyProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events/cfn_event_bus_policy_props.rb

Overview

Properties for defining a CfnEventBusPolicy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(statement_id:, action: nil, condition: nil, event_bus_name: nil, principal: nil, statement: nil) ⇒ CfnEventBusPolicyProps

Returns a new instance of CfnEventBusPolicyProps.

Parameters:

  • statement_id (String)

    An identifier string for the external account that you are granting permissions to.

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

    The action that you are enabling the other account to perform.

  • condition (AWSCDK::IResolvable, AWSCDK::Events::CfnEventBusPolicy::ConditionProperty, nil) (defaults to: nil)

    This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain AWS organization.

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

    The name of the event bus associated with the rule.

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

    The 12-digit AWS account ID that you are permitting to put events to your default event bus.

  • statement (Object, nil) (defaults to: nil)

    A JSON string that describes the permission policy statement.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'events/cfn_event_bus_policy_props.rb', line 15

def initialize(statement_id:, action: nil, condition: nil, event_bus_name: nil, principal: nil, statement: nil)
  @statement_id = statement_id
  Jsii::Type.check_type(@statement_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statementId")
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil?
  @condition = condition.is_a?(Hash) ? ::AWSCDK::Events::CfnEventBusPolicy::ConditionProperty.new(**condition.transform_keys(&:to_sym)) : condition
  Jsii::Type.check_type(@condition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHMuQ2ZuRXZlbnRCdXNQb2xpY3kuQ29uZGl0aW9uUHJvcGVydHkifV19fQ==")), "condition") unless @condition.nil?
  @event_bus_name = event_bus_name
  Jsii::Type.check_type(@event_bus_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "eventBusName") unless @event_bus_name.nil?
  @principal = principal
  Jsii::Type.check_type(@principal, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "principal") unless @principal.nil?
  @statement = statement
  Jsii::Type.check_type(@statement, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "statement") unless @statement.nil?
end

Instance Attribute Details

#actionString? (readonly)

Deprecated.

this property has been deprecated

The action that you are enabling the other account to perform.



44
45
46
# File 'events/cfn_event_bus_policy_props.rb', line 44

def action
  @action
end

#conditionAWSCDK::IResolvable, ... (readonly)

Deprecated.

this property has been deprecated

This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain AWS organization.



50
51
52
# File 'events/cfn_event_bus_policy_props.rb', line 50

def condition
  @condition
end

#event_bus_nameString? (readonly)

The name of the event bus associated with the rule.

If you omit this, the default event bus is used.



57
58
59
# File 'events/cfn_event_bus_policy_props.rb', line 57

def event_bus_name
  @event_bus_name
end

#principalString? (readonly)

Deprecated.

this property has been deprecated

The 12-digit AWS account ID that you are permitting to put events to your default event bus.

Specify "*" to permit any account to put events to your default event bus.



65
66
67
# File 'events/cfn_event_bus_policy_props.rb', line 65

def principal
  @principal
end

#statementObject? (readonly)

A JSON string that describes the permission policy statement.

You can include a Policy parameter in the request instead of using the StatementId , Action , Principal , or Condition parameters.



72
73
74
# File 'events/cfn_event_bus_policy_props.rb', line 72

def statement
  @statement
end

#statement_idString (readonly)

An identifier string for the external account that you are granting permissions to.

If you later want to revoke the permission for this external account, specify this StatementId when you run RemovePermission .

Each StatementId must be unique.



38
39
40
# File 'events/cfn_event_bus_policy_props.rb', line 38

def statement_id
  @statement_id
end

Class Method Details

.jsii_propertiesObject



74
75
76
77
78
79
80
81
82
83
# File 'events/cfn_event_bus_policy_props.rb', line 74

def self.jsii_properties
  {
    :statement_id => "statementId",
    :action => "action",
    :condition => "condition",
    :event_bus_name => "eventBusName",
    :principal => "principal",
    :statement => "statement",
  }
end

Instance Method Details

#to_jsiiObject



85
86
87
88
89
90
91
92
93
94
95
96
# File 'events/cfn_event_bus_policy_props.rb', line 85

def to_jsii
  result = {}
  result.merge!({
    "statementId" => @statement_id,
    "action" => @action,
    "condition" => @condition,
    "eventBusName" => @event_bus_name,
    "principal" => @principal,
    "statement" => @statement,
  })
  result.compact
end