Skip to content
Merged
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
91 changes: 89 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2024-04-08T15:16:34Z",
"generated_at": "2025-03-14T12:32:22Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -76,7 +76,94 @@
"name": "TwilioKeyDetector"
}
],
"results": {},
"results": {
"samples/configs/hpc_catalog_values.json": [
{
"hashed_secret": "5073c7ac17500ef0678aebc7138a996b4f75d623",
"is_secret": true,
"is_verified": false,
"line_number": 2,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c",
"is_secret": true,
"is_verified": false,
"line_number": 50,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "b295b04949a98dc50ba65adcddd588077b93ab3c",
"is_secret": true,
"is_verified": false,
"line_number": 66,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/custom/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 85,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/hpcaas/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 69,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/lsf/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 69,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/scale/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 63,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/slurm/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 69,
"type": "Secret Keyword",
"verified_result": null
}
],
"solutions/symphony/override.json": [
{
"hashed_secret": "850264135744c21e30d6336ed7bf047d2e82af8b",
"is_secret": true,
"is_verified": false,
"line_number": 69,
"type": "Secret Keyword",
"verified_result": null
}
]
},
"version": "0.13.1+ibm.62.dss",
"word_list": {
"file": null,
Expand Down
33 changes: 17 additions & 16 deletions datasource.tf
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
# Future use
/*
data "ibm_is_region" "itself" {
data "ibm_is_region" "region" {
name = local.region
}

data "ibm_is_zone" "itself" {
data "ibm_is_zone" "zone" {
name = var.zones[0]
region = data.ibm_is_region.itself.name
region = data.ibm_is_region.region.name
}
*/

data "ibm_is_vpc" "itself" {
count = var.vpc == null ? 0 : 1
name = var.vpc
data "ibm_is_vpc" "existing_vpc" {
count = var.vpc_name != null ? 1 : 0
name = var.vpc_name
}

/*
data "ibm_is_subnet" "itself" {
data "ibm_is_subnet" "subnet" {
count = length(local.subnets)
identifier = local.subnets[count.index]["id"]
}
*/

data "ibm_resource_group" "resource_group" {
count = var.resource_group == null ? 0 : 1
name = var.resource_group
data "ibm_resource_group" "existing_resource_group" {
count = var.existing_resource_group == null ? 0 : 1
name = var.existing_resource_group
}

data "ibm_is_subnet" "existing_compute_subnets" {
count = var.vpc != null && var.compute_subnets != null ? 1 : 0
count = var.vpc_name != null && var.compute_subnets != null ? 1 : 0
name = var.compute_subnets[count.index]
}

data "ibm_is_subnet" "existing_storage_subnets" {
count = var.vpc != null && var.storage_subnets != null ? 1 : 0
count = var.vpc_name != null && var.storage_subnets != null ? 1 : 0
name = var.storage_subnets[count.index]
}

data "ibm_is_subnet" "existing_protocol_subnets" {
count = var.vpc != null && var.protocol_subnets != null ? 1 : 0
count = var.vpc_name != null && var.protocol_subnets != null ? 1 : 0
name = var.protocol_subnets[count.index]
}

data "ibm_is_subnet" "existing_client_subnets" {
count = var.vpc != null && var.client_subnets != null ? 1 : 0
count = var.vpc_name != null && var.client_subnets != null ? 1 : 0
name = var.client_subnets[count.index]
}

data "ibm_is_subnet" "existing_bastion_subnets" {
count = var.vpc != null && var.bastion_subnets != null ? 1 : 0
count = var.vpc_name != null && var.bastion_subnets != null ? 1 : 0
name = var.bastion_subnets[count.index]
}
}
4 changes: 2 additions & 2 deletions examples/create_vpc/modules/landing_zone_vpc/datasource.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "ibm_resource_group" "itself" {
name = var.resource_group
data "ibm_resource_group" "existing_resource_group" {
name = var.existing_resource_group
}
2 changes: 1 addition & 1 deletion examples/create_vpc/modules/landing_zone_vpc/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ locals {
var.allowed_cidr
# var.network_cidr
])
resource_group_id = var.resource_group != null ? data.ibm_resource_group.itself.id : ""
resource_group_id = var.existing_resource_group != null ? data.ibm_resource_group.existing_resource_group.id : ""

# Region and Zone calculations
region = join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variable "ibmcloud_api_key" {
# Resource Groups Variables
##############################################################################

variable "resource_group" {
variable "existing_resource_group" {
description = "String describing resource groups to create or reference"
type = string
default = null
Expand Down
2 changes: 1 addition & 1 deletion examples/create_vpc/modules/landing_zone_vpc/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3"
required_version = ">= 1.9.0"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
Expand Down
22 changes: 11 additions & 11 deletions examples/create_vpc/solutions/hpc/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module "create_vpc" {
source = "../../modules/landing_zone_vpc"
allowed_cidr = var.remote_allowed_ips
ibmcloud_api_key = var.ibmcloud_api_key
ssh_keys = var.bastion_ssh_keys
prefix = var.cluster_prefix
resource_group = var.resource_group
zones = var.zones
network_cidr = var.vpc_cidr
bastion_subnets_cidr = var.vpc_cluster_login_private_subnets_cidr_blocks
compute_subnets_cidr = var.vpc_cluster_private_subnets_cidr_blocks
enable_hub = var.enable_hub
source = "../../modules/landing_zone_vpc"
allowed_cidr = var.remote_allowed_ips
ibmcloud_api_key = var.ibmcloud_api_key
ssh_keys = var.bastion_ssh_keys
prefix = var.cluster_prefix
existing_resource_group = var.existing_resource_group
zones = var.zones
network_cidr = var.vpc_cidr
bastion_subnets_cidr = var.vpc_cluster_login_private_subnets_cidr_blocks
compute_subnets_cidr = var.vpc_cluster_private_subnets_cidr_blocks
enable_hub = var.enable_hub
}
6 changes: 3 additions & 3 deletions examples/create_vpc/solutions/hpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ variable "ibmcloud_api_key" {
# Resource Groups Variables
##############################################################################

variable "resource_group" {
variable "existing_resource_group" {
description = "Resource group name from your IBM Cloud account where the VPC resources should be deployed. Note. If the resource group value is set as null, automation creates two different RG with the name (workload-rg and service-rg). For additional information on resource groups, see [Managing resource groups](https://cloud.ibm.com/docs/account?topic=account-rgs)."
type = string
default = "Default"
validation {
condition = var.resource_group != null
error_message = "If you want to provide null for resource_group variable, it should be within double quotes."
condition = var.existing_resource_group != null
error_message = "If you want to provide null for existing_resource_group variable, it should be within double quotes."
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/create_vpc/solutions/hpc/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3"
required_version = ">= 1.9.0"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
Expand Down
Loading