https://github.kyndryl.net/MCMP-Integrations/cb-int-configurations/blob/master/IBMCLOUD/provider-adapter/provider_adapter.json
https://github.kyndryl.net/MCMP-Integrations/cb-int-configurations/tree/master/IBMCLOUD/queue-subscriptions
provider <provider_name_on_terraform> {}
provider aws { region = “us-east-1” }
provider google { region = “asia-east-1” }
provider alicloud { profile = default region = ap-south-1 }
provider azurerm { features {} }
provider ibm {}
resource "aws_instance" "web" { ami = "ami-a0cfeed8" instance_type = "t2.micro" user_data = file("init-script.sh") tags = { Name = random_pet.name.id } }
resource "aws_instance" "example_a" { ami = data.aws_ami.amazon_linux.id instance_type = "t2.micro" } resource "aws_instance" "example_b" { ami = data.aws_ami.amazon_linux.id instance_type = "t2.micro" } resource "aws_eip" "ip" { vpc = true instance = aws_instance.example_a.id }
resource "ibm_security_group" "sg_public_lamp" { name = "sg_public_lamp" description = "Public access for LAMP stack to repos" } resource "ibm_security_group_rule" "https-pub" { direction = "egress" ether_type = "IPv4" port_range_min = 443 port_range_max = 443 protocol = "tcp" security_group_id = [ibm_security_group.sg_public_lamp.id] depends_on = [ibm_security_group.sg_public_lamp] }
data "ibm_dns_domain_registration" "dns-domain-test" { name = "test-domain.com" } resource "ibm_dns_domain_registration_nameservers" "dns-domain-test" { dns_registration_id = data.ibm_dns_domain_registration.dns-domain-test.id name_servers = [ "ns006.name.ibm.cloud.com", "ns017.name.ibm.cloud.com"] }
variable private_key { default = "" } resource "ibm_compute_vm_instance" "vm1" { hostname = "vmremote-exec" domain = "example.com" os_reference_code = "CENTOS_8_64" datacenter = "dal09" network_speed = 100 cores = 1 memory = 1024 disks = [25] provisioner "remote-exec" { inline = [ "mkdir -p /root/test-directory" ] connection { type = "ssh" user = "root" host = self.ipv4_address private_key = var.private_key } } }
Tenant code | Terraform code |
---|---|
ibmcloud | ibm |
aws | aws |
azure | azurerm |
alicloud | alicloud |
gcp | google |
provider ibm {} resource ibm_compute_vm_instance vm1 { hostname = “test1” domain = “test.co” } resource ibm_compute_vm_instance vm2 { hostname = “test2” domain = “test.co” } resource ibm_security_group secGrp { name = “testSecGrp” }
Configuration Group Name: Ibm compute vm instance vm1 Config Name: Ibm compute vm instance vm1 hostname Config ID: ibm_compute_vm_instance-vm1-hostname Config Name: Ibm compute vm instance vm1 domain Config ID: ibm_compute_vm_instance-vm1-domain ============================================= Configuration Group Name: Ibm compute vm instance vm2 Config Name: Ibm compute vm instance vm2 hostname Config ID: ibm_compute_vm_instance-vm2-hostname Config Name: Ibm compute vm instance vm2 domain Config ID: ibm_compute_vm_instance-vm2-domain ============================================= Configuration Group Name: Ibm security group secGrp Config Name: Ibm security group secGrp name Config ID: ibm_security_group-secGrp-name
- icb_catalog_metadata.json - Temp - rich-value-types - main.tf - network - main.tf - outputs.tf - variables.tf
- icb_catalog_metadata.json - Temp - rich-value-types - main.tf - network - main.tf - outputs.tf - variables.tf
- icb_catalog_metadata.json - templates - Service1 - main.tf - output.tf - provider.tf - variables.tf - MODULE1 //used in main.tf - Service2 - pool.tf - provider.tf - variables.tf - MODULE1 //used in pool.tf
terraform { required_version = ">=0.13" required_providers { ibm = { source = "IBM-Cloud/ibm" } } }
- icb_catalog_metadata.json - templates - Service1 - pool.tf - output.tf - provider.tf - variables.tf - example // module used in pool.tf - main.tf - variables.tf
output "instances_ips" { value = join(",", concat(ibm_is_instance.instance_az1.*.primary_network_interface.0.primary_ipv4_address,ibm_is_instance.instance_az2.*.primary_network_interface.0.primary_ipv4_address)) }
resource ibm_security_group test {} resource ibm_compute_vm_instance test {}