Skip to content

Instantly share code, notes, and snippets.

@makotom
Created February 10, 2020 05:52
Show Gist options
  • Save makotom/50fc788948a95b57c57b64c8f9d222f5 to your computer and use it in GitHub Desktop.
Save makotom/50fc788948a95b57c57b64c8f9d222f5 to your computer and use it in GitHub Desktop.
Setup circleci/enterprise-setup to work with MFA
diff --git a/circleci.tf b/circleci.tf
index 6bbb296..f8c304a 100644
--- a/circleci.tf
+++ b/circleci.tf
@@ -45,6 +45,7 @@ data "template_file" "output" {
provider "aws" {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
+ token = var.aws_session_token
region = var.aws_region
}
diff --git a/terraform.tfvars.template b/terraform.tfvars.template
index bb9da3f..113ebd9 100644
--- a/terraform.tfvars.template
+++ b/terraform.tfvars.template
@@ -4,6 +4,7 @@
aws_access_key = "..."
aws_secret_key = "..."
+aws_session_token = "..."
aws_region = "..."
aws_vpc_id = "..."
aws_subnet_id = "..."
diff --git a/variables.tf b/variables.tf
index e55f75b..9317f93 100644
--- a/variables.tf
+++ b/variables.tf
@@ -6,6 +6,10 @@ variable "aws_secret_key" {
description = "Secret key used to create instances"
}
+variable "aws_session_token" {
+ description = "Session token used to create instances - required for environments with MFA enforced"
+}
+
variable "aws_region" {
description = "Region where instances get created"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment