Skip to content

Commit

Permalink
backport of commit 786993c
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed May 2, 2023
1 parent c1d350e commit ab65595
Show file tree
Hide file tree
Showing 1,477 changed files with 12,040 additions and 10,675 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Bug Report
description: Let us know about an unexpected error, a crash, or an incorrect behavior.
labels: ["bug", "new"]
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

blank_issues_enabled: false
contact_links:
- name: Terraform Cloud/Enterprise Troubleshooting and Feature Requests
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_issue.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Documentation Issue
description: Report an issue or suggest a change in the documentation.
labels: ["documentation", "new"]
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Feature Request
description: Suggest a new feature or other enhancement.
labels: ["enhancement", "new"]
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/equivalence-test/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: equivalence-test
description: "Execute the suite of Terraform equivalence tests in testing/equivalence-tests"
inputs:
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/go-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: 'Determine Go Toolchain Version'
description: 'Uses the .go-version file to determine which Go toolchain to use for any Go-related actions downstream.'
outputs:
Expand All @@ -20,4 +23,4 @@ runs:
# complex for automation.
run: |
echo "Building with Go $(cat .go-version)"
echo "::set-output name=version::$(cat .go-version)"
echo "version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
3 changes: 3 additions & 0 deletions .github/scripts/e2e_test_linux_darwin.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

set -uo pipefail

if [[ $arch == 'arm' || $arch == 'arm64' ]]
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/equivalence-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

set -uo pipefail

