terraform-provider-octopusdeploy icon indicating copy to clipboard operation
terraform-provider-octopusdeploy copied to clipboard

Lack of idempotency

Open itaispiegel opened this issue 2 years ago • 0 comments
trafficstars

Describe the bug The provider isn't idempotent. When trying to use the provider to apply a configuration of resources which already exist, an error is raised saying that the resource already exists.

Steps to reproduce

  1. Create a tenant manually on the website. Say its name is "tenant".
  2. Define the following resource:
resource "octopusdeploy_tenant" "tenant" {
  name        = "tenant"
}
  1. Apply the configuration, and expect to receive the following output:
|
│ Error: octopus deploy api returned an error on endpoint /api/Spaces-1/tenants - [A tenant with this name already exists. Please choose a different name.]
│ 
│   with octopusdeploy_tenant.tenant,
│   on main.tf line 17, in resource "octopusdeploy_tenant" "tenant":
│   17: resource "octopusdeploy_tenant" "tenant" {
│ 
╵

Expected behavior The expected behavior is that Terraform should return without making any changes.

Environment and versions:

  • OS: OSX
  • Octopus Server Version: 2023.4.4798
  • Terraform Version: v1.5.2
  • Octopus Terraform Provider Version: v0.12.7

itaispiegel avatar Oct 11 '23 13:10 itaispiegel