Comments (6)
Thanks for the update! Yeah, this solution looks good for you GoogleCloudPlatform/magic-modules#10214
So, are you ok right now, or do you still have issues?
from terraform-provider-google.
Hi @dullest with the steps to reproduce the issue 1st both resources were created, then 1 env variable was removed and finally the change was applied. So are you expecting that the env vars that aren't removed change their values? Because the unique change is that 1 env var was removed from both resources, but for the other variables their values remain.
from terraform-provider-google.
I'm expecting env blocks work as a set instead of a list in order to avoid unnecessary diffs.
I confirmed with fixed provider binary on my local with this change that the type change from a list to a set fixes the issue.
Let me simplify the behaviors and the steps a bit.
Actual Behavior and the steps
- applying this resource with 4 env blocks
resource "google_cloud_run_v2_service" "default" {
name = "test"
location = "asia-northeast1"
template {
containers {
image = "docker/welcome-to-docker"
ports {
container_port = 80
}
env {
name = "FOO1"
value = "bar1"
}
env {
name = "FOO2"
value = "bar2"
}
env {
name = "FOO3"
value = "bar3"
}
env {
name = "FOO4"
value = "bar4"
}
}
}
}
- removing one env block (commented out FOO2)
resource "google_cloud_run_v2_service" "default" {
name = "test"
location = "asia-northeast1"
template {
containers {
image = "docker/welcome-to-docker"
ports {
container_port = 80
}
env {
name = "FOO1"
value = "bar1"
}
# env {
# name = "FOO2"
# value = "bar2"
# }
env {
name = "FOO3"
value = "bar3"
}
env {
name = "FOO4"
value = "bar4"
}
}
}
}
- applying again shows following diff (current behavior)
It shows FOO3, FOO4 are also recognized as the diff even I didn't change
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# google_cloud_run_v2_service.default will be updated in-place
~ resource "google_cloud_run_v2_service" "default" {
id = "redacted"
name = "test"
# (25 unchanged attributes hidden)
~ template {
# (6 unchanged attributes hidden)
~ containers {
# (4 unchanged attributes hidden)
~ env {
~ name = "FOO2" -> "FOO3"
~ value = "bar2" -> "bar3"
}
~ env {
~ name = "FOO3" -> "FOO4"
~ value = "bar3" -> "bar4"
}
- env {
- name = "FOO4" -> null
- value = "bar4" -> null
}
# (4 unchanged blocks hidden)
}
# (1 unchanged block hidden)
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
Expected Behavior and the steps
- applying this resource with 4 env blocks
resource "google_cloud_run_v2_service" "default" {
name = "test"
location = "asia-northeast1"
template {
containers {
image = "docker/welcome-to-docker"
ports {
container_port = 80
}
env {
name = "FOO1"
value = "bar1"
}
env {
name = "FOO2"
value = "bar2"
}
env {
name = "FOO3"
value = "bar3"
}
env {
name = "FOO4"
value = "bar4"
}
}
}
}
- removing one env block (commented out FOO2)
resource "google_cloud_run_v2_service" "default" {
name = "test"
location = "asia-northeast1"
template {
containers {
image = "docker/welcome-to-docker"
ports {
container_port = 80
}
env {
name = "FOO1"
value = "bar1"
}
# env {
# name = "FOO2"
# value = "bar2"
# }
env {
name = "FOO3"
value = "bar3"
}
env {
name = "FOO4"
value = "bar4"
}
}
}
}
- applying again shows following diff
It only shows FOO2 is the diff, not like actual behavior showed FOO3, FOO4 are also the diff
╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│ - hashicorp/google in /Users/dullest/go/1.21.7/bin
│ - hashicorp/google-beta in /Users/dullest/go/1.21.7/bin
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with
│ published releases.
╵
data.google_project.project: Reading...
google_cloud_run_v2_service.default: Refreshing state... [id=redacted]
data.google_project.project: Read complete after 2s [id=redacted]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# google_cloud_run_v2_service.default will be updated in-place
~ resource "google_cloud_run_v2_service" "default" {
id = "redacted"
name = "test"
# (25 unchanged attributes hidden)
~ template {
# (6 unchanged attributes hidden)
~ containers {
# (4 unchanged attributes hidden)
- env {
- name = "FOO2" -> null
- value = "bar2" -> null
}
# (6 unchanged blocks hidden)
}
# (1 unchanged block hidden)
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
from terraform-provider-google.
I'm ok right now. I'll wait the release which will have the fix.
from terraform-provider-google.
@rileykarson could you please help closing this issue?
from terraform-provider-google.
Added to our major release milestone, so that this gets accounted for during that. GoogleCloudPlatform/magic-modules#10214 is an outstanding PR to resolve.
from terraform-provider-google.
Related Issues (20)
- google_cloud_run_v2_service container order changes HOT 4
- Add support for creating Managed Instance Group with Resource Manager Tags
- google_netapp_storage_pool does not support specifying a PSA range
- google_gkeonprem_vmware_cluster: support for disabling bundled istiod (ASM)
- Add Cilium Network Policies support for GKE
- google_compute_address forces replacement when description changes HOT 3
- google_compute_disk does not allow SEV_LIVE_MIGRATABLE_V2 for guest_os_features type HOT 2
- Documentation for App Hub resources and data sources are split across two subcategories - consolidate them into one subcategory HOT 1
- Support for custom instance config in spanner HOT 1
- Convert VCR comment formatting to use a go template
- Return data from missing test detector and format it in generate_comment template HOT 1
- Return data from breaking change detector and format it in generate_comment template HOT 1
- Resource `google_compute_target_https_proxy` fails to update certificates with `certificate_manager_certificates` attribute HOT 7
- Adding a way to list tag bindings for a resource
- missing "operator" field for taints on google_gkeonprem_vmware_node_pool
- A few small, but critical typos on documentation for `google_pubsub_subscription` HOT 1
- Provider produced inconsistent final plan. CloudRun and labels HOT 2
- Support Oauth consent screen scope configuration HOT 4
- Add tests for Automated backup and Continuous backup support in AlloyDB Secondary Cluster
- Data Catalog Entry expand allowed type HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-google.