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

Java settings not retained #5

Closed
gspindev opened this issue Oct 19, 2021 · 2 comments
Closed

Java settings not retained #5

gspindev opened this issue Oct 19, 2021 · 2 comments

Comments

@gspindev
Copy link

gspindev commented Oct 19, 2021

Terraform scripts for azure java appservice azurerm_app_service not retaining java version details in terraform state file.

This is my site_config:

always_on                            = true
ftps_state                           = "FtpsOnly"
http2_enabled                        = true
java_container                       = "JAVA"
java_container_version               = "11"
java_version                         = "11"
linux_fx_version                     = "JAVA|11-java11"
min_tls_version                      = "1.2"

after apply; I do see that it is configured properly as shown below but the tfstate doesn't reflect the same;
image

tfstate file missing the values:

                "java_container": "",
                "java_container_version": "",
                "java_version": "",
                "linux_fx_version": "JAVA|11-java11",

Always shows the change underneath site_config block with plan/apply operation though these configs are provided during execution. Subsequent plan always shows that it is applying these changes.
Tested with azurerm provider versions: 2.81.0, 2.6.0,2.46.0

~ site_config {
          + java_container                       = "JAVA"
          + java_container_version          = "11"
          + java_version                           = "11"
            # (20 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }
@kumarvna
Copy link
Owner

kumarvna commented Oct 23, 2021

The "Objects have changed outside of Terraform" message is only showing the difference between what the provider stored in the state, and what the provider is indicating as the current state, nothing more. The configuration is only taken into account for the actual plan output, which results in 0 changes for your example. Moreover, I am not able to reproduce the issue of missing values in terraform state.

If the provider is unexpectedly changing values where it shouldn't, then it is an issue with the provider.

You can follow along with the open issue here: #28803

@kumarvna
Copy link
Owner

I am adding lifecycle management to handle this situation for now. you still see the Objects have changed outside of Terraform message but no changes will be applied to the already applied plan. Please use the new release (v1.1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants