Skip to content

Commit

Permalink
backport of commit ed0fc8a
Browse files Browse the repository at this point in the history
  • Loading branch information
alisdair committed Jun 21, 2021
1 parent 3acb5e2 commit 0da7b48
Show file tree
Hide file tree
Showing 164 changed files with 932 additions and 7,574 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
If your issue relates to Terraform Cloud/Enterprise, please contact tf-cloud@hashicorp.support.
If your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers.
To fix problems, we need clear reproduction cases - we need to be able to see it happen locally. A reproduction case is ideally something a Terraform Core engineer can git-clone or copy-paste and run immediately, without inventing any details or context.
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Terraform Cloud/Enterprise Troubleshooting and Feature Requests
url: https://support.hashicorp.com/hc/en-us/requests/new
about: For issues and feature requests related to the Terraform Cloud/Enterprise platform, please submit a HashiCorp support request or email tf-cloud@hashicorp.support
- name: Provider-related Feedback and Questions
url: https://github.com/terraform-providers
about: Each provider (e.g. AWS, Azure, GCP, Oracle, K8S, etc.) has its own repository, any provider related issues or questions should be directed to appropriate provider repository.
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
For feature requests concerning Terraform Cloud/Enterprise, please contact tf-cloud@hashicorp.support
If your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers.
If your issue relates to a specific Terraform provider, please open it in the provider's own repository. The index of providers is at https://github.com/terraform-providers .
-->

### Current Terraform Version
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/issue-comment-created.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/lock.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .hashibot.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
behavior "remove_labels_on_reply" "remove_stale" {
labels = ["waiting-response", "stale"]
only_non_maintainers = true
}

poll "label_issue_migrater" "provider_migrater" {
schedule = "0 20 * * * *"
new_owner = env.PROVIDERS_OWNER
repo_prefix = "terraform-provider-"
label_prefix = "provider/"
excluded_label_prefixes = ["backend/", "provisioner/"]
excluded_labels = ["build", "cli", "config", "core", "new-provider", "new-provisioner", "new-remote-state", "provider/terraform"]
aliases = {
"provider/google-cloud" = "provider/google"
"provider/influx" = "provider/influxdb"
"provider/vcloud" = "provider/vcd"
}
issue_header = <<-EOF
_This issue was originally opened by @${var.user} as ${var.repository}#${var.issue_number}. It was migrated here as a result of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._
<hr>
EOF
migrated_comment = "This issue has been automatically migrated to ${var.repository}#${var.issue_number} because it looks like an issue with that provider. If you believe this is _not_ an issue with the provider, please reply to ${var.repository}#${var.issue_number}."
}

poll "closed_issue_locker" "locker" {
schedule = "0 50 1 * * *"
closed_for = "720h" # 30 days
no_comment_if_no_activity_for = "1440h" # 60 days
max_issues = 500
sleep_between_issues = "5s"

message = <<-EOF
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
EOF
}
26 changes: 17 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
## 1.1.0 (Unreleased)

NEW FEATURES:

