aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/backends/terraform_aws_controller.rb3
-rw-r--r--app/models/backends/terraform_aws.rb3
-rw-r--r--app/views/backends/terraform_aws/new.html.erb71
-rw-r--r--app/views/backends/terraform_aws/show.html.erb74
-rw-r--r--db/migrate/20180410192329_add_route53_zone_id_to_terraform_aws_backends.rb5
-rw-r--r--db/migrate/20180410192412_add_efs_file_system_id_to_terraform_aws_backends.rb5
-rw-r--r--db/migrate/20180417195307_add_vpc_id_to_terraform_aws_backends.rb5
-rw-r--r--db/structure.sql10
8 files changed, 174 insertions, 2 deletions
diff --git a/app/controllers/backends/terraform_aws_controller.rb b/app/controllers/backends/terraform_aws_controller.rb
index 8eee746..4b49f23 100644
--- a/app/controllers/backends/terraform_aws_controller.rb
+++ b/app/controllers/backends/terraform_aws_controller.rb
@@ -64,6 +64,9 @@ class Backends::TerraformAwsController < ApplicationController
:label,
:domain,
:aws_region,
+ :vpc_id,
+ :route_53_zone_id,
+ :efs_file_system_id,
:aws_access_key_id,
:aws_secret_access_key
)
diff --git a/app/models/backends/terraform_aws.rb b/app/models/backends/terraform_aws.rb
index 45c766b..d45dfc7 100644
--- a/app/models/backends/terraform_aws.rb
+++ b/app/models/backends/terraform_aws.rb
@@ -30,6 +30,9 @@
# created_at :datetime not null
# updated_at :datetime not null
# domain :string
+# route_53_zone_id :string not null
+# efs_file_system_id :string not null
+# vpc_id :string not null
#
require 'ruby_terraform'
diff --git a/app/views/backends/terraform_aws/new.html.erb b/app/views/backends/terraform_aws/new.html.erb
index 57f2b21..04cab8a 100644
--- a/app/views/backends/terraform_aws/new.html.erb
+++ b/app/views/backends/terraform_aws/new.html.erb
@@ -82,6 +82,77 @@ License along with the GOV.UK Mini Environment Admin. If not, see
</div>
<div class="form-group form-group-lg">
+ <%= f.label(
+ :vpc_id,
+ 'VPC ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :vpc_id,
+ class: 'form-control',
+ placeholder: 'The ID of the VPC (Virtual Private Cloud) to use'
+ ) %>
+ <span class="help-block">
+ <p>
+ This VPC (Virtual Private Cloud) should be the one to
+ use for all resources.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
+ <%= f.label(
+ :route_53_zone_id,
+ 'Route 53 Zone ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :route_53_zone_id,
+ class: 'form-control',
+ placeholder: 'The ID of the Route 53 Zone to use'
+ ) %>
+ <span class="help-block">
+ <p>
+ This zone should be authoritive for the domain this
+ backend is using. Entries in this zone will be created
+ for the mini environments.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
+ <%= f.label(
+ :efs_file_system_id,
+ 'EFS File System ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :efs_file_system_id,
+ class: 'form-control',
+ placeholder: 'The ID of the EFS File System to use'
+ ) %>
+ <span class="help-block">
+ <p>
+ This EFS (Elastic File System) is used for the Guix
+ store.
+ </p>
+ <p>
+ It must be used by both this instance of the GOV.UK Mini
+ Environment Admin, and the mini environments created
+ through this backend, so that store items created
+ through this service are available on the mini
+ environment machines when they mount this file system.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
<%= f.label :aws_access_key_id, 'AWS Access Key ID', class: 'col-sm-4 control-label' %>
<div class="col-sm-8">
<%= f.text_field(
diff --git a/app/views/backends/terraform_aws/show.html.erb b/app/views/backends/terraform_aws/show.html.erb
index e707ad4..497d344 100644
--- a/app/views/backends/terraform_aws/show.html.erb
+++ b/app/views/backends/terraform_aws/show.html.erb
@@ -87,6 +87,80 @@ License along with the GOV.UK Mini Environment Admin. If not, see
</div>
<div class="form-group form-group-lg">
+ <%= f.label(
+ :vpc_id,
+ 'VPC ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :vpc_id,
+ class: 'form-control',
+ placeholder: 'The ID of the VPC (Virtual Private Cloud) to use',
+ readonly: true
+ ) %>
+ <span class="help-block">
+ <p>
+ This VPC (Virtual Private Cloud) should be the one to
+ use for all resources.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
+ <%= f.label(
+ :route_53_zone_id,
+ 'Route 53 Zone ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :route_53_zone_id,
+ class: 'form-control',
+ placeholder: 'The ID of the Route 53 Zone to use',
+ readonly: true
+ ) %>
+ <span class="help-block">
+ <p>
+ This zone should be authoritive for the domain this
+ backend is using. Entries in this zone will be created
+ for the mini environments.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
+ <%= f.label(
+ :efs_file_system_id,
+ 'EFS File System ID',
+ class: 'col-sm-4 control-label'
+ ) %>
+ <div class="col-sm-8">
+ <%= f.text_field(
+ :efs_file_system_id,
+ class: 'form-control',
+ placeholder: 'The ID of the EFS File System to use',
+ readonly: true
+ ) %>
+ <span class="help-block">
+ <p>
+ This EFS (Elastic File System) is used for the Guix
+ store.
+ </p>
+ <p>
+ It must be used by both this instance of the GOV.UK Mini
+ Environment Admin, and the mini environments created
+ through this backend, so that store items created
+ through this service are available on the mini
+ environment machines when they mount this file system.
+ </p>
+ </span>
+ </div>
+ </div>
+
+ <div class="form-group form-group-lg">
<%= f.label :aws_access_key_id, 'AWS Access Key ID', class: 'col-sm-4 control-label' %>
<div class="col-sm-8">
<%= f.text_field(
diff --git a/db/migrate/20180410192329_add_route53_zone_id_to_terraform_aws_backends.rb b/db/migrate/20180410192329_add_route53_zone_id_to_terraform_aws_backends.rb
new file mode 100644
index 0000000..6bb7186
--- /dev/null
+++ b/db/migrate/20180410192329_add_route53_zone_id_to_terraform_aws_backends.rb
@@ -0,0 +1,5 @@
+class AddRoute53ZoneIdToTerraformAwsBackends < ActiveRecord::Migration[5.1]
+ def change
+ add_column :terraform_aws_backends, :route_53_zone_id, :string, null: false
+ end
+end
diff --git a/db/migrate/20180410192412_add_efs_file_system_id_to_terraform_aws_backends.rb b/db/migrate/20180410192412_add_efs_file_system_id_to_terraform_aws_backends.rb
new file mode 100644
index 0000000..745bb0f
--- /dev/null
+++ b/db/migrate/20180410192412_add_efs_file_system_id_to_terraform_aws_backends.rb
@@ -0,0 +1,5 @@
+class AddEfsFileSystemIdToTerraformAwsBackends < ActiveRecord::Migration[5.1]
+ def change
+ add_column :terraform_aws_backends, :efs_file_system_id, :string, null: false
+ end
+end
diff --git a/db/migrate/20180417195307_add_vpc_id_to_terraform_aws_backends.rb b/db/migrate/20180417195307_add_vpc_id_to_terraform_aws_backends.rb
new file mode 100644
index 0000000..d1c176d
--- /dev/null
+++ b/db/migrate/20180417195307_add_vpc_id_to_terraform_aws_backends.rb
@@ -0,0 +1,5 @@
+class AddVpcIdToTerraformAwsBackends < ActiveRecord::Migration[5.1]
+ def change
+ add_column :terraform_aws_backends, :vpc_id, :string, null: false
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 602948d..0d56576 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -183,7 +183,10 @@ CREATE TABLE public.terraform_aws_backends (
aws_secret_access_key character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
- domain character varying
+ domain character varying,
+ route_53_zone_id character varying NOT NULL,
+ efs_file_system_id character varying NOT NULL,
+ vpc_id character varying NOT NULL
);
@@ -495,6 +498,9 @@ INSERT INTO "schema_migrations" (version) VALUES
('20180329035512'),
('20180406082851'),
('20180406123612'),
-('20180406124443');
+('20180406124443'),
+('20180410192329'),
+('20180410192412'),
+('20180417195307');