import os
import sys
import json
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_sdk_core import ApiException
from ibm_schematics.schematics_v1 import SchematicsV1
import base64
import etcd3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import base64 | |
import os | |
import etcd3 | |
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator | |
from ibm_cloud_sdk_core import ApiException | |
from ibm_schematics.schematics_v1 import SchematicsV1 | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import json | |
from pprint import pprint | |
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator | |
from ibm_cloud_sdk_core import ApiException | |
from ibm_schematics.schematics_v1 import SchematicsV1 | |
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator | |
import time |
import os
import sys
import json
from pprint import pprint
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_sdk_core import ApiException
from ibm_schematics.schematics_v1 import SchematicsV1
# Set up IAM authenticator
data.tf
data "ibm_is_ssh_key" "sshkey" {
name = var.existing_ssh_key
}
# Pull in the zones in the region
data "ibm_is_zones" "regional" {
region = var.region
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "security_group_rules" { | |
description = "A list of security group rules to be added to the default vpc security group" | |
type = list( | |
object({ | |
name = string | |
direction = string | |
remote = string | |
tcp = optional( | |
object({ | |
port_max = optional(number) |
providers.tf
Check the IBM Provider page for the latest version available.
terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.49.0"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "ibm_resource_group" "group" { | |
name = var.resource_group | |
} | |
resource "random_string" "admin_password" { | |
length = 16 | |
special = false | |
} | |
locals {
tags = [
"datacenter:${var.datacenter}",
"owner:${var.owner}",
"workspace:${terraform.workspace}",
"provider:ibmcloud"
]
}
resource "ibm_compute_bare_metal" "host" {
package_key_name = "2U_DUAL_INTEL_XEON_E5V4_12_DRIVES"
process_key_name = "INTEL_INTEL_XEON_8260_2_4_1U"
memory = 384
os_key_name = "OS_NO_OPERATING_SYSTEM"
hostname = var.name
domain = var.domain_name
datacenter = var.datacenter
network_speed = var.network_speed