aboutsummaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-23 09:57:03 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-23 12:58:05 +0100
commit837e1ecec9798381f78b838947f8028403cb0bef (patch)
tree984e25f96a490a3cbd1b20d6f50903aa6dacfd1d /app/models
parent0736fd5ab32eeb57de52fb6d581d16c2824b2fc2 (diff)
downloadgovuk-mini-environment-admin-837e1ecec9798381f78b838947f8028403cb0bef.tar
govuk-mini-environment-admin-837e1ecec9798381f78b838947f8028403cb0bef.tar.gz
Handle SSH keys via the database
This makes it more explicit, and works around Terraform being unpredictable when dealing with SSH agents.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/backends/terraform_aws.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/backends/terraform_aws.rb b/app/models/backends/terraform_aws.rb
index 1f16188..026f1e4 100644
--- a/app/models/backends/terraform_aws.rb
+++ b/app/models/backends/terraform_aws.rb
@@ -32,6 +32,8 @@
# domain :string
# route_53_zone_id :string not null
# vpc_id :string not null
+# ssh_public_key :string
+# ssh_private_key :string
#
require 'ruby_terraform'
@@ -164,7 +166,7 @@ class Backends::TerraformAws < ApplicationRecord
aws_access_key: aws_access_key_id,
aws_secret_key: aws_secret_access_key,
aws_region: aws_region,
- ssh_public_key: ssh_public_key,
+ ssh_private_key: ssh_private_key,
aws_route_53_zone_id: route_53_zone_id
}
end
@@ -188,10 +190,6 @@ class Backends::TerraformAws < ApplicationRecord
"backend/terraform_aws/#{id}"
end
- def ssh_public_key
- File.open("#{ENV['HOME']}/.ssh/id_rsa.pub", &:readline)
- end
-
def guix_public_key
"(entry #{File.read("/etc/guix/signing-key.pub")} (tag (guix import)))"
end