Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Variable defined in env0_environment resource getting "updated" in plan #756

Closed
away168 opened this issue Nov 28, 2023 · 5 comments · Fixed by #768
Closed
Assignees
Labels
bug Something isn't working

Comments

@away168
Copy link
Contributor

away168 commented Nov 28, 2023

Describe the bug
Using env0_environment with configuration block - on a plan - the configuration block is being recreated.

To Reproduce
FWIW: this is a workflow template - creating terraform configuration variables.

resource "env0_environment" "ecs-laster-env0" {
  name       = "ecs-laster-example"
  project_id = "(redacted)"
  #  project_id                       = data.env0_project.ecs-service.id
  template_id                      = data.env0_template.ecs-service.id
  run_plan_on_pull_requests        = false
  deploy_on_push                   = false
  auto_deploy_on_path_changes_only = false
  revision                         = "main"
  force_destroy                    = true
  approve_plan_automatically       = true
  is_inactive                      = false

  configuration {
    is_read_only = true
    is_required  = true
    is_sensitive = false
    name         = "servicename"
    schema_type  = "string"
    type         = "terraform"
    value        = "ecs-laster-env0"
  }
}

Expected behavior
Plan should show no changes after initial deployment.

Provider Version
1.16.0

Screenshots
CleanShot 2023-11-28 at 12 11 30

Additional context
Template type is a Workflow type.

@away168 away168 added the bug Something isn't working label Nov 28, 2023
@away168 away168 changed the title Configuration Variable defined in env0_environment resource getting "recreated" in plan Configuration Variable defined in env0_environment resource getting "updated" in plan Nov 28, 2023
@TomerHeber
Copy link
Collaborator

@away168 workflow has many limitations concerning to the terraform provider especially because many of the configurations are coming from a yaml file.

Where are the "sub_environment_configuration" entries?

Notice the following comment:
"the subenvironments for a workflow environment. Template type must be 'workflow'. Must match the configuration as defined in 'env0.workflow.yml'",

I'm wondering where these variables are coming from?
I will need more information.

@away168
Copy link
Contributor Author

away168 commented Nov 29, 2023

@TomerHeber we're not using subenvironment configuration variables - just defining configuration for the entire workflow. In the UI, you can define Environment Variables that would be applied to all sub-environments). In this particular case, we're defining a Terraform Variable for all sub-environments.

@TomerHeber
Copy link
Collaborator

@away168 makes sense. What are all these configuration changes? where is it coming from?

@away168
Copy link
Contributor Author

away168 commented Dec 6, 2023

@TomerHeber the screenshot is a more complete code, I only copied and pasted one configuration variable, when the customer in fact has 8 or 9 configuration variable in his code.

@TomerHeber TomerHeber self-assigned this Dec 6, 2023
@TomerHeber
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
2 participants