* command/add: `terraform add` generates resource configuration templates [GH-28874]
* lang/funcs: add a new `type()` function, only available in `terraform console` ([#28501](https://github.com/hashicorp/terraform/issues/28501))
## 1.0.1 (Unreleased)

ENHANCEMENTS:

* configs: Terraform now checks the syntax of and normalizes module source addresses (the `source` argument in `module` blocks) during configuration decoding rather than only at module installation time. This is largely just an internal refactoring, but a visible benefit of this change is that the `terraform init` messages about module downloading will now show the canonical module package address Terraform is downloading from, after interpreting the special shorthands for common cases like GitHub URLs. ([#28854](https://github.com/hashicorp/terraform/issues/28854))
* json-output: The JSON plan output now indicates which state values are sensitive. [GH-28889]

BUG FIXES:

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

## 1.0.0 (June 08, 2021)

Terraform v1.0 is an unusual release in that its primary focus is on stability, and it represents the culmination of several years of work in previous major releases to make sure that the Terraform language and internal architecture will be a suitable foundation for forthcoming additions that will remain backward compatible.

Terraform v1.0.0 intentionally has no significant changes compared to Terraform v0.15.5. You can consider the v1.0 series as a direct continuation of the v0.15 series; we do not intend to issue any further releases in the v0.15 series, because all of the v1.0 releases will be only minor updates to address bugs.

For all future minor releases with major version 1, we intend to preserve backward compatibility as described in detail in [the Terraform v1.0 Compatibility Promises](https://www.terraform.io/docs/language/v1-compatibility-promises.html). The later Terraform v1.1.0 will, therefore, be the first minor release with new features that we will implement with consideration of those promises.

## Previous Releases

For information on prior major and minor releases, see their changelogs:
For information on prior major releases, see their changelogs:

* [v1.0](https://github.com/hashicorp/terraform/blob/v1.0/CHANGELOG.md)
* [v0.15](https://github.com/hashicorp/terraform/blob/v0.15/CHANGELOG.md)
* [v0.14](https://github.com/hashicorp/terraform/blob/v0.14/CHANGELOG.md)
* [v0.13](https://github.com/hashicorp/terraform/blob/v0.13/CHANGELOG.md)
Expand Down
6 changes: 0 additions & 6 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ func initCommands(
// that to match.

Commands = map[string]cli.CommandFactory{
"add": func() (cli.Command, error) {
return &command.AddCommand{
Meta: meta,
}, nil
},

"apply": func() (cli.Command, error) {
return &command.ApplyCommand{
Meta: meta,
Expand Down
4 changes: 0 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ to [the main Terraform CLI documentation](https://www.terraform.io/docs/cli/inde
This documentation is for SDK developers, and is not necessary reading for
those implementing a provider using the official SDK.

* [How Terraform Uses Unicode](./unicode.md): an overview of the various
features of Terraform that rely on Unicode and how to change those features
to adopt new versions of Unicode.

## Contribution Guides

* [Maintainer Etiquette](./maintainer-etiquette.md): guidelines and expectations
Expand Down
69 changes: 50 additions & 19 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ during the graph walk:
context for processing within a single module, and is the primary means
by which the namespaces in each module are kept separate.

* `EnterEvalTree` and `ExitEvalTree` are each called once for each vertex
in the graph during _vertex evaluation_, which is described in the following
section.

Each vertex in the graph is evaluated, in an order that guarantees that the
"happens after" edges will be respected. If possible, the graph walk algorithm
will evaluate multiple vertices concurrently. Vertex evaluation code must
Expand All @@ -260,7 +264,7 @@ to safely implement concurrent reads and writes from the shared state.
## Vertex Evaluation

The action taken for each vertex during the graph walk is called
_execution_. Execution runs a sequence of arbitrary actions that make sense
_evaluation_. Evaluation runs a sequence of arbitrary actions that make sense
for a particular vertex type.

For example, evaluation of a vertex representing a resource instance during
Expand All @@ -286,10 +290,13 @@ a plan operation would include the following high-level steps:
* Save the instance diff as part of the plan that is being constructed by
this operation.

Each execution step for a vertex is an implementation of
[`terraform.Execute`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/erraform#Execute).
<!-- FIXME: EvalNode was removed in hashicorp/terraform#26413
The paragraphs below needs to be updated to reflect the current evaluation logic.
-->
Each evaluation step for a vertex is an implementation of
[`terraform.EvalNode`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalNode).
As with graph transforms, the behavior of these implementations varies widely:
whereas graph transforms can take any action against the graph, an `Execute`
whereas graph transforms can take any action against the graph, an `EvalNode`
implementation can take any action against the `EvalContext`.

The implementation of `terraform.EvalContext` used in real processing
Expand All @@ -298,21 +305,45 @@ The implementation of `terraform.EvalContext` used in real processing
It provides coordinated access to plugins, the current state, and the current
plan via the `EvalContext` interface methods.

In order to be executed, a vertex must implement
[`terraform.GraphNodeExecutable`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#GraphNodeExecutable),
which has a single `Execute` method that handles. There are numerous `Execute`
implementations with different behaviors, but some prominent examples are:

* [NodePlannableResource.Execute](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#NodePlannableResourceInstance.Execute), which handles the `plan` operation.

* [`NodeApplyableResourceInstance.Execute`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#NodeApplyableResourceInstance.Execute), which handles the main `apply` operation.

* [`NodeDestroyResourceInstance.Execute`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalWriteState), which handles the main `destroy` operation.

A vertex must complete successfully before the graph walk will begin evaluation
for other vertices that have "happens after" edges. Evaluation can fail with one
or more errors, in which case the graph walk is halted and the errors are
returned to the user.
In order to be evaluated, a vertex must implement
[`terraform.GraphNodeEvalable`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#GraphNodeEvalable),
which has a single method that returns an `EvalNode`. In practice, most
implementations return an instance of
[`terraform.EvalSequence`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalSequence),
which wraps a number of other `EvalNode` objects to be executed in sequence.

There are numerous `EvalNode` implementations with different behaviors, but
some prominent examples are:

* [`EvalReadState`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalReadState),
which extracts the data for a particular resource instance from the state.

* [`EvalWriteState`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalWriteState),
which conversely replaces the data for a particular resource instance in
the state with some updated data resulting from changes made by the
provider.

* [`EvalInitProvider`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalInitProvider),
which starts up a provider plugin and passes the user-provided configuration
to it, caching the provider inside the `EvalContext`.

* [`EvalGetProvider`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalGetProvider),
which retrieves an already-initialized provider that is cached in the
`EvalContext`.

* [`EvalValidateResource`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalValidateResource),
which checks to make sure that resource configuration conforms to the
expected schema and gives a provider plugin the opportunity to check that
given values are within the expected range, etc.

* [`EvalApply`](https://pkg.go.dev/github.com/hashicorp/terraform/internal/terraform#EvalApply),
which calls into a provider plugin to make apply some planned changes
to a given resource instance.

All of the evaluation steps for a vertex must complete successfully before
the graph walk will begin evaluation for other vertices that have
"happens after" edges. Evaluation can fail with one or more errors, in which
case the graph walk is halted and the errors are returned to the user.

### Expression Evaluation

Expand Down
6 changes: 1 addition & 5 deletions docs/destroying.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,14 @@ digraph replacement {
}
a -> a_d [dir=back];
a -> b_d;
b -> a_d [dir=back];
b -> b_d;
}
-->


Order of operations:
1. `B` is destroyed
2. `A` is created
1. `B` is destroyed AND `A` is created
1. `B` is created
1. `A` is destroyed

Expand Down Expand Up @@ -316,7 +314,6 @@ digraph replacement {
}
a -> a_d;
a -> b_d [style=dotted];
b -> a_d [style=dotted];
b -> b_d [dir=back];
}
Expand All @@ -343,7 +340,6 @@ digraph replacement {
}
a -> a_d [dir=back];
a -> b_d [dir=back, style=dotted];
b -> a_d [dir=back, style=dotted];
b -> b_d [dir=back];
}
Expand Down
Binary file modified docs/images/replace_all_cbd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/replace_all_cbd_dep.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/replace_cbd_incorrect.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0da7b48

Please sign in to comment.