Skip to content

Commit

Permalink
Fixing examples integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikchern committed Oct 7, 2021
1 parent abf0ff4 commit 0d58803
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 138 deletions.
2 changes: 1 addition & 1 deletion examples/config/cluster/cluster-eks-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: eks-dev
cloud_account: dev-030
profiles:
infra:
name: EKS-Base
name: profile_infra
packs:
- name: kubernetes-eks
version: "1.20"
Expand Down
4 changes: 2 additions & 2 deletions examples/config/profile/profile-addon-1.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: profile_addon
description: profile_addon
name: addon-profile-1
description: addon-profile-1
type: add-on
defaultRepoURL: "${REPO_URL}"

Expand Down
25 changes: 7 additions & 18 deletions examples/mod_spectro_org.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
/*module "fetcher_accounts" {
source = "./modules/fetcher"
rsubfolder = local.accounts_folder
rprefix = "account-"
}*/

locals {
accounts_params = { ACCOUNT_DEV_NAME = "ehs-dev-030", ACCOUNT_PROD_NAME = "ehs-stg-004" }
accounts_params = { ACCOUNT_DEV_NAME = "dev-030", ACCOUNT_PROD_NAME = "ehs-stg-004" }

bsl_params = { BSL_NAME = "qa-sharma" }

Expand All @@ -30,17 +24,12 @@ locals {
}

module "SpectroOrg" {
source = "../"
sc_host = "api.stage.spectrocloud.com" #e.g: api.spectrocloud.com (for SaaS)
sc_username = "[email protected]" #e.g: [email protected]
sc_password = "welcome2Spectr0!1" #e.g: supereSecure1!
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

/*accounts = tomap({
for k, v in module.fetcher_accounts.object_files :
k => yamldecode(templatefile(join("", [local.accounts_folder, "/${k}"]), local.accounts_params))
})*/

accounts = {
for k in fileset("config/account", "account-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/account/${k}", local.accounts_params))
Expand All @@ -67,7 +56,7 @@ module "SpectroOrg" {
}

clusters = {
for k in fileset("config/cluster", "team-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(templatefile("config/project/${k}", {}))
for k in fileset("config/cluster", "cluster-eks-*.yaml") :
trimsuffix(k, ".yaml") => yamldecode(file("config/cluster/${k}"))
}
}
32 changes: 0 additions & 32 deletions examples/modules/fetch_replace/main.tf

This file was deleted.

15 changes: 0 additions & 15 deletions examples/modules/fetch_replace/output.tf

This file was deleted.

9 changes: 0 additions & 9 deletions examples/modules/fetch_replace/variables.tf

This file was deleted.

28 changes: 0 additions & 28 deletions examples/modules/fetcher/main.tf

This file was deleted.

3 changes: 0 additions & 3 deletions examples/modules/fetcher/output.tf

This file was deleted.

9 changes: 0 additions & 9 deletions examples/modules/fetcher/variables.tf

This file was deleted.

5 changes: 0 additions & 5 deletions examples/modules/replacer/main.tf

This file was deleted.

3 changes: 0 additions & 3 deletions examples/modules/replacer/output.tf

This file was deleted.

9 changes: 0 additions & 9 deletions examples/modules/replacer/variables.tf

This file was deleted.

2 changes: 1 addition & 1 deletion examples/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variable "sc_username" {

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

variable "sc_project_name" {
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variable "sc_username" {

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

variable "sc_project_name" {
Expand Down
4 changes: 4 additions & 0 deletions spectro-aws-account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ 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
6 changes: 5 additions & 1 deletion spectro-profile.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ 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" "infra" {
resource "spectrocloud_cluster_profile" "profile_resource" {
for_each = var.profiles
name = each.value.name
description = each.value.description
Expand Down
4 changes: 4 additions & 0 deletions spectro-s3-sts-backup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ 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
1 change: 0 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ variable "teams" {
}

variable "clusters" {
type = map(any)
default = {}
}

0 comments on commit 0d58803

Please sign in to comment.