Here we are adding the first forking logic into the subnet_nexus.rb. To be able to provision a private subnet like thing in AWS, we need the following resources: - VPC - Subnet in that VPC - Security Group to be able to manage firewalls - InternetGateway to be able to access public network - RouteTable to be able to manage the traffic in the vpc. All of these resources are created in a controlled manner in a different file so that the main logic in the nexus.rb files are left separate.
23 lines
606 B
Ruby
23 lines
606 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../model"
|
|
|
|
class PrivateSubnetAwsResource < Sequel::Model
|
|
many_to_one :private_subnet, key: :id
|
|
|
|
include ResourceMethods
|
|
end
|
|
|
|
# Table: private_subnet_aws_resource
|
|
# Columns:
|
|
# id | uuid | PRIMARY KEY
|
|
# vpc_id | text |
|
|
# subnet_id | text |
|
|
# internet_gateway_id | text |
|
|
# route_table_id | text |
|
|
# security_group_id | text |
|
|
# Indexes:
|
|
# private_subnet_aws_resource_pkey | PRIMARY KEY btree (id)
|
|
# Foreign key constraints:
|
|
# private_subnet_aws_resource_id_fkey | (id) REFERENCES private_subnet(id)
|