Class: Convection::Model::Template::Resource::EC2RouteTable

Inherits:
Convection::Model::Template::Resource show all
Includes:
DSL::Template::Resource::EC2RouteTable, Mixin::Taggable
Defined in:
lib/convection/model/template/resource/aws_ec2_route_table.rb

Overview

AWS::EC2::RouteTable

Instance Attribute Summary

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

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

Instance Method Summary collapse

Methods included from Mixin::Taggable

#immutable_metadata, #render_tags, #tag, #tags

Methods included from DSL::Template::Resource::EC2RouteTable

#route

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

#as_attribute, attach_method, #deletion_policy, #depends_on, #initialize, properties, property, #property, #reference, 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

#render(*args) ⇒ Object



36
37
38
39
40
# File 'lib/convection/model/template/resource/aws_ec2_route_table.rb', line 36

def render(*args)
  super.tap do |resource|
    render_tags(resource)
  end
end

#terraform_import_commands(module_path: 'root') ⇒ Object



61
62
63
64
65
66
67
# File 'lib/convection/model/template/resource/aws_ec2_route_table.rb', line 61

def terraform_import_commands(module_path: 'root')
  prefix = "#{module_path}." unless module_path == 'root'
  resource_id = stack.resources[name] && stack.resources[name].physical_resource_id
  commands = ['# Import the Route Table record:']
  commands << "terraform import #{prefix}aws_route_table.#{name.underscore} #{resource_id}"
  commands
end

#to_hcl_jsonObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/convection/model/template/resource/aws_ec2_route_table.rb', line 42

def to_hcl_json(*)
  tf_record_tags = tags.reject { |_, v| v.nil? }

  tf_record_attrs = {
    vpc_id: vpc,
    tags: tf_record_tags
  }

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

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

  { resource: tf_record }.to_json
end

#vpcObject #vpc(value) ⇒ Object

Overloads:

  • #vpcObject

    Returns the value of the ‘VpcId’ CloudFormation property.

  • #vpc(value) ⇒ Object

    Sets the ‘VpcId’ CloudFormation property.

    Parameters:

    • value

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



34
# File 'lib/convection/model/template/resource/aws_ec2_route_table.rb', line 34

property :vpc, 'VpcId'