The ICDC Provider allows Terraform to manage ICDC resources.
# 1. Specify the version of the ICDC Provider to use
terraform {
required_providers {
icdc = {
source = "icdc-io/icdc"
version = "=1.0.0"
}
}
}
# 2. Configure the ICDC Provider
provider "icdc" {
username = "username"
location = "user-region"
auth_group = "user-authgroup"
}
# 3. Create a virtual network
resource icdc_network example {
name = "example-network"
subnet {
cidr = "11.0.0.0/26"
gateway = "11.0.0.1"
dns_nameserver = "8.8.8.8"
}
}
# 4. Use data-source for select needed version of OS
data icdc_template centos-stream{
name = "CentOS Stream"
version = "9-230519"
}
# 5. Deploy instance group with selected OS into created network
resource icdc_instance_group instance-group1 {
name = "instance-group-1"
template_id = data.icdc_template.centos-stream.id
subnet = icdc_network.example.name
cpu = "1"
memory_mb = "4096"
system_disk_type = "nvme"
system_disk_size = "30"
pass_auth = "temporary_password"
instances_count = "2"
user_data = <<-EOT
runcmd:
- dnf install -y httpd
- systemctl enable httpd --now
EOT
}
# 6. You can find out the list of supported resources below.
- ICDC Networking
- VPC Networks
- Security Groups and Rules
- Load Balancer routes
- DNS zones and records
- ICDC Compute
- Services
- Instance Groups
- Datasource - templates
You can find out more examples of usage ICDC provider here
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.19+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin
to your $PATH
$ git clone git@github.com:icdc-io/terraform-provider-icdc.git
$ cd terraform-provider-icdc
$ make install
$ terraform init
$ terraform plan
$ terraform apply
Make sure you correctly specified version of the provider, for development goals must be specified
terraform {
required_providers {
icdc = {
source = "local.com/icdc-io/icdc"
version = "1.0.0"
}
}
}