Class: AWSCDK::BedrockAgentCore::VPCConfigProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/vpc_config_props.rb

Overview

VPC configuration properties.

Only used when network mode is VPC.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, allow_all_outbound: nil, security_groups: nil, vpc_subnets: nil) ⇒ VPCConfigProps

Returns a new instance of VPCConfigProps.

Parameters:

  • vpc (AWSCDK::EC2::IVPC)

    The VPC to deploy the resource to.

  • allow_all_outbound (Boolean, nil) (defaults to: nil)

    Whether to allow the resource to send all network traffic (except ipv6).

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>, nil) (defaults to: nil)

    The list of security groups to associate with the resource's network interfaces.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    Where to place the network interfaces within the VPC.



13
14
15
16
17
18
19
20
21
22
# File 'bedrock_agent_core/vpc_config_props.rb', line 13

def initialize(vpc:, allow_all_outbound: nil, security_groups: nil, vpc_subnets: nil)
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @allow_all_outbound = allow_all_outbound
  Jsii::Type.check_type(@allow_all_outbound, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowAllOutbound") unless @allow_all_outbound.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
end

Instance Attribute Details

#allow_all_outboundBoolean? (readonly)

Note:

Default: true

Whether to allow the resource to send all network traffic (except ipv6).

If set to false, you must individually add traffic rules to allow the resource to connect to network targets.

Do not specify this property if the security_groups property is set. Instead, configure allow_all_outbound directly on the security group.

Returns:

  • (Boolean, nil)


38
39
40
# File 'bedrock_agent_core/vpc_config_props.rb', line 38

def allow_all_outbound
  @allow_all_outbound
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup>? (readonly)

Note:

Default: - If the resource is placed within a VPC and a security group is not specified by this prop, a dedicated security group will be created for this resource.

The list of security groups to associate with the resource's network interfaces.

Only used if 'vpc' is supplied.

Returns:



45
46
47
# File 'bedrock_agent_core/vpc_config_props.rb', line 45

def security_groups
  @security_groups
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC to deploy the resource to.

Returns:



27
28
29
# File 'bedrock_agent_core/vpc_config_props.rb', line 27

def vpc
  @vpc
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - the Vpc default strategy if not specified

Where to place the network interfaces within the VPC.

This requires vpc to be specified in order for interfaces to actually be placed in the subnets. If vpc is not specify, this will raise an error.



53
54
55
# File 'bedrock_agent_core/vpc_config_props.rb', line 53

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



55
56
57
58
59
60
61
62
# File 'bedrock_agent_core/vpc_config_props.rb', line 55

def self.jsii_properties
  {
    :vpc => "vpc",
    :allow_all_outbound => "allowAllOutbound",
    :security_groups => "securityGroups",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



64
65
66
67
68
69
70
71
72
73
# File 'bedrock_agent_core/vpc_config_props.rb', line 64

def to_jsii
  result = {}
  result.merge!({
    "vpc" => @vpc,
    "allowAllOutbound" => @allow_all_outbound,
    "securityGroups" => @security_groups,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end