Class: AWSCDK::Events::CfnRule::AWSVPCConfigurationProperty

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

Overview

This structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used.

This structure is relevant only for ECS tasks that use the awsvpc network mode.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subnets:, assign_public_ip: nil, security_groups: nil) ⇒ AWSVPCConfigurationProperty

Returns a new instance of AWSVPCConfigurationProperty.

Parameters:

  • subnets (Array<String>)

    Specifies the subnets associated with the task.

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

    Specifies whether the task's elastic network interface receives a public IP address.

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

    Specifies the security groups associated with the task.



693
694
695
696
697
698
699
700
# File 'events/cfn_rule.rb', line 693

def initialize(subnets:, assign_public_ip: nil, security_groups: nil)
  @subnets = subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "subnets")
  @assign_public_ip = assign_public_ip
  Jsii::Type.check_type(@assign_public_ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assignPublicIp") unless @assign_public_ip.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroups") unless @security_groups.nil?
end

Instance Attribute Details

#assign_public_ipString? (readonly)

Specifies whether the task's elastic network interface receives a public IP address.

You can specify ENABLED only when LaunchType in EcsParameters is set to FARGATE .



715
716
717
# File 'events/cfn_rule.rb', line 715

def assign_public_ip
  @assign_public_ip
end

#security_groupsArray<String>? (readonly)

Specifies the security groups associated with the task.

These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.



722
723
724
# File 'events/cfn_rule.rb', line 722

def security_groups
  @security_groups
end

#subnetsArray<String> (readonly)

Specifies the subnets associated with the task.

These subnets must all be in the same VPC. You can specify as many as 16 subnets.



708
709
710
# File 'events/cfn_rule.rb', line 708

def subnets
  @subnets
end

Class Method Details

.jsii_propertiesObject



724
725
726
727
728
729
730
# File 'events/cfn_rule.rb', line 724

def self.jsii_properties
  {
    :subnets => "subnets",
    :assign_public_ip => "assignPublicIp",
    :security_groups => "securityGroups",
  }
end

Instance Method Details

#to_jsiiObject



732
733
734
735
736
737
738
739
740
# File 'events/cfn_rule.rb', line 732

def to_jsii
  result = {}
  result.merge!({
    "subnets" => @subnets,
    "assignPublicIp" => @assign_public_ip,
    "securityGroups" => @security_groups,
  })
  result.compact
end