Sha256: 937ea9aa04bfd9f2d4ee8b0559508f175fece4e0945872e946e6a5c9ac2b731e

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::EC2::Route
        ##
        class EC2Route < Resource
          type 'AWS::EC2::Route'
          property :route_table_id, 'RouteTableId'
          property :destination, 'DestinationCidrBlock'
          property :gateway, 'GatewayId'
          property :nat_gateway, 'NatGatewayId'
          property :instance, 'InstanceId'
          property :interface, 'NetworkInterfaceId'
          property :peer, 'VpcPeeringConnectionId'

          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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
convection-2.3.1 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.3.0 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.29 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.28.pre.beta.2 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.28.pre.beta.1 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.27 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.26 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.25 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.24 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.23 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.22 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.21 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.20 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.19 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.18 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.17 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.16 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.15 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.14 lib/convection/model/template/resource/aws_ec2_route.rb
convection-2.2.13 lib/convection/model/template/resource/aws_ec2_route.rb