Skip to content

Backport of Relax resource identity validation into v1.12 #36991

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
8462c5f
backend/oss: Supports more standard environment variables to keep sam…
xiaozhu36 Mar 3, 2025
4338b75
Turn main into 1.13 dev branch (#36822)
radeksimko Apr 2, 2025
da42f6b
don't re-add non-comparable diagnostics
jbardin Apr 2, 2025
7fadbe3
write-only attributes: internal providers should set write-only attr…
liamcervante Apr 2, 2025
c0a7ff2
Apply some new go collection features (#36818)
dsa0x Apr 2, 2025
aeb1c0d
we can't dedupe extra values in diags
jbardin Apr 2, 2025
c6c21a8
hcl diagnostics must check Subject source
jbardin Apr 2, 2025
291d26c
we can't compare location if either are nil
jbardin Apr 2, 2025
568a6f9
Consolidate install pages (#36798)
BrianMMcClain Apr 2, 2025
87cdcc3
Merge pull request #36825 from hashicorp/jbardin/diag-dedupe
jbardin Apr 2, 2025
46278da
Fix bugs where appended diags are not returned
SarahFrench Apr 2, 2025
79cdadd
Merge pull request #36833 from hashicorp/sarah/fix-appended-diags
SarahFrench Apr 2, 2025
fbd5a79
stacks: allow removed blocks to target components in nested stacks (#…
liamcervante Apr 3, 2025
2b5101f
stacks: include existing components when deferring nested stacks (#36…
liamcervante Apr 3, 2025
196205e
Merge pull request #36581 from xiaozhu36/creds
SarahFrench Apr 3, 2025
721ab21
Remove paragraph that logical operators do not short-circuit for 1.12…
BrianMMcClain Apr 3, 2025
884fc64
Remove unused test fixture "push-backend-new" (#36842)
SarahFrench Apr 3, 2025
a06f827
stacks: update removed blocks to allow targeting of embedded stacks (…
liamcervante Apr 4, 2025
61ab3a1
Fix for #36859 in mocking.mdx
crw Apr 7, 2025
86f333e
Merge pull request #36860 from hashicorp/typofix-36859
crw Apr 8, 2025
ea767aa
Add comments about use of ResourceStores with TestProviders (#36856)
SarahFrench Apr 8, 2025
0b13ab3
remove bucket name from s3:prefix condition in IAM policy
DominicBreuker Apr 9, 2025
a5b2d2e
Replace sc with Set-Content
varnav Apr 10, 2025
0fb145d
Bump Go version to 1.24.2 (#36870)
dbanck Apr 10, 2025
63b8629
Update sources.mdx (#36873)
dmitryuchuvatov Apr 10, 2025
624f559
Merge branch 'main' into docs-s3-prefix-fix
jar-b Apr 10, 2025
bc87cdf
Merge pull request #36868 from DominicBreuker/docs-s3-prefix-fix
jar-b Apr 10, 2025
1e4df3e
Merge pull request #36869 from varnav/sc-command-fix
crw Apr 10, 2025
36fb64f
grpcwrap+provider-simple: Test ephemeral resource schemas in v5 proto…
radeksimko Apr 11, 2025
8d2dffe
Fix defects where `done` is called before the command's `Run` method …
SarahFrench Apr 14, 2025
c161997
CODEOWNERS: Set tf-core-cloud as owner of Cloud backend (#36876)
radeksimko Apr 15, 2025
be242c3
Stacks migrate: migration workflow improvements (#36882)
dsa0x Apr 16, 2025
7414a3f
Fix import with optional identity attributes (#36887)
dbanck Apr 16, 2025
063757f
stacks: refactor plan, state, and removed tracking with tree structur…
liamcervante Apr 16, 2025
804e970
Added Terraform backend implementation for OCI Object Storage (#36872)
ravinitp Apr 22, 2025
474fe47
backend/oci/deps: Pin flock to v0.10.0 (#36913)
radeksimko Apr 22, 2025
4eaa9d7
stacks: removing embedded stacks should ignore stacks not in state (#…
liamcervante Apr 24, 2025
dcff9e4
stacks: improve test coverage for removed blocks (#36914)
liamcervante Apr 24, 2025
96e50f6
stacks: ensure consistent sources between removed blocks (#36915)
liamcervante Apr 24, 2025
1bc7d22
stacks: removed blocks should refresh during refresh plans (#36916)
liamcervante Apr 24, 2025
62c84e3
Validate identity to match identity schema (#36904)
dbanck Apr 29, 2025
2c12602
Validate identity in import response (#36893)
dbanck Apr 29, 2025
032cd5f
Fix version in resource identity upgrade request (#36940)
dbanck Apr 29, 2025
1af5cfc
update iframe to videoembed
im2nguyen Apr 29, 2025
5880479
break dependency of stack migrate on command Meta to prevent import c…
Uk1288 Apr 29, 2025
1ba125b
Merge pull request #36943 from hashicorp/iframe-to-videoembed
im2nguyen Apr 29, 2025
bf45e43
Add changelog entries for resource identities (#36905)
dbanck Apr 30, 2025
0aa4ce9
Add resource identities to plan file and JSON output (#36903)
dbanck Apr 30, 2025
5fcc451
Update CODEOWNERS (#36945)
SarahFrench Apr 30, 2025
87e6f51
fix test
Uk1288 Apr 30, 2025
6c3be0c
Merge remote-tracking branch 'origin/main' into break-dependency-betw…
Uk1288 Apr 30, 2025
7c81522
Merge pull request #36944 from hashicorp/break-dependency-between-sta…
Uk1288 Apr 30, 2025
f9e2f7c
Add provider example to terraform applying (#36965)
rkoron007 Apr 30, 2025
8e8a2d5
Add documentation to refactor Terraform state (#36962)
BrianMMcClain Apr 30, 2025
0a65ebd
Update owner field in catalog-info.yaml (#36963)
imakewebthings May 5, 2025
c9f707b
Fix resource identity schema on destroy (#36983)
dbanck May 5, 2025
e57a4f7
Remove identity change validation
dbanck May 7, 2025
783ed60
backport of commit e57a4f7a5770a13e4c5b94ce5d6ff2400ab70d28
dbanck May 7, 2025
fb7dbca
Merge e57a4f7a5770a13e4c5b94ce5d6ff2400ab70d28 into backport/dbanck/r…
github-actions[bot] May 7, 2025
a6efd22
backport of commit 76b4a6405d7556b83b8e8afb704bfc539558cd57
dbanck May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/v1.11/BUG FIXES-20250402-143931.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: BUG FIXES
body: 'write-only attributes: internal providers should set write-only attributes to null'
time: 2025-04-02T14:39:31.672249+02:00
custom:
Issue: "36824"
5 changes: 5 additions & 0 deletions .changes/v1.12/ENHANCEMENTS-20250303-171838.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: ENHANCEMENTS
body: 'backend/oss: Supports more standard environment variables to keep same with provider setting'
time: 2025-03-03T17:18:38.679213+08:00
custom:
Issue: "36581"
5 changes: 5 additions & 0 deletions .changes/v1.12/ENHANCEMENTS-20250417-182036.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: ENHANCEMENTS
body: '`import` blocks: Now support importing a resource via a new identity attribute. This is mutually exclusive with the `id` attribute'
time: 2025-04-17T18:20:36.814657+02:00
custom:
Issue: "36703"
5 changes: 5 additions & 0 deletions .changes/v1.12/NEW FEATURES-20250410-154805.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: NEW FEATURES
body: Added Terraform backend implementation for OCI Object Storage
time: 2025-04-10T15:48:05.919664+05:30
custom:
Issue: "34465"
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.1
1.24.2
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## 1.12.0 (Unreleased)


NEW FEATURES:

* Added Terraform backend implementation for OCI Object Storage ([#34465](https://github.com/hashicorp/terraform/issues/34465))


ENHANCEMENTS:

* Terraform Test command now accepts a -parallelism=n option, which sets the number of parallel operations in a test run's plan/apply operation. ([#34237](https://github.com/hashicorp/terraform/issues/34237))
Expand All @@ -15,8 +20,14 @@ ENHANCEMENTS:

* Produce detailed diagnostic objects when test run assertions fail ([#34428](https://github.com/hashicorp/terraform/issues/34428))

* backend/oss: Supports more standard environment variables to keep same with provider setting ([#36581](https://github.com/hashicorp/terraform/issues/36581))

* Improved elapsed time display in UI Hook to show minutes and seconds in `mm:ss` format. ([#36368](https://github.com/hashicorp/terraform/issues/36368))

* Update legacy term used in error messages. (Terraform Cloud agent => HCP Terraform Agent) ([#36706](https://github.com/hashicorp/terraform/issues/36706))

* `import` blocks: Now support importing a resource via a new identity attribute. This is mutually exclusive with the `id` attribute ([#36703](https://github.com/hashicorp/terraform/issues/36703))


BUG FIXES:

Expand All @@ -28,6 +39,8 @@ BUG FIXES:

* Avoid reporting duplicate attribute-associated diagnostics, such as "Available Write-only Attribute Alternative" ([#36579](https://github.com/hashicorp/terraform/issues/36579))

* for_each expressions in import blocks should not be able to reference the import target ([#36801](https://github.com/hashicorp/terraform/issues/36801))


UPGRADE NOTES:

Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#/internal/backend/remote-state/pg @remilapeyre
/internal/backend/remote-state/s3 @hashicorp/terraform-core @hashicorp/terraform-aws
/internal/backend/remote-state/kubernetes @hashicorp/terraform-core @hashicorp/tf-eco-hybrid-cloud
#/internal/backend/remote-state/oracle_oci @ravinitp @pvkrishnachaitanya

# Provisioners
builtin/provisioners/file @hashicorp/terraform-core
Expand Down
10 changes: 9 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform

go 1.24.1
go 1.24.2

godebug winsymlink=0

Expand Down Expand Up @@ -42,6 +42,7 @@ require (
github.com/hashicorp/terraform/internal/backend/remote-state/cos v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/gcs v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/kubernetes v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/oci v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/oss v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/pg v0.0.0-00010101000000-000000000000
github.com/hashicorp/terraform/internal/backend/remote-state/s3 v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -162,6 +163,7 @@ require (
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gofrs/flock v0.10.0 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
Expand Down Expand Up @@ -227,12 +229,15 @@ require (
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/oracle/oci-go-sdk/v65 v65.89.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/samber/lo v1.47.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.588 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts v1.0.588 // indirect
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tag v1.0.233 // indirect
Expand All @@ -242,6 +247,7 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.mongodb.org/mongo-driver v1.16.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
Expand Down Expand Up @@ -316,6 +322,8 @@ replace github.com/hashicorp/terraform/internal/backend/remote-state/pg => ./int

replace github.com/hashicorp/terraform/internal/backend/remote-state/s3 => ./internal/backend/remote-state/s3

replace github.com/hashicorp/terraform/internal/backend/remote-state/oci => ./internal/backend/remote-state/oci

replace github.com/hashicorp/terraform/internal/legacy => ./internal/legacy

tool (
Expand Down
16 changes: 15 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,9 @@ github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/flock v0.10.0 h1:SHMXenfaB03KbroETaCMtbBg3Yn29v4w1r+tgy4ff4k=
github.com/gofrs/flock v0.10.0/go.mod h1:FirDy1Ing0mI2+kB6wk+vyyAH+e6xiE+EYA0jnzV9jc=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
Expand Down Expand Up @@ -1348,6 +1351,8 @@ github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=
github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q=
github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
github.com/oracle/oci-go-sdk/v65 v65.89.1 h1:8sVjxYPNQ83yqUgZKkdeUA0CnSodmL1Bme2oxq8gyKg=
github.com/oracle/oci-go-sdk/v65 v65.89.1/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA=
github.com/packer-community/winrmcp v0.0.0-20221126162354-6e900dd2c68f h1:sWm3fnjG6kxvDuGiQf46Io5xCTj3QJfNJIeICJ4g1kw=
github.com/packer-community/winrmcp v0.0.0-20221126162354-6e900dd2c68f/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
Expand Down Expand Up @@ -1421,6 +1426,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sony/gobreaker v0.5.0 h1:dRCvqm0P490vZPmy7ppEk2qCnCieBooFJ+YoXGYB+yg=
github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
Expand All @@ -1439,8 +1446,9 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
Expand All @@ -1453,6 +1461,7 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
Expand Down Expand Up @@ -1480,6 +1489,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs=
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -1567,6 +1578,7 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
Expand Down Expand Up @@ -1864,6 +1876,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
Expand All @@ -1881,6 +1894,7 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
Expand Down
2 changes: 2 additions & 0 deletions internal/backend/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
backendHTTP "github.com/hashicorp/terraform/internal/backend/remote-state/http"
backendInmem "github.com/hashicorp/terraform/internal/backend/remote-state/inmem"
backendKubernetes "github.com/hashicorp/terraform/internal/backend/remote-state/kubernetes"
backendOCI "github.com/hashicorp/terraform/internal/backend/remote-state/oci"
backendOSS "github.com/hashicorp/terraform/internal/backend/remote-state/oss"
backendPg "github.com/hashicorp/terraform/internal/backend/remote-state/pg"
backendS3 "github.com/hashicorp/terraform/internal/backend/remote-state/s3"
Expand Down Expand Up @@ -67,6 +68,7 @@ func Init(services *disco.Disco) {
"oss": func() backend.Backend { return backendOSS.New() },
"pg": func() backend.Backend { return backendPg.New() },
"s3": func() backend.Backend { return backendS3.New() },
"oci": func() backend.Backend { return backendOCI.New() },

// HCP Terraform 'backend'
// This is an implementation detail only, used for the cloud package
Expand Down
12 changes: 6 additions & 6 deletions internal/backend/local/backend_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"

"maps"

"github.com/hashicorp/terraform/internal/backend/backendrun"
"github.com/hashicorp/terraform/internal/configs"
"github.com/hashicorp/terraform/internal/configs/configload"
Expand Down Expand Up @@ -400,9 +402,8 @@ func (b *Local) interactiveCollectVariables(ctx context.Context, existing map[st
// variable's value.
sort.Strings(needed) // prompt in lexical order
ret := make(map[string]backendrun.UnparsedVariableValue, len(vcs))
for k, v := range existing {
ret[k] = v
}
maps.Copy(ret, existing) // don't use clone here, so we can have a non-nil map

for _, name := range needed {
vc := vcs[name]
query := fmt.Sprintf("var.%s", name)
Expand Down Expand Up @@ -467,9 +468,8 @@ func (b *Local) stubUnsetRequiredVariables(existing map[string]backendrun.Unpars

// If we get down here then there's at least one variable value to add.
ret := make(map[string]backendrun.UnparsedVariableValue, len(vcs))
for k, v := range existing {
ret[k] = v
}
maps.Copy(ret, existing) // don't use clone here, so we can return a non-nil map

for name, vc := range vcs {
if !vc.Required() {
continue
Expand Down
28 changes: 9 additions & 19 deletions internal/backend/local/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
"fmt"
"log"
"path/filepath"
"sort"
"slices"

"github.com/zclconf/go-cty/cty"

"maps"

"github.com/hashicorp/terraform/internal/backend/backendrun"
"github.com/hashicorp/terraform/internal/command/junit"
"github.com/hashicorp/terraform/internal/command/views"
Expand Down Expand Up @@ -94,28 +96,18 @@ func (runner *TestSuiteRunner) Test() (moduletest.Status, tfdiags.Diagnostics) {

runner.View.Abstract(suite)

var files []string
for name := range suite.Files {
files = append(files, name)
}
sort.Strings(files) // execute the files in alphabetical order

// We have two sets of variables that are available to different test files.
// Test files in the root directory have access to the GlobalVariables only,
// while test files in the test directory have access to the union of
// GlobalVariables and GlobalTestVariables.
testDirectoryGlobalVariables := make(map[string]backendrun.UnparsedVariableValue)
for name, value := range runner.GlobalVariables {
testDirectoryGlobalVariables[name] = value
}
for name, value := range runner.GlobalTestVariables {
// We're okay to overwrite the global variables in case of name
// collisions, as the test directory variables should take precedence.
testDirectoryGlobalVariables[name] = value
}
maps.Copy(testDirectoryGlobalVariables, runner.GlobalVariables)
// We're okay to overwrite the global variables in case of name
// collisions, as the test directory variables should take precedence.
maps.Copy(testDirectoryGlobalVariables, runner.GlobalTestVariables)

suite.Status = moduletest.Pass
for _, name := range files {
for _, name := range slices.Sorted(maps.Keys(suite.Files)) {
if runner.Cancelled {
return suite.Status, diags
}
Expand Down Expand Up @@ -144,9 +136,7 @@ func (runner *TestSuiteRunner) Test() (moduletest.Status, tfdiags.Diagnostics) {
}

evalCtx.VariableCaches = hcltest.NewVariableCaches(func(vc *hcltest.VariableCaches) {
for name, value := range currentGlobalVariables {
vc.GlobalVariables[name] = value
}
maps.Copy(vc.GlobalVariables, currentGlobalVariables)
vc.FileVariables = file.Config.Variables
})
fileRunner := &TestFileRunner{
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/remote-state/azure/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform/internal/backend/remote-state/azure

go 1.24.1
go 1.24.2

require (
github.com/hashicorp/go-azure-helpers v0.72.0
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/remote-state/consul/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform/internal/backend/remote-state/consul

go 1.24.1
go 1.24.2

require (
github.com/hashicorp/consul/api v1.13.0
Expand Down
4 changes: 2 additions & 2 deletions internal/backend/remote-state/consul/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/remote-state/cos/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform/internal/backend/remote-state/cos

go 1.24.1
go 1.24.2

require (
github.com/hashicorp/terraform v0.0.0-00010101000000-000000000000
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/remote-state/gcs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform/internal/backend/remote-state/gcs

go 1.24.1
go 1.24.2

require (
cloud.google.com/go/kms v1.15.5
Expand Down
9 changes: 3 additions & 6 deletions internal/backend/remote-state/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
"github.com/hashicorp/terraform/internal/states/remote"
"github.com/hashicorp/terraform/internal/states/statemgr"

"maps"

coordinationv1 "k8s.io/api/coordination/v1"
coordinationclientv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
)
Expand Down Expand Up @@ -351,12 +353,7 @@ func (c *RemoteClient) getLabels() map[string]string {
tfstateWorkspaceKey: c.workspace,
managedByKey: "terraform",
}

if len(c.labels) != 0 {
for k, v := range c.labels {
l[k] = v
}
}
maps.Copy(l, c.labels)

return l
}
Expand Down
2 changes: 1 addition & 1 deletion internal/backend/remote-state/kubernetes/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hashicorp/terraform/internal/backend/remote-state/kubernetes

go 1.24.1
go 1.24.2

require (
github.com/hashicorp/terraform v0.0.0-00010101000000-000000000000
Expand Down
Loading