apache / cloudstack-terraform-provider

CloudStack Terraform Provider
https://cloudstack.apache.org
Apache License 2.0
28 stars 36 forks source link

Cannot create acl_rule - Root resource was present, but now absent. #129

Open AlexanderKgr opened 3 months ago

AlexanderKgr commented 3 months ago

Trying to create some networks with acl rules When i run terraform plan everything is ok, but when i run terraform apply i have the following error.

image

Can you help me pinpoint the issue or it is a bug?

My VPC config image

My ACL config image

My ACL_rule config image

Thanks in advance

kiranchavala commented 2 weeks ago

@AlexanderKgr what is the Cloudstack version and Cloudstack terraform provider version you are using

I am not facing the issue with the latest terraform release of 0.5 release and cloudstack version 4.19


terraform {
  required_providers {
    cloudstack = {
      source = "cloudstack/cloudstack"
      version = "0.5.0"
    }
  }
}

resource "cloudstack_vpc" "default" {
  name         = "test-vpc"
  cidr         = "10.0.0.0/16"
  vpc_offering = "Default VPC Offering"
  zone         = "ref-trl-7435-k-Mol8-kiran-chavala"
  network_domain = "kirantest"
  project = "4f756ff5-25b8-4e0a-9b13-914bae550133"
}

output "vpc_id" {
   value= cloudstack_vpc.default.id

}

resource "cloudstack_network_acl" "default" {
  name   = "test-acl"
  vpc_id = cloudstack_vpc.default.id
}

output "acl_id" {
   value= cloudstack_network_acl.default.id   
}

resource "cloudstack_network_acl_rule" "default" {
  acl_id = cloudstack_network_acl.default.id

  rule {
    action       = "allow"
    cidr_list    = ["10.0.0.0/8"]
    protocol     = "tcp"
    ports        = ["80", "1000-2000"]
    traffic_type = "ingress"
  }
}
AlexanderKgr commented 2 weeks ago

@AlexanderKgr what is the Cloudstack version and Cloudstack terraform provider version you are using

I am not facing the issue with the latest terraform release of 0.5 release and cloudstack version 4.19


terraform {
  required_providers {
    cloudstack = {
      source = "cloudstack/cloudstack"
      version = "0.5.0"
    }
  }
}

resource "cloudstack_vpc" "default" {
  name         = "test-vpc"
  cidr         = "10.0.0.0/16"
  vpc_offering = "Default VPC Offering"
  zone         = "ref-trl-7435-k-Mol8-kiran-chavala"
  network_domain = "kirantest"
  project = "4f756ff5-25b8-4e0a-9b13-914bae550133"
}

output "vpc_id" {
   value= cloudstack_vpc.default.id

}

resource "cloudstack_network_acl" "default" {
  name   = "test-acl"
  vpc_id = cloudstack_vpc.default.id
}

output "acl_id" {
   value= cloudstack_network_acl.default.id   
}

resource "cloudstack_network_acl_rule" "default" {
  acl_id = cloudstack_network_acl.default.id

  rule {
    action       = "allow"
    cidr_list    = ["10.0.0.0/8"]
    protocol     = "tcp"
    ports        = ["80", "1000-2000"]
    traffic_type = "ingress"
  }
}

i am using cloudstack 4.19.1.1 and terraform 0.5. in next days i will try to deploy again and report again