aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-03 13:06:30 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-03 14:09:13 +0100
commit93c1c6e5b76ed712f6c5107c6a124025279996d6 (patch)
tree9744ed6a454e8d5ba69657e4ad5fdd699b726b25 /app
parentf74331a8e6d5b0ae9c2c73a36ba19730752269aa (diff)
downloadgovuk-mini-environment-admin-93c1c6e5b76ed712f6c5107c6a124025279996d6.tar
govuk-mini-environment-admin-93c1c6e5b76ed712f6c5107c6a124025279996d6.tar.gz
Change how the EFS File System is handled
For the AWS backend. Bring it in to the Terraform configuration for the backend, where previously only the id was known. Also, alter the provisioning so that it can handle an empty EFS file system. This reduces the amount of manual setup required for AWS.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/backends/terraform_aws_controller.rb1
-rw-r--r--app/models/backends/terraform_aws.rb5
-rw-r--r--app/views/backends/terraform_aws/new.html.erb28
-rw-r--r--app/views/backends/terraform_aws/show.html.erb29
4 files changed, 2 insertions, 61 deletions
diff --git a/app/controllers/backends/terraform_aws_controller.rb b/app/controllers/backends/terraform_aws_controller.rb
index 4b49f23..6e8ed55 100644
--- a/app/controllers/backends/terraform_aws_controller.rb
+++ b/app/controllers/backends/terraform_aws_controller.rb
@@ -66,7 +66,6 @@ class Backends::TerraformAwsController < ApplicationController
: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 e448cd8..d5abfee 100644
--- a/app/models/backends/terraform_aws.rb
+++ b/app/models/backends/terraform_aws.rb
@@ -31,7 +31,6 @@
# 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
#
@@ -107,6 +106,7 @@ class Backends::TerraformAws < ApplicationRecord
vars: common_terraform_variables.merge(
aws_vpc_id: vpc_id,
ssh_public_key: ssh_public_key,
+ backend_slug: label.parameterize,
mini_environment_admin_guix_public_key: guix_public_key,
mini_environment_admin_public_ip_address: public_ip_address
),
@@ -132,8 +132,7 @@ class Backends::TerraformAws < ApplicationRecord
aws_secret_key: aws_secret_access_key,
aws_region: aws_region,
ssh_public_key: ssh_public_key,
- aws_route_53_zone_id: route_53_zone_id,
- aws_efs_file_system_id: efs_file_system_id
+ aws_route_53_zone_id: route_53_zone_id
}
end
diff --git a/app/views/backends/terraform_aws/new.html.erb b/app/views/backends/terraform_aws/new.html.erb
index 04cab8a..fbd26a1 100644
--- a/app/views/backends/terraform_aws/new.html.erb
+++ b/app/views/backends/terraform_aws/new.html.erb
@@ -125,34 +125,6 @@ License along with the GOV.UK Mini Environment Admin. If not, see
</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 f542cff..6204d96 100644
--- a/app/views/backends/terraform_aws/show.html.erb
+++ b/app/views/backends/terraform_aws/show.html.erb
@@ -132,35 +132,6 @@ License along with the GOV.UK Mini Environment Admin. If not, see
</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(