Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
# # Create Stackguardian Workflow Group
# ################################
module "stackguardian_workflow_group" {
for_each = toset(var.workflow_groups)
for_each = var.workflow_groups != null ? toset(var.workflow_groups) : []
source = "./stackguardian_workflow_group"
api_key = var.api_key
org_name = var.org_name
Expand All @@ -17,7 +17,7 @@ module "stackguardian_workflow_group" {
# # Create Stackguardian cloud connector
# ################################
module "stackguardian_connector_cloud" {
for_each = { for c in var.cloud_connectors : c.name => c }
for_each = var.cloud_connectors != null ? { for c in var.cloud_connectors : c.name => c } : {}
source = "./stackguardian_connector_cloud"
cloud_connector_name = each.key
connector_type = each.value.connector_type
Expand All @@ -33,6 +33,7 @@ module "stackguardian_connector_cloud" {


module "vcs_connector" {
count = var.vcs_connectors != null ? 1 : 0
source = "./stackguardian_connector_vcs"
vcs_connectors = var.vcs_connectors
api_key = var.api_key
Expand All @@ -44,6 +45,7 @@ module "vcs_connector" {
# Create Stackguardian Role
################################
module "stackguardian_role" {
count = var.role_name != null ? 1 : 0
source = "./stackguardian_role"
api_key = var.api_key
org_name = var.org_name
Expand All @@ -59,6 +61,7 @@ module "stackguardian_role" {
# # Create Stackguardian role assignment
# ################################
module "stackguardian_role_assignment" {
count = var.user_or_group != null ? 1 : 0
source = "./stackguardian_role_assignment"
api_key = var.api_key
org_name = var.org_name
Expand Down
21 changes: 13 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ variable "org_name" {
variable "workflow_groups" {
type = list(string)
description = "List of StackGuardian workflow groups"
default = null
}
########## StackGuardian AWS Cloud Connector (here with RBAC) ##########

Expand All @@ -38,43 +39,45 @@ variable "cloud_connectors" {
}))
description = "List of cloud connectors to be created"

default = [
default = null
/*
[
{
name = "aws-connector-1"
connector_type = "AWS_RBAC"
role_arn = "arn:aws:iam::123456789012:role/StackGuardianRole"
aws_role_external_id = "test-org:1234567"
}
]
*/
}

########## StackGuardian Role ##########

variable "role_name" {
type = string
description = "name of the aws role thats getting created"
default = null
}

variable "template_list" {
type = list(string)
description = "The list of templates on StackGuardian platform that you want to work with"

validation {
condition = length(var.template_list) > 0
error_message = "At least one template must be specified."
}
default = []
}

variable "user_or_group" {
type = string
description = "Group or User that should be onboarded"
default = null
#Format: sso-auth/email (email in SSO), sso-auth/group-id (Group in SSO), email (Email via local login)
#Example: "test-org-1/user@stackguardian.com" or "test-org-1/9djhd38cniwje9jde" or "user@stackguardian.com"
}

variable "entity_type" {
type = string
description = "Type of entity that should be onboarded. Valid values: EMAIL or GROUP"
default = null
}

###########################################
Expand Down Expand Up @@ -134,7 +137,8 @@ variable "armClientSecret" {
variable "vcs_connectors" {
type = map(any)
description = "List of version control systems"
default = {
default = null
/*{
vcs_bitbucket = {
kind = "BITBUCKET_ORG"
name = "bitbucket-connector"
Expand All @@ -144,7 +148,8 @@ variable "vcs_connectors" {
}
}]
}
}
}
*/
}

/*
Expand Down