Skip to content

Commit

Permalink
Removing depends on block
Browse files Browse the repository at this point in the history
  • Loading branch information
rishi-anand committed Oct 7, 2021
1 parent a291c33 commit a5025fd
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ terraform.tfvars

kubeconfig_*


.local
local
# Include override files you do wish to add to version control using negated pattern
Expand Down
49 changes: 20 additions & 29 deletions examples/mod_spectro_org.tf
Original file line number Diff line number Diff line change
@@ -1,62 +1,53 @@
locals {
accounts_params = { ACCOUNT_DEV_NAME = "dev-030", ACCOUNT_PROD_NAME = "ehs-stg-004" }

bsl_params = { BSL_NAME = "qa-sharma" }

accounts_params = { ACCOUNT_DEV_NAME = "ehs-dev-030", ACCOUNT_PROD_NAME = "ehs-stg-004" }
bsl_params = { BSL_NAME = "qa-sharma" }
profile_params = {
SPECTRO_REPO_URL = "https://registry.spectrocloud.com",
REPO_URL = "593235963820.dkr.ecr.us-west-2.amazonaws.com",

OIDC_CLIENT_ID = "5ajs8pq0gatbgpjejld96fldrn",
OIDC_ISSUER_URL = "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ajvPoziaS",

RABBITMQ_PACK_VERSION = "8.15.2",

string = "$${string}",

SPECTRO_REPO_URL = "https://registry.spectrocloud.com",
REPO_URL = "593235963820.dkr.ecr.us-west-2.amazonaws.com",
OIDC_CLIENT_ID = "5ajs8pq0gatbgpjejld96fldrn",
OIDC_ISSUER_URL = "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ajvPoziaS",
RABBITMQ_PACK_VERSION = "8.15.2",
string = "$${string}",
ADDON_SPECTRO_REPO_URL = "https://addon-registry.gehc.spectrocloud.com",
}

projects_params = {}

clusters_params = {}

}

module "SpectroOrg" {
source = "github.com/spectrocloud/terraform-spectrocloud-modules"
sc_host = "" #e.g: api.spectrocloud.com (for SaaS)
sc_username = "" #e.g: [email protected]
sc_password = "" #e.g: supereSecure1!
sc_project_name = "Default" #e.g: Default
source = "github.com/spectrocloud/terraform-spectrocloud-modules"

accounts = {
for k in fileset("config/account", "account-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/account/${k}", local.accounts_params))
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/account/${k}", local.accounts_params))
}

bsls = {
for k in fileset("config/bsl", "bsl-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/bsl/${k}", local.bsl_params))
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/bsl/${k}", local.bsl_params))
}

profiles = {
for k in fileset("config/profile", "profile-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/profile/${k}", local.profile_params))
}

projects ={
projects = {
for k in fileset("config/project", "project-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", local.projects_params))
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", local.projects_params))
}

teams = {
for k in fileset("config/project", "team-*.yaml") :
for k in fileset("config/project", "team-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", {}))
}
}

module "SpectroProject" {
source = "github.com/spectrocloud/terraform-spectrocloud-modules"

clusters = {
for k in fileset("config/cluster", "cluster-eks-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(file("config/cluster/${k}"))
for k in fileset("config/cluster", "cluster-eks-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/cluster/${k}", {}))
}
}
26 changes: 0 additions & 26 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,3 @@ terraform {
}
}
}

variable "sc_host" {
description = "Spectro Cloud Endpoint"
default = "api.spectrocloud.com"
}

variable "sc_username" {
description = "Spectro Cloud Username"
}

variable "sc_password" {
description = "Spectro Cloud Password"
//sensitive = true
}

variable "sc_project_name" {
description = "Spectro Cloud Project (e.g: Default)"
default = "Default"
}

provider "spectrocloud" {
host = var.sc_host
username = var.sc_username
password = var.sc_password
project_name = var.sc_project_name
}
4 changes: 0 additions & 4 deletions spectro-aws-account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ data "spectrocloud_cloudaccount_aws" "this" {
for_each = local.cloud_account_names

name = each.value

depends_on = [
resource.spectrocloud_cloudaccount_aws.account
]
}

resource "spectrocloud_cloudaccount_aws" "account" {
Expand Down
4 changes: 0 additions & 4 deletions spectro-profile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ data "spectrocloud_cluster_profile" "this" {
for_each = local.profile_names

name = each.value

depends_on = [
resource.spectrocloud_cluster_profile.profile_resource
]
}

resource "spectrocloud_cluster_profile" "profile_resource" {
Expand Down
3 changes: 0 additions & 3 deletions spectro-project.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
locals {

project_ids = {
for k, v in spectrocloud_project.project :
v.name => v.id
}

}


resource "spectrocloud_project" "project" {
for_each = var.projects

Expand Down
4 changes: 0 additions & 4 deletions spectro-s3-sts-backup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ data "spectrocloud_backup_storage_location" "this" {
for_each = local.bsl_names

name = each.value

depends_on = [
resource.spectrocloud_backup_storage_location.bsl
]
}

resource "spectrocloud_backup_storage_location" "bsl" {
Expand Down
8 changes: 0 additions & 8 deletions spectro-teams.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ data "spectrocloud_role" "data_roles" {
name = each.value
}

output "test" {
value = var.teams
}

output "test2" {
value = data.spectrocloud_role.data_roles
}

locals {
project_roles = distinct(flatten([
for v in var.teams : [
Expand Down
5 changes: 0 additions & 5 deletions terraform.template.tfvars

This file was deleted.

0 comments on commit a5025fd

Please sign in to comment.