class Convection::Model::Template::Resource::EC2RouteTable

AWS::EC2::RouteTable

Public Instance Methods

render(*args) click to toggle source
# 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') click to toggle source
# 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_json(*) click to toggle source
# 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