You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applied a terraform plan with storage_directive. The terraform is applied fine.
Change the size of storage_directive and reapply the plan.
The application is removed as expected but not recreated back.
Terraform plan failed with error application already exists
Urgency
Casually reporting
Terraform Juju Provider version
0.13.0-rc1
Terraform version
1.9.1
Juju version
3.4.2
Terraform Configuration(s)
terraform {
required_providers {
juju={
source ="registry.terraform.io/juju/juju"
version ="0.13.0"
}
}
}
provider"juju" {}
resource"juju_model""sunbeam" {
name=var.modelcloud {
name=var.cloudregion="localhost"
}
config=var.config
}
resource"juju_application""mysql" {
name="mysql"trust=truemodel=juju_model.sunbeam.namecharm {
name="mysql-k8s"channel="8.0/stable"base="[email protected]"
}
storage_directives={ database ="8G" }
}
variable"model" {
description="Name of Juju model to use for deployment"default="sunbeam"
}
variable"cloud" {
description="Name of K8S cloud to use for deployment"default="microk8s"
}
variable"config" {
description="Set configuration on model"default={ "workload-storage":"microk8s-hostpath" }
}
Reproduce / Test
terraform init
terraform apply -auto-approve
Change the "storage_directives = { database = "8G" }" to "storage_directives = { database = "5G" }"in terraform plan
terraform apply -auto-approve
Debug/Panic Output
juju_model.sunbeam: Refreshing state... [id=332bd1c6-639f-42cd-8037-385c1cf515f5]
juju_application.mysql: Refreshing state... [id=sunbeam:mysql]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# juju_application.mysql must be replaced
-/+ resource "juju_application""mysql" {
~ constraints = "arch=amd64" -> (known after apply)
~ id = "sunbeam:mysql" -> (known after apply)
name = "mysql"~ placement = null -> (known after apply)
+ principal = (known after apply)
~ storage = [
- {
- count = 1 -> null
- label = "database" -> null
- pool = "kubernetes" -> null
- size = "8.2G" -> null
},
] -> (known after apply)
~ storage_directives = { # forces replacement~"database" = "8G" ->"5G"
}
# (3 unchanged attributes hidden)~ charm {
name = "mysql-k8s"~ revision = 153 -> (known after apply)
~ series = "jammy" -> (known after apply)
# (2 unchanged attributes hidden)
}
}
Plan: 1 to add, 0 to change, 1 to destroy.
juju_application.mysql: Destroying... [id=sunbeam:mysql]
juju_application.mysql: Destruction complete after 0s
juju_application.mysql: Creating...
╷
│ Error: Client Error
│
│ with juju_application.mysql,
│ on main.tf line 23, in resource "juju_application""mysql":
│ 23: resource "juju_application""mysql" {
│
│ Unable to create application, got error: cannot add application "mysql": application already exists
Notes & References
No response
The text was updated successfully, but these errors were encountered:
hmlanigan
changed the title
Not able to update storage_directive size
juju_application.mysql must be replaced: fails with application already exists
Jul 11, 2024
When destroying an application, wait for it to be destroyed before
returning. Issue juju#521 and maybe others. Otherwise terraform fails when
RequireReplace is set.
Description
juju + microk8s environment
Applied a terraform plan with storage_directive. The terraform is applied fine.
Change the size of storage_directive and reapply the plan.
The application is removed as expected but not recreated back.
Terraform plan failed with error
application already exists
Urgency
Casually reporting
Terraform Juju Provider version
0.13.0-rc1
Terraform version
1.9.1
Juju version
3.4.2
Terraform Configuration(s)
Reproduce / Test
Debug/Panic Output
Notes & References
No response
The text was updated successfully, but these errors were encountered: