Class: AWSCDK::CloudAssemblySchema::VPCContextQuery

Inherits:
ContextLookupRoleOptions
  • Object
show all
Defined in:
cloud_assembly_schema/vpc_context_query.rb

Overview

Query input for looking up a VPC.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:, region:, assume_role_additional_options: nil, lookup_role_arn: nil, lookup_role_external_id: nil, filter:, return_asymmetric_subnets: nil, return_vpn_gateways: nil, subnet_group_name_tag: nil) ⇒ VPCContextQuery

Returns a new instance of VPCContextQuery.

Parameters:

  • account (String)

    Query account.

  • region (String)

    Query region.

  • assume_role_additional_options (Hash{String => Object}, nil) (defaults to: nil)

    Additional options to pass to STS when assuming the lookup role.

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

    The ARN of the role that should be used to look up the missing values.

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

    The ExternalId that needs to be supplied while assuming this role.

  • filter (Hash{String => String})

    Filters to apply to the VPC.

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

    Whether to populate the subnetGroups field of the VpcContextResponse, which contains potentially asymmetric subnet groups.

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

    Whether to populate the vpnGatewayId field of the VpcContextResponse, which contains the VPN Gateway ID, if one exists.

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

    Optional tag for subnet group name.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'cloud_assembly_schema/vpc_context_query.rb', line 16

def initialize(account:, region:, assume_role_additional_options: nil, lookup_role_arn: nil, lookup_role_external_id: nil, filter:, return_asymmetric_subnets: nil, return_vpn_gateways: nil, subnet_group_name_tag: nil)
  @account = 
  Jsii::Type.check_type(@account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "account")
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region")
  @assume_role_additional_options = assume_role_additional_options
  Jsii::Type.check_type(@assume_role_additional_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "assumeRoleAdditionalOptions") unless @assume_role_additional_options.nil?
  @lookup_role_arn = lookup_role_arn
  Jsii::Type.check_type(@lookup_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lookupRoleArn") unless @lookup_role_arn.nil?
  @lookup_role_external_id = lookup_role_external_id
  Jsii::Type.check_type(@lookup_role_external_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lookupRoleExternalId") unless @lookup_role_external_id.nil?
  @filter = filter
  Jsii::Type.check_type(@filter, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "filter")
  @return_asymmetric_subnets = return_asymmetric_subnets
  Jsii::Type.check_type(@return_asymmetric_subnets, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "returnAsymmetricSubnets") unless @return_asymmetric_subnets.nil?
  @return_vpn_gateways = return_vpn_gateways
  Jsii::Type.check_type(@return_vpn_gateways, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "returnVpnGateways") unless @return_vpn_gateways.nil?
  @subnet_group_name_tag = subnet_group_name_tag
  Jsii::Type.check_type(@subnet_group_name_tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetGroupNameTag") unless @subnet_group_name_tag.nil?
end

Instance Attribute Details

#accountString (readonly)

Query account.

Returns:

  • (String)


40
41
42
# File 'cloud_assembly_schema/vpc_context_query.rb', line 40

def 
  @account
end

#assume_role_additional_optionsHash{String => Object}? (readonly)

Note:

Default: - No additional options.

Additional options to pass to STS when assuming the lookup role.

  • RoleArn should not be used. Use the dedicated lookup_role_arn property instead.
  • ExternalId should not be used. Use the dedicated lookup_role_external_id instead.


53
54
55
# File 'cloud_assembly_schema/vpc_context_query.rb', line 53

def assume_role_additional_options
  @assume_role_additional_options
end

#filterHash{String => String} (readonly)

Filters to apply to the VPC.

Filter parameters are the same as passed to DescribeVpcs.



70
71
72
# File 'cloud_assembly_schema/vpc_context_query.rb', line 70

def filter
  @filter
end

#lookup_role_arnString? (readonly)

Note:

Default: - None

The ARN of the role that should be used to look up the missing values.

Returns:

  • (String, nil)


58
59
60
# File 'cloud_assembly_schema/vpc_context_query.rb', line 58

def lookup_role_arn
  @lookup_role_arn
end

#lookup_role_external_idString? (readonly)

Note:

Default: - No ExternalId will be supplied

The ExternalId that needs to be supplied while assuming this role.

Returns:

  • (String, nil)


63
64
65
# File 'cloud_assembly_schema/vpc_context_query.rb', line 63

def lookup_role_external_id
  @lookup_role_external_id
end

#regionString (readonly)

Query region.

Returns:

  • (String)


44
45
46
# File 'cloud_assembly_schema/vpc_context_query.rb', line 44

def region
  @region
end

#return_asymmetric_subnetsBoolean? (readonly)

Note:

Default: false

Whether to populate the subnetGroups field of the VpcContextResponse, which contains potentially asymmetric subnet groups.

Returns:

  • (Boolean, nil)


75
76
77
# File 'cloud_assembly_schema/vpc_context_query.rb', line 75

def return_asymmetric_subnets
  @return_asymmetric_subnets
end

#return_vpn_gatewaysBoolean? (readonly)

Note:

Default: true

Whether to populate the vpnGatewayId field of the VpcContextResponse, which contains the VPN Gateway ID, if one exists.

You can explicitly disable this in order to avoid the lookup if you know the VPC does not have a VPN Gatway attached.

Returns:

  • (Boolean, nil)


84
85
86
# File 'cloud_assembly_schema/vpc_context_query.rb', line 84

def return_vpn_gateways
  @return_vpn_gateways
end

#subnet_group_name_tagString? (readonly)

Note:

Default: 'aws-cdk:subnet-name'

Optional tag for subnet group name.

If not provided, we'll look at the aws-cdk:subnet-name tag. If the subnet does not have the specified tag, we'll use its type as the name.

Returns:

  • (String, nil)


93
94
95
# File 'cloud_assembly_schema/vpc_context_query.rb', line 93

def subnet_group_name_tag
  @subnet_group_name_tag
end

Class Method Details

.jsii_propertiesObject



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'cloud_assembly_schema/vpc_context_query.rb', line 95

def self.jsii_properties
  {
    :account => "account",
    :region => "region",
    :assume_role_additional_options => "assumeRoleAdditionalOptions",
    :lookup_role_arn => "lookupRoleArn",
    :lookup_role_external_id => "lookupRoleExternalId",
    :filter => "filter",
    :return_asymmetric_subnets => "returnAsymmetricSubnets",
    :return_vpn_gateways => "returnVpnGateways",
    :subnet_group_name_tag => "subnetGroupNameTag",
  }
end

Instance Method Details

#to_jsiiObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'cloud_assembly_schema/vpc_context_query.rb', line 109

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "account" => @account,
    "region" => @region,
    "assumeRoleAdditionalOptions" => @assume_role_additional_options,
    "lookupRoleArn" => @lookup_role_arn,
    "lookupRoleExternalId" => @lookup_role_external_id,
    "filter" => @filter,
    "returnAsymmetricSubnets" => @return_asymmetric_subnets,
    "returnVpnGateways" => @return_vpn_gateways,
    "subnetGroupNameTag" => @subnet_group_name_tag,
  })
  result.compact
end