Class: AWSCDK::ECS::CfnService::AWSVPCConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_service.rb

Overview

An object representing the networking details for a task or service.

For example awsVpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]} .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of AWSVPCConfigurationProperty.

Parameters:

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

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

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

    The IDs of the security groups associated with the task or service.

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

    The IDs of the subnets associated with the task or service.



971
972
973
974
975
976
977
978
# File 'ecs/cfn_service.rb', line 971

def initialize(assign_public_ip: nil, security_groups: nil, subnets: nil)
  @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?
  @subnets = subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "subnets") unless @subnets.nil?
end

Instance Attribute Details

#assign_public_ipString? (readonly)

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

Consider the following when you set this value:

  • When you use create-service or update-service , the default is DISABLED .
  • When the service deployment_controller is ECS , the value must be DISABLED .


989
990
991
# File 'ecs/cfn_service.rb', line 989

def assign_public_ip
  @assign_public_ip
end

#security_groupsArray<String>? (readonly)

The IDs of the security groups associated with the task or service.

If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified.

All specified security groups must be from the same VPC.



998
999
1000
# File 'ecs/cfn_service.rb', line 998

def security_groups
  @security_groups
end

#subnetsArray<String>? (readonly)

The IDs of the subnets associated with the task or service.

There's a limit of 16 subnets that can be specified.

All specified subnets must be from the same VPC.



1007
1008
1009
# File 'ecs/cfn_service.rb', line 1007

def subnets
  @subnets
end

Class Method Details

.jsii_propertiesObject



1009
1010
1011
1012
1013
1014
1015
# File 'ecs/cfn_service.rb', line 1009

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

Instance Method Details

#to_jsiiObject



1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'ecs/cfn_service.rb', line 1017

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