Class: Convection::Model::Template::Resource::EC2Route

Inherits:
Convection::Model::Template::Resource show all
Defined in:
lib/convection/model/template/resource/aws_ec2_route.rb

Overview

AWS::EC2::Route

Instance Attribute Summary

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, #initialize, properties, property, #property, #reference, #render, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

#_terraform_module_dir_to_flag, #_terraform_module_flag_to_dir, attach_resource, attach_resource_collection, resource_collection_dsl_methods, resource_dsl_methods

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_import_value, #fn_not, #fn_or, #fn_ref, #fn_sub, #get_att, #get_azs, included, #join, mixers, #select

Constructor Details

This class inherits a constructor from Convection::Model::Template::Resource

Instance Method Details

#destinationObject #destination(value) ⇒ Object

Overloads:

  • #destinationObject

    Returns the value of the ‘DestinationCidrBlock’ CloudFormation property.

  • #destination(value) ⇒ Object

    Sets the ‘DestinationCidrBlock’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘DestinationCidrBlock’ CloudFormation property to.



13
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 13

property :destination, 'DestinationCidrBlock'

#gatewayObject #gateway(value) ⇒ Object

Overloads:

  • #gatewayObject

    Returns the value of the ‘GatewayId’ CloudFormation property.

  • #gateway(value) ⇒ Object

    Sets the ‘GatewayId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘GatewayId’ CloudFormation property to.



14
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 14

property :gateway, 'GatewayId'

#instanceObject #instance(value) ⇒ Object

Overloads:

  • #instanceObject

    Returns the value of the ‘InstanceId’ CloudFormation property.

  • #instance(value) ⇒ Object

    Sets the ‘InstanceId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘InstanceId’ CloudFormation property to.



16
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 16

property :instance, 'InstanceId'

#interfaceObject #interface(value) ⇒ Object

Overloads:

  • #interfaceObject

    Returns the value of the ‘NetworkInterfaceId’ CloudFormation property.

  • #interface(value) ⇒ Object

    Sets the ‘NetworkInterfaceId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘NetworkInterfaceId’ CloudFormation property to.



17
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 17

property :interface, 'NetworkInterfaceId'

#nat_gatewayObject #nat_gateway(value) ⇒ Object

Overloads:

  • #nat_gatewayObject

    Returns the value of the ‘NatGatewayId’ CloudFormation property.

  • #nat_gateway(value) ⇒ Object

    Sets the ‘NatGatewayId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘NatGatewayId’ CloudFormation property to.



15
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 15

property :nat_gateway, 'NatGatewayId'

#peerObject #peer(value) ⇒ Object

Overloads:

  • #peerObject

    Returns the value of the ‘VpcPeeringConnectionId’ CloudFormation property.

  • #peer(value) ⇒ Object

    Sets the ‘VpcPeeringConnectionId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘VpcPeeringConnectionId’ CloudFormation property to.



18
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 18

property :peer, 'VpcPeeringConnectionId'

#route_table_idObject #route_table_id(value) ⇒ Object

Overloads:

  • #route_table_idObject

    Returns the value of the ‘RouteTableId’ CloudFormation property.

  • #route_table_id(value) ⇒ Object

    Sets the ‘RouteTableId’ CloudFormation property.

    Parameters:

    • value

      the value to set the ‘RouteTableId’ CloudFormation property to.



12
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 12

property :route_table_id, 'RouteTableId'

#terraform_import_commandsObject



42
43
44
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 42

def terraform_import_commands(*)
  ['# Route import is not supported by Terraform.']
end

#to_hcl_jsonObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/convection/model/template/resource/aws_ec2_route.rb', line 20

def to_hcl_json(*)
  tf_record_attrs = {
    route_table_id: route_table_id,
    destination_cidr_block: destination,
    vpc_peering_connection_id: peer,
    gateway_id: gateway,
    nat_gateway_id: nat_gateway,
    instance_id: instance,
    network_interface_id: interface
  }

  tf_record_attrs.reject! { |_, v| v.nil? }

  tf_record = {
    aws_route: {
      name.underscore => tf_record_attrs
    }
  }

  { resource: tf_record }.to_json
end