terraform workspace select old-name
terraform state pull >old-name.tfstate
terraform workspace new new-name
terraform state push old-name.tfstate
terraform show just to confirm that the newly-imported state looks "right", before we delete the old workspace
terraform workspace delete -force old-name
Un Operator qui :
Du coup on peut créer des resources AWS avec kube (on peut se passer de terraform, on peut utiliser une CI/CD adaptée à déployer dans Kube)
foreach list of objects
[{
name = "xxx"
description = "xxx"
param = "xxx"
},
...
]
for_each = {
for item in var.items:
item.name => item
}
name = each.key OU each.value.name
description = each.value.description