Commit Graph

30018 Commits

Author SHA1 Message Date
James Bardin
f31dab4838
Merge pull request #30830 from hashicorp/jbardin/data-schema-change
data schema changes may prevent state decoding
2022-04-14 09:46:59 -04:00
Shanee D
ed59bd7299
fix: Fix typo in v1.0 upgrade guide 2022-04-13 16:13:20 -07:00
Sebastian Rivera
3ebd8c9483
Merge pull request #30836 from hashicorp/sebasslash/env-cloud-e2e-tests
Cloud e2e tests for configuring `cloud` with env vars
2022-04-13 17:07:20 -04:00
Laura Pacilio
201c9168fa Clarify that users can set TF_WORKSPACE and use tags 2022-04-13 16:39:28 -04:00
Brandon Croft
bb7f4f8b8f
Merge pull request #30797 from hashicorp/brandonc/env_credentials
Allow remote service creds to be configured using env
2022-04-13 14:35:12 -06:00
Brandon Croft
f04202d222
Update credentials_test.go 2022-04-13 14:06:25 -06:00
Brandon Croft
8138fb7b29
Apply suggestions from documentation review
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-04-13 13:50:11 -06:00
Brandon Croft
fda05f3d44
feat(credentials): allow hyphens to be encoded as __ in variables
Hyphen characters are allowed in environment variable names, but are not valid POSIX variable names. Usually, it's still possible to set variable names with hyphens using utilities like env or docker. But, as a fallback, host names may encode their hyphens as double underscores in the variable name. For the example "café.fr", the variable name "TF_TOKEN_xn____caf__dma_fr" or "TF_TOKEN_xn--caf-dma_fr"
may be used.
2022-04-13 13:49:59 -06:00
Brandon Croft
dff6a8431c
Apply doc suggestions from code review
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-04-13 13:49:58 -06:00
Brandon Croft
307326fa3a
allow remote service creds to be configured using env
Introduces a new method of configuring token service credentials using a host-specific environment variable. This configuration was previously possible using the [terraform-credentials-env](https://github.com/apparentlymart/terraform-credentials-env) credentials helper.

This new method is now consulted first, as it is seen to be the most proximate source of credentials before CLI configuration while still falling back to the credentials helper.
2022-04-13 13:49:57 -06:00
Alisdair McDiarmid
714740454e
Merge pull request #30855 from hashicorp/alisdair/fix-diff-map-key-quoting
cli: Fix double-quoted map keys in diff UI
2022-04-13 15:40:49 -04:00
hc-github-team-tf-core
8546543509 Cleanup after v1.2.0-alpha20220413 release 2022-04-13 18:30:46 +00:00
hc-github-team-tf-core
7f84fd7308
Release v1.2.0-alpha20220413 2022-04-13 18:14:12 +00:00
Brandon Croft
0dc26a9585
test(cloud): nonexisting org not a valid test when using mocks 2022-04-13 09:27:13 -06:00
Brandon Croft
a38a0ee8a8
test(cloud): ensure mocks are used for backend configure tests
Also adds a few new tests for cloud configuration using environment variables
2022-04-13 08:56:27 -06:00
Alisdair McDiarmid
fadcaaaad2 cli: Fix double-quoted map keys in diff UI
A previous change added missing quoting around object keys which do not
parse as barewords. At the same time we introduced a bug where map keys
could be double-quoted, due to calling the `displayAttributeName` helper
function (to quote non-bareword keys) then using the `writeValue` method
(which quotes all strings).

This commit fixes this and adds test coverage for map keys which require
quoting.
2022-04-13 09:10:00 -04:00
Sebastian Rivera
b191faf8a4 Add skip test if missing vars helper 2022-04-12 17:32:39 -04:00
Kevin Wang
8eaf7fe85e
chore: vercel config (#30831)
- follows: https://github.com/hashicorp/terraform-cdk/pull/1611
2022-04-12 12:19:28 -04:00
Sebastian Rivera
34114286ff Cloud e2e tests for configuring with env vars 2022-04-11 15:19:17 -04:00
Sebastian Rivera
8040dfec34
Merge pull request #30787 from hashicorp/sebasslash/tf-workspace-cloud-config
Add cloud config support for TF_WORKSPACE
2022-04-11 14:38:23 -04:00
Sebastian Rivera
f95c7935c9
Update website/docs/cli/cloud/settings.mdx
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-04-11 14:33:13 -04:00
Sebastian Rivera
4c3429f1a0 Update docs to explain new TF_WORKSPACE behavior for cloud config 2022-04-11 14:09:24 -04:00
Sebastian Rivera
dd864b1bac Add TF_WORKSPACE validation method 2022-04-11 13:59:02 -04:00
James Bardin
74885b1108 remove data sources from state read and upgrade
Data sources should not require reading the previous versions. While we
previously skipped the decoding if it were to fail, this removes the
need for any prior state at all.

The only place where the prior state was functionally used was in the
destroy path. Because a data source destroy is only for cleanup purposes
to clean out the state using the same code paths as a managed resource,
we can substitute the prior state in the change change with a null value
to maintain the same behavior.
2022-04-11 11:55:53 -04:00
James Bardin
29ecac0808 remove the use of data source prior state entirely
After data source handling was moved from a separate refresh phase into
the planning phase, reading the existing state was only used for
informational purposes. This had been reduced to reporting warnings when
the provider returned an unexpected value to try and help locate legacy
provider bugs, but any actual issues located from those warnings were
very few and far between.

Because the prior state cannot be reliably decoded when faced with
incompatible provider schema upgrades, and there is no longer any
significant reason to try and get the prior state at all, we can skip
the process entirely.
2022-04-11 10:19:45 -04:00
James Bardin
a7987dec9f remove redundant readResourceInstanceState 2022-04-11 10:12:44 -04:00
James Bardin
01628f0d50 data schema changes may prevent state decoding
Data sources do not have state migrations, so there may be no way to
decode the prior state when faced with incompatible type changes.

Because prior state is only informational to the plan, and its existence
should not effect the planning process, we can skip decoding when faced
with errors.
2022-04-11 09:45:10 -04:00
Alisdair McDiarmid
51178958f3
Merge pull request #30825 from hashicorp/alisdair/fix-nested-attr-sensitive-collections
cli: Fix plan diff for sensitive nested attributes
2022-04-11 08:05:19 -04:00
Alisdair McDiarmid
d23f0998fb cli: Fix plan diff for sensitive nested attributes
When rendering diffs for resources which use nested attribute types, we
must cope with collections backing those attributes which are entirely
sensitive. The most common way this will be seen is through sensitive
values being present in sets, which will result in the entire set being
marked sensitive.
2022-04-08 16:16:52 -04:00
Eng Zer Jun
fedd315275
test: use T.TempDir to create temporary test directory (#30803)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-08 17:34:16 +01:00
Martin Atkins
5b615882e2
build: "Quick Checks" to run for external contributions
The "push" event is only for pushes to branches within the same repository.

Since external contributors make commits in their own repositories rather than directly in the target repository, we also need the pull_request event to react to opening a pull request and to pushing new code to an external branch associated with a pull request.

Since internal pull requests would in principle trigger both "push" _and_ "pull_request", we also constrain the push event only to the branches we typically release from, on the assumption that all other branches will merge into those via pull requests. This avoids redundantly running the same checks in response to two events at the same time.
2022-04-07 17:00:44 -07:00
Laura Pacilio
f9462d5d51 Update links to say "Custom Condition Checks" 2022-04-07 16:25:09 -04:00
Laura Pacilio
3ed8c5c467 Fix in-text link 2022-04-07 13:51:56 -04:00
Laura Pacilio
4c097842df Move conditionals information to conditional expressions page 2022-04-07 13:48:44 -04:00
Laura Pacilio
375b3583fd APply suggestions from PR review 2022-04-07 12:12:13 -04:00
Sebastian Rivera
9c0a8f7e35 Update env variable docs section to include TF_WORKSPACE 2022-04-07 11:46:36 -04:00
Sebastian Rivera
995ef15ab9 Add cloud configuration support for TF_WORKSPACE
TF_WORKSPACE can now be used for your cloud configuration, effectively serving as an alternative
to setting the name attribute in your workspaces configuration.
2022-04-07 11:46:36 -04:00
Laura Pacilio
3bc3bc52f8
Update website/docs/language/expressions/custom-conditions.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2022-04-07 11:40:01 -04:00
Laura Pacilio
b997c983a5
Update website/docs/language/expressions/custom-conditions.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2022-04-07 11:39:41 -04:00
Laura Pacilio
4ab955eeab
Update website/docs/language/expressions/custom-conditions.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2022-04-07 10:13:41 -04:00
Laura Pacilio
6b986c94bc
Update website/docs/language/expressions/custom-conditions.mdx
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
2022-04-07 10:12:49 -04:00
Laura Pacilio
d69cb58ff5 Add additional sections to condition expressions section 2022-04-06 17:01:04 -04:00
Laura Pacilio
eea860e0cf Fixing typos and doing a read through 2022-04-06 16:55:43 -04:00
Laura Pacilio
04d329a9e1 Add references to custom conditions on related pages 2022-04-06 16:11:36 -04:00
Laura Pacilio
5803963be8 more nitpicks 2022-04-06 15:45:27 -04:00
Laura Pacilio
62a7b51ba7 more edits 2022-04-06 15:41:02 -04:00
Laura Pacilio
3ae238a448 More language edits 2022-04-06 14:57:20 -04:00
Alisdair McDiarmid
6d03303b79
Merge pull request #30792 from hashicorp/alisdair/conclude-preconditions-postconditions-experiment
Conclude preconditions/postconditions experiment
2022-04-06 13:01:50 -04:00
Laura Pacilio
af7e688859 more language cleanup for clarity 2022-04-05 17:01:21 -04:00
Laura Pacilio
b2576a3df3 Update page name to Custom Conditions per feedback 2022-04-05 15:50:24 -04:00