function usage {
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/get_product_version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

set -uo pipefail

# Trim the "v" prefix, if any.
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/check-legacy-links-format.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.0
1.20.7
32 changes: 16 additions & 16 deletions .release/ci.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

schema = "1"

project "terraform" {
Expand Down Expand Up @@ -136,23 +139,7 @@ event "promote-production-packaging" {
}
}

// commenting the ironbank update for now until it is all set up on the Ironbank side

// event "update-ironbank" {
// depends = ["promote-production-packaging"]
// action "update-ironbank" {
// organization = "hashicorp"
// repository = "crt-workflows-common"
// workflow = "update-ironbank"
// }

// notification {
// on = "always"
// }
// }

event "crt-hook-tfc-upload" {
// this will need to be changed back to update-ironbank once the Ironbank setup is done
depends = ["promote-production-packaging"]
action "crt-hook-tfc-upload" {
organization = "hashicorp"
Expand All @@ -164,3 +151,16 @@ event "crt-hook-tfc-upload" {
on = "always"
}
}

event "update-ironbank" {
depends = ["crt-hook-tfc-upload"]
action "update-ironbank" {
organization = "hashicorp"
repository = "crt-workflows-common"
workflow = "update-ironbank"
}

notification {
on = "always"
}
}
3 changes: 3 additions & 0 deletions .release/release-metadata.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

url_docker_registry_dockerhub = "https://hub.docker.com/r/hashicorp/terraform"
url_docker_registry_ecr = "https://gallery.ecr.aws/hashicorp/terraform"
url_license = "https://github.com/hashicorp/terraform/blob/main/LICENSE"
Expand Down
74 changes: 64 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,70 @@
## 1.5.0 (Unreleased)
## 1.5.7 (Unreleased)

BUG FIXES:

* `terraform init`: Terraform will no longer allow downloading remote modules to invalid paths. [#33745]

## 1.5.6 (August 23, 2023)

BUG FIXES:

* terraform_remote_state: Fixed a potential unsafe read panic when reading from multiple terraform_remote_state data sources ([#33333](https://github.com/hashicorp/terraform/issues/33333))

## 1.5.5 (August 9, 2023)

* `terraform init`: Fix crash when using invalid configuration in backend blocks. ([#33628](https://github.com/hashicorp/terraform/issues/33628))

## 1.5.4 (July 26, 2023)

BUG FIXES:

* `check` blocks: Fixes crash when nested data sources are within configuration targeted by the terraform import command. ([#33578](https://github.com/hashicorp/terraform/issues/33578))
* `check` blocks: Check blocks now operate in line with other checkable objects by also executing during import operations. ([#33578](https://github.com/hashicorp/terraform/issues/33578))

## 1.5.3 (July 12, 2023)

BUG FIXES:

* core: Terraform could fail to evaluate module outputs when they are used in a provider configuration during a destroy operation ([#33462](https://github.com/hashicorp/terraform/pull/33462))
* backend/consul: When failing to save state, `consul CAS failed with transaction errors` no longer shows an error instance memory address, but an actual error message. ([#33108](https://github.com/hashicorp/terraform/pull/33108))
* plan renderer: Fixes crash when rendering the plan if a relevant attribute contains an integer index specified as a string. ([#33475](https://github.com/hashicorp/terraform/issues/33475))

## 1.5.2 (June 28, 2023)

BUG FIXES:

* configs: Multiple `import` blocks with the same `id` string no longer result in a validation error ([#33434](https://github.com/hashicorp/terraform/issues/33434))

## 1.5.1 (June 21, 2023)

BUG FIXES:

* core: plan validation would fail for providers using nested set attributes with computed object attribute ([#33377](https://github.com/hashicorp/terraform/issues/33377))

## 1.5.0 (June 12, 2023)

NEW FEATURES:

* `check` blocks for validating infrastructure: Module and configuration authors can now write independent check blocks within their configuration to validate assertions about their infrastructure.

The new independent `check` blocks must specify at least one `assert` block, but possibly many, each one with a `condition` expression and an `error_message` expression matching the existing [Custom Condition Checks](https://developer.hashicorp.com/terraform/language/v1.4.x/expressions/custom-conditions).
The new independent `check` blocks must specify at least one `assert` block, but possibly many, each one with a `condition` expression and an `error_message` expression matching the existing [Custom Condition Checks](https://developer.hashicorp.com/terraform/language/v1.4.x/expressions/custom-conditions).
Additionally, check blocks can optionally load a scoped [data source](https://developer.hashicorp.com/terraform/language/v1.4.x/data-sources). Scoped data sources match the existing data sources with the exception that they can only be referenced from within their check block.

Unlike the existing `precondition` and `postcondition` blocks, Terraform will not halt execution should the scoped data block fail or error or if any of the assertions fail.
This allows practitioners to continually validate the state of their infrastructure outside the usual lifecycle management cycle.
Unlike the existing `precondition` and `postcondition` blocks, Terraform will not halt execution should the scoped data block fail or error or if any of the assertions fail.
This allows practitioners to continually validate the state of their infrastructure outside the usual lifecycle management cycle.

* `import` blocks for importing infrastructure: Root module authors can now use the `import` block to declare their intent that Terraform adopt an existing resource.

Import is now a configuration-driven, plannable action, and is processed as part of a normal plan. Running `terraform plan` will show a summary of the resources that Terraform has planned to import, along with any other plan changes.

The existing `terraform import` CLI command has not been modified.

This is an early version of the `import` block feature, for which we are actively seeking user feedback to shape future development. The `import` block currently does not support interpolation in the `id` field, which must be a string.

* Generating configuration for imported resources: in conjunction with the `import` block, this feature enables easy templating of configuration when importing existing resources into Terraform. A new flag `-generate-config-out=PATH` is added to `terraform plan`. When this flag is set, Terraform will generate HCL configuration for any resource included in an `import` block that does not already have associated configuration, and write it to a new file at `PATH`. Before applying, review the generated configuration and edit it as necessary.

* Adds a new `plantimestamp` function that returns the timestamp at plan time. This is similar to the `timestamp` function which returns the timestamp at apply time.
* Adds a new `strcontains` function that checks whether a given string contains a given substring. [GH-33069]
* Adds a new `plantimestamp` function that returns the timestamp at plan time. This is similar to the `timestamp` function which returns the timestamp at apply time ([#32980](https://github.com/hashicorp/terraform/pull/32980)).
* Adds a new `strcontains` function that checks whether a given string contains a given substring. ([#33069](https://github.com/hashicorp/terraform/issues/33069))


UPGRADE NOTES:
Expand All @@ -24,13 +77,14 @@ UPGRADE NOTES:

ENHANCEMENTS:

* Terraform CLI's local operations mode will now attempt to persist state snapshots to the state storage backend periodically during the apply step, thereby reducing the window for lost data if the Terraform process is aborted unexpectedly. [GH-32680]
* If Terraform CLI receives SIGINT (or its equivalent on non-Unix platforms) during the apply step then it will immediately try to persist the latest state snapshot to the state storage backend, with the assumption that a graceful shutdown request often typically followed by a hard abort some time later if the graceful shutdown doesn't complete fast enough. [GH-32680]
* `pg` backend: Now supports the `PG_CONN_STR`, `PG_SCHEMA_NAME`, `PG_SKIP_SCHEMA_CREATION`, `PG_SKIP_TABLE_CREATION` and `PG_SKIP_INDEX_CREATION` environment variables. [GH-33045]
* Terraform CLI's local operations mode will now attempt to persist state snapshots to the state storage backend periodically during the apply step, thereby reducing the window for lost data if the Terraform process is aborted unexpectedly. ([#32680](https://github.com/hashicorp/terraform/issues/32680))
* If Terraform CLI receives SIGINT (or its equivalent on non-Unix platforms) during the apply step then it will immediately try to persist the latest state snapshot to the state storage backend, with the assumption that a graceful shutdown request often typically followed by a hard abort some time later if the graceful shutdown doesn't complete fast enough. ([#32680](https://github.com/hashicorp/terraform/issues/32680))
* `pg` backend: Now supports the `PG_CONN_STR`, `PG_SCHEMA_NAME`, `PG_SKIP_SCHEMA_CREATION`, `PG_SKIP_TABLE_CREATION` and `PG_SKIP_INDEX_CREATION` environment variables. ([#33045](https://github.com/hashicorp/terraform/issues/33045))

BUG FIXES:

* `terraform init`: Fixed crash with invalid blank module name. [GH-32781]
* `terraform init`: Fixed crash with invalid blank module name. ([#32781](https://github.com/hashicorp/terraform/issues/32781))
* `moved` blocks: Fixed a typo in the error message that Terraform raises when you use `-target` to exclude an object that has been moved. ([#33149](https://github.com/hashicorp/terraform/issues/33149))

## Previous Releases

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This Dockerfile builds on golang:alpine by building Terraform from source
# using the current working directory.
#
Expand Down
3 changes: 3 additions & 0 deletions checkpoint.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

comment:
layout: "flags, files"
behavior: default
Expand Down
3 changes: 3 additions & 0 deletions commands.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package main

import (
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ to [the main Terraform CLI documentation](https://www.terraform.io/docs/cli/inde

## Contribution Guides

* [Contributing to Terraform](.github/CONTRIBUTING.md): a complete guideline for those who want to contribute to this project.
* [Contributing to Terraform](../.github/CONTRIBUTING.md): a complete guideline for those who want to contribute to this project.
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin5.0.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 5.0
//
// This file defines version 5.0 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin5.1.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 5.1
//
// This file defines version 5.1 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin5.2.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 5.2
//
// This file defines version 5.2 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin5.3.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 5.3
//
// This file defines version 5.3 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin6.0.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 6.0
//
// This file defines version 6.0 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin6.1.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 6.1
//
// This file defines version 6.1 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin6.2.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 6.2
//
// This file defines version 6.2 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions docs/plugin-protocol/tfplugin6.3.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// Terraform Plugin RPC protocol version 6.3
//
// This file defines version 6.3 of the RPC protocol. To implement a plugin
Expand Down
3 changes: 3 additions & 0 deletions experiments.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package main

// experimentsAllowed can be set to any non-empty string using Go linker
Expand Down

0 comments on commit ab65595

Please sign in to comment.