Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hashicorp/terraform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: hashicorp/terraform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.2
Choose a head ref
  • 9 commits
  • 6 files changed
  • 7 contributors

Commits on Jun 24, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    AVVS Vitaly Aminev
    Copy the full SHA
    47d1c17 View commit details
  2. Update CHANGELOG.md

    One of the v1.0.1 items had an incorrect PR number attached to it.
    apparentlymart authored Jun 24, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    AVVS Vitaly Aminev
    Copy the full SHA
    bdfff64 View commit details

Commits on Jun 29, 2021

  1. Backport of command/jsonstate: remove redundant remarking of resource…

    … instance into v1.0 (#29059)
    
    * backport of commit 3e33c76
    
    * backport of commit 69c83a6
    
    * backport-friendly refactor
    
    Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
    Co-authored-by: David Alger <davidmalger@gmail.com>
    3 people authored Jun 29, 2021
    Copy the full SHA
    f322418 View commit details

Commits on Jul 6, 2021

  1. Update CHANGELOG.md

    alisdair authored Jul 6, 2021
    Copy the full SHA
    52b37fa View commit details

Commits on Jul 7, 2021

  1. backport of commit 04e0ed7

    jbardin committed Jul 7, 2021
    Copy the full SHA
    1cabacd View commit details
  2. Merge pull request #29111 from hashicorp/backport/jbardin/update-cty/…

    …hideously-balanced-sculpin
    
    Backport of update go-cty to v1.9.0 into v1.0
    jbardin authored Jul 7, 2021
    Copy the full SHA
    9d7321e View commit details
  3. update CHANGELOG.md

    jbardin committed Jul 7, 2021
    Copy the full SHA
    84cfb9b View commit details
  4. Update CHANGELOG.md

    apparentlymart authored Jul 7, 2021
    Copy the full SHA
    eea0aac View commit details
  5. Copy the full SHA
    e33a4c5 View commit details
Showing with 119 additions and 19 deletions.
  1. +17 −9 CHANGELOG.md
  2. +1 −1 go.mod
  3. +2 −2 go.sum
  4. +2 −6 internal/command/jsonstate/state.go
  5. +96 −0 internal/command/jsonstate/state_test.go
  6. +1 −1 version/version.go
26 changes: 17 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
## 1.0.2 (July 07, 2021)

BUG FIXES:

* `terraform show`: Fix crash when rendering JSON plan with sensitive values in state ([#29049](https://github.com/hashicorp/terraform/issues/29049))
* config: The `floor` and `ceil` functions no longer lower the precision of arguments to what would fit inside a 64-bit float, instead preserving precision in a similar way as most other arithmetic functions. ([#29110](https://github.com/hashicorp/terraform/issues/29110))
* config: The `flatten` function was incorrectly treating null values of an unknown type as if they were unknown values. Now it will treat them the same as any other non-list/non-tuple value, flattening them down into the result as-is. ([#29110](https://github.com/hashicorp/terraform/issues/29110))

## 1.0.1 (June 24, 2021)

ENHANCEMENTS:

* json-output: The JSON plan output now indicates which state values are sensitive. ([#28889](https://github.com/hashicorp/terraform/issues/28889))
* cli: The darwin builds can now make use of the host DNS resolver, which will fix many network related issues on MacOS.
* `terraform show`: The JSON plan output now indicates which state values are sensitive. ([#28889](https://github.com/hashicorp/terraform/issues/28889))
* cli: The macOS builds will now resolve hostnames using the system's DNS resolver, rather than the Go library's (incomplete) emulation of it. In particular, this will allow for the more complex resolver configurations often created by VPN clients on macOS, such as when a particular domain must be resolved using different nameservers while VPN connection is active.

BUG FIXES:

* backend/remote: Fix faulty Terraform Cloud version check when migrating state to the remote backend with multiple local workspaces ([#28864](https://github.com/hashicorp/terraform/issues/28864))
* cli: Fix crash with deposed instances in json plan output ([#28922](https://github.com/hashicorp/terraform/issues/28922))
* core: Fix crash when provider modifies and unknown block during plan ([#28941](https://github.com/hashicorp/terraform/issues/28941))
* core: Diagnostic context was missing for some errors when validating blocks ([#28979](https://github.com/hashicorp/terraform/issues/28979))
* core: Fix crash when calling `setproduct` with unknown values ([#28984](https://github.com/hashicorp/terraform/issues/28984))
* json-output: Fix an issue where the JSON configuration representation was missing fully-unwrapped references. ([#8884](https://github.com/hashicorp/terraform/issues/8884))
* json-output: Fix JSON plan resource drift to remove unchanged resources. ([#28975](https://github.com/hashicorp/terraform/issues/28975))
* `terraform show`: Fix crash with deposed instances in json plan output. ([#28922](https://github.com/hashicorp/terraform/issues/28922))
* `terraform show`: Fix an issue where the JSON configuration representation was missing fully-unwrapped references. ([#28884](https://github.com/hashicorp/terraform/issues/28884))
* `terraform show`: Fix JSON plan resource drift to remove unchanged resources. ([#28975](https://github.com/hashicorp/terraform/issues/28975))
* core: Fix crash when provider modifies and unknown block during plan. ([#28941](https://github.com/hashicorp/terraform/issues/28941))
* core: Diagnostic context was missing for some errors when validating blocks. ([#28979](https://github.com/hashicorp/terraform/issues/28979))
* core: Fix crash when calling `setproduct` with unknown values. ([#28984](https://github.com/hashicorp/terraform/issues/28984))
* backend/remote: Fix faulty Terraform Cloud version check when migrating state to the remote backend with multiple local workspaces. ([#28864](https://github.com/hashicorp/terraform/issues/28864))

## 1.0.0 (June 08, 2021)

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ require (
github.com/xanzy/ssh-agent v0.2.1
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect
github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557
github.com/zclconf/go-cty v1.8.4
github.com/zclconf/go-cty v1.9.0
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
github.com/zclconf/go-cty-yaml v1.0.2
go.uber.org/atomic v1.3.2 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -612,8 +612,8 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE
github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs=
github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.9.0 h1:IgJxw5b4LPXCPeqFjjhLaNEA8NKXMyaEUdAd399acts=
github.com/zclconf/go-cty v1.9.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0=
8 changes: 2 additions & 6 deletions internal/command/jsonstate/state.go
Original file line number Diff line number Diff line change
@@ -329,9 +329,7 @@ func marshalResources(resources map[string]*states.Resource, module addrs.Module

current.AttributeValues = marshalAttributeValues(riObj.Value)

// Mark the resource instance value with any marks stored in AttrSensitivePaths so we can build the SensitiveValues object
markedVal := riObj.Value.MarkWithPaths(ri.Current.AttrSensitivePaths)
s := SensitiveAsBool(markedVal)
s := SensitiveAsBool(riObj.Value)
v, err := ctyjson.Marshal(s, s.Type())
if err != nil {
return nil, err
@@ -370,9 +368,7 @@ func marshalResources(resources map[string]*states.Resource, module addrs.Module

deposed.AttributeValues = marshalAttributeValues(riObj.Value)

// Mark the resource instance value with any marks stored in AttrSensitivePaths so we can build the SensitiveValues object
markedVal := riObj.Value.MarkWithPaths(rios.AttrSensitivePaths)
s := SensitiveAsBool(markedVal)
s := SensitiveAsBool(riObj.Value)
v, err := ctyjson.Marshal(s, s.Type())
if err != nil {
return nil, err
96 changes: 96 additions & 0 deletions internal/command/jsonstate/state_test.go
Original file line number Diff line number Diff line change
@@ -197,6 +197,52 @@ func TestMarshalResources(t *testing.T) {
},
false,
},
"resource with marks": {
map[string]*states.Resource{
"test_thing.bar": {
Addr: addrs.AbsResource{
Resource: addrs.Resource{
Mode: addrs.ManagedResourceMode,
Type: "test_thing",
Name: "bar",
},
},
Instances: map[addrs.InstanceKey]*states.ResourceInstance{
addrs.NoKey: {
Current: &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady,
AttrsJSON: []byte(`{"foozles":"confuzles"}`),
AttrSensitivePaths: []cty.PathValueMarks{{
Path: cty.Path{cty.GetAttrStep{Name: "foozles"}},
Marks: cty.NewValueMarks("sensitive")},
},
},
},
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule,
},
},
},
testSchemas(),
[]resource{
{
Address: "test_thing.bar",
Mode: "managed",
Type: "test_thing",
Name: "bar",
Index: addrs.InstanceKey(nil),
ProviderName: "registry.terraform.io/hashicorp/test",
AttributeValues: attributeValues{
"foozles": json.RawMessage(`"confuzles"`),
"woozles": json.RawMessage(`null`),
},
SensitiveValues: json.RawMessage(`{"foozles":true}`),
},
},
false,
},
"single resource wrong schema": {
map[string]*states.Resource{
"test_thing.baz": {
@@ -417,6 +463,51 @@ func TestMarshalResources(t *testing.T) {
},
false,
},
"resource with marked map attr": {
map[string]*states.Resource{
"test_map_attr.bar": {
Addr: addrs.AbsResource{
Resource: addrs.Resource{
Mode: addrs.ManagedResourceMode,
Type: "test_map_attr",
Name: "bar",
},
},
Instances: map[addrs.InstanceKey]*states.ResourceInstance{
addrs.NoKey: {
Current: &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady,
AttrsJSON: []byte(`{"data":{"woozles":"confuzles"}}`),
AttrSensitivePaths: []cty.PathValueMarks{{
Path: cty.Path{cty.GetAttrStep{Name: "data"}},
Marks: cty.NewValueMarks("sensitive")},
},
},
},
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule,
},
},
},
testSchemas(),
[]resource{
{
Address: "test_map_attr.bar",
Mode: "managed",
Type: "test_map_attr",
Name: "bar",
Index: addrs.InstanceKey(nil),
ProviderName: "registry.terraform.io/hashicorp/test",
AttributeValues: attributeValues{
"data": json.RawMessage(`{"woozles":"confuzles"}`),
},
SensitiveValues: json.RawMessage(`{"data":true}`),
},
},
false,
},
}

for name, test := range tests {
@@ -653,6 +744,11 @@ func testSchemas() *terraform.Schemas {
"bar": {Type: cty.String, Optional: true},
},
},
"test_map_attr": {
Attributes: map[string]*configschema.Attribute{
"data": {Type: cty.Map(cty.String), Optional: true, Computed: true, Sensitive: true},
},
},
},
},
},
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
)

// The main version number that is being run at the moment.
var Version = "1.0.1"
var Version = "1.0.2"

// A pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release