Skip to content

Commit

Permalink
Update variable names for IDP in Terraform configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MU-Software committed May 19, 2024
1 parent a26d06d commit d75ae22
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
11 changes: 5 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ variable "tfc_organization_name" { type = string }
variable "tfc_project_name" { type = string }
variable "tfc_workspace_name" { type = string }

variable "idp_run_role_arn" { type = string }
variable "idp_client_id" { type = string }
variable "vultr_api_key" { type = string }
variable "aws_idp_run_role_arn" { type = string }
variable "aws_idp_client_id" { type = string }

variable "default_db_username" { type = string }

variable "vultr_api_key" { type = string }

module "cloudflare" {
source = "./server/cloudflare"
}
Expand All @@ -34,8 +33,8 @@ module "mudev_aws_1" {
tfc_project_name = var.tfc_project_name
tfc_workspace_name = var.tfc_workspace_name

idp_run_role_arn = var.idp_run_role_arn
idp_client_id = var.idp_client_id
aws_idp_run_role_arn = var.aws_idp_run_role_arn
aws_idp_client_id = var.aws_idp_client_id

default_db_username = var.default_db_username
}
Expand Down
4 changes: 2 additions & 2 deletions server/mudev-aws-1/infrastructures/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "iam" {
tfc_project_name = var.tfc_project_name
tfc_workspace_name = var.tfc_workspace_name

idp_run_role_arn = var.idp_run_role_arn
idp_client_id = var.idp_client_id
aws_idp_run_role_arn = var.aws_idp_run_role_arn
aws_idp_client_id = var.aws_idp_client_id
}

module "resources" {
Expand Down
4 changes: 2 additions & 2 deletions server/mudev-aws-1/infrastructures/modules/iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ variable "tfc_organization_name" { type = string }
variable "tfc_project_name" { type = string }
variable "tfc_workspace_name" { type = string }

variable "idp_run_role_arn" { type = string }
variable "idp_client_id" { type = string }
variable "aws_idp_run_role_arn" { type = string }
variable "aws_idp_client_id" { type = string }
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ data "aws_iam_policy_document" "iam_policy_doc_terraform_cloud" {
effect = "Allow"

principals {
identifiers = [var.idp_run_role_arn]
identifiers = [var.aws_idp_run_role_arn]
type = "Federated"
}

condition {
test = "StringEquals"
variable = "app.terraform.io:aud"
values = [var.idp_client_id]
values = [var.aws_idp_client_id]
}

condition {
Expand All @@ -32,7 +32,7 @@ resource "aws_iam_role" "iam_role_terraform_cloud" {

resource "aws_iam_openid_connect_provider" "terraform" {
url = "https://app.terraform.io"
client_id_list = [var.idp_client_id]
client_id_list = [var.aws_idp_client_id]
thumbprint_list = ["9e99a48a9960b14926bb7f3b02e22da2b0ab7280"]
tags = { Terraform = "true" }
}
4 changes: 2 additions & 2 deletions server/mudev-aws-1/infrastructures/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ variable "tfc_organization_name" { type = string }
variable "tfc_project_name" { type = string }
variable "tfc_workspace_name" { type = string }

variable "idp_run_role_arn" { type = string }
variable "idp_client_id" { type = string }
variable "aws_idp_run_role_arn" { type = string }
variable "aws_idp_client_id" { type = string }

variable "default_db_username" { type = string }

Expand Down

0 comments on commit d75ae22

Please sign in to comment.