class Convection::Model::Template::Resource::EC2Route

AWS::EC2::Route

Public Instance Methods

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