aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/backends/terraform_aws.rb2
-rw-r--r--terraform/aws/mini_environment.tf10
2 files changed, 12 insertions, 0 deletions
diff --git a/app/models/backends/terraform_aws.rb b/app/models/backends/terraform_aws.rb
index bc131ef..020f790 100644
--- a/app/models/backends/terraform_aws.rb
+++ b/app/models/backends/terraform_aws.rb
@@ -68,6 +68,8 @@ class Backends::TerraformAws < ApplicationRecord
def terraform_variables(mini_environment)
{
+ aws_access_key: aws_access_key_id,
+ aws_secret_key: aws_secret_access_key,
aws_region: aws_region,
slug: mini_environment.name.parameterize,
ssh_public_key: ssh_public_key,
diff --git a/terraform/aws/mini_environment.tf b/terraform/aws/mini_environment.tf
index bf3a356..06bc0f3 100644
--- a/terraform/aws/mini_environment.tf
+++ b/terraform/aws/mini_environment.tf
@@ -6,6 +6,14 @@ variable "slug" {
type = "string"
}
+variable "aws_access_key" {
+ type = "string"
+}
+
+variable "aws_secret_key" {
+ type = "string"
+}
+
variable "aws_region" {
type = "string"
}
@@ -19,6 +27,8 @@ variable "start_command" {
}
provider "aws" {
+ access_key = "${var.aws_access_key}"
+ secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}