Commit Graph

28453 Commits

Author SHA1 Message Date
Sam Salisbury 2337334b1f ci: add darwin/arm64 build 2021-06-30 12:44:46 +01:00
Kristin Laemmert 35c19d7c9f
command/jsonstate: remove redundant remarking of resource instance (#29049)
* command/jsonstate: remove redundant remarking of resource instance

ResourceInstanceObjectSrc.Decode already handles marking values with any marks stored in ri.Current.AttrSensitivePaths, so re-applying those marks is not necessary.

We've gotten reports of panics coming from this line of code, though I have yet to reproduce the panic in a test.

* Implement test to reproduce panic on #29042

Co-authored-by: David Alger <davidmalger@gmail.com>
2021-06-29 10:59:20 -04:00
Laura Pacilio a2cab95dac
Update copy for active voice and concision 2021-06-29 09:15:01 -04:00
Laura Pacilio 740343cfd2
Update website/intro/use-cases.html.markdown
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2021-06-29 09:02:02 -04:00
Laura Pacilio 2cb8bbaacd
Update website/intro/use-cases.html.markdown
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2021-06-29 09:01:25 -04:00
Laura Pacilio 16bea6a949
Update website/intro/use-cases.html.markdown
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2021-06-29 09:01:13 -04:00
Laura Pacilio 7cb7d641b7
Remove top header and add provider language 2021-06-29 08:56:04 -04:00
Laura Pacilio 46708ea4bc
Update website/intro/vs/chef-puppet.html.markdown
Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
2021-06-29 08:44:53 -04:00
Laura Pacilio f526e6eadc Update page description metadata 2021-06-28 17:14:34 -04:00
Laura Pacilio 5e89ac590e Update page description metadata 2021-06-28 17:10:11 -04:00
Laura Pacilio 908ceec8c1 Update page description metadata 2021-06-28 17:06:50 -04:00
Laura Pacilio fc772aec86 Update page content for clarity, concision, and flow 2021-06-28 17:03:30 -04:00
Laura Pacilio 2f67c78821 Update page description metadata 2021-06-28 16:50:37 -04:00
Laura Pacilio 4111b1298d Update page description metadata 2021-06-28 16:47:37 -04:00
Martin Atkins 512e4e7f13
Update CHANGELOG.md 2021-06-28 13:44:24 -07:00
Martin Atkins 70bc432f85 command/views/json: Never generate invalid diagnostic snippet offsets
Because our snippet generator is trying to select whole lines to include
in the snippet, it has some edge cases for odd situations where the
relevant source range starts or ends directly at a newline, which were
previously causing this logic to return out-of-bounds offsets into the
code snippet string.

Although arguably it'd be better for the original diagnostics to report
more reasonable source ranges, it's better for us to report a
slightly-inaccurate snippet than to crash altogether, and so we'll extend
our existing range checks to check both bounds of the string and thus
avoid downstreams having to deal with out-of-bounds indices.

For completeness here I also added some similar logic to the
human-oriented diagnostic formatter, which consumes the result of the
JSON diagnostic builder. That's not really needed with the additional
checks in the JSON diagnostic builder, but it's nice to reinforce that
this code can't panic (in this way, at least) even if its input isn't
valid.
2021-06-28 13:42:28 -07:00
Laura Pacilio 5344ba0fa5 Update page description metadata 2021-06-28 16:00:16 -04:00
Laura Pacilio 0ab2012d77 Update page description metadata 2021-06-28 15:59:36 -04:00
Laura Pacilio e92f030662 Make get started bullet more concise 2021-06-28 11:38:21 -04:00
Laura Pacilio 60f240f8cf Update description and edit for concision and clarity 2021-06-28 11:33:06 -04:00
James Bardin c687ebeaf1
Merge pull request #29039 from hashicorp/jbardin/sensitive
New marks.Sensitive type, and audit of sensitive marks usage
2021-06-25 17:11:59 -04:00
James Bardin 80ef795cbf add marks.Raw 2021-06-25 14:27:43 -04:00
James Bardin 55ebb2708c remove IsMarked and ContainsMarked calls
Make sure sensitivity checks are looking for specific marks rather than
any marks at all.
2021-06-25 14:17:06 -04:00
James Bardin cdf7469efd marks.Has and marks.Contains 2021-06-25 14:17:03 -04:00
James Bardin d9dfd451ea update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
James Bardin 2c493e38c7 marks package
marks.Sensitive
2021-06-25 12:35:51 -04:00
Kristin Laemmert 051c5c9d50
Update CHANGELOG.md 2021-06-25 08:53:29 -04:00
Kristin Laemmert 096010600d
terraform: use hcl.MergeBodies instead of configs.MergeBodies for pro… (#29000)
* terraform: use hcl.MergeBodies instead of configs.MergeBodies for provider configuration

Previously, Terraform would return an error if the user supplied provider configuration via interactive input iff the configuration provided on the command line was missing any required attributes - even if those attributes were already set in config.

That error came from configs.MergeBody, which was designed for overriding valid configuration. It expects that the first ("base") body has all required attributes. However in the case of interactive input for provider configuration, it is perfectly valid if either or both bodies are missing required attributes, as long as the final body has all required attributes. hcl.MergeBodies works very similarly to configs.MergeBodies, with a key difference being that it only checks that all required attributes are present after the two bodies are merged.

I've updated the existing test to use interactive input vars and a schema with all required attributes. This test failed before switching from configs.MergeBodies to hcl.MergeBodies.

* add a command package test that shows that we can still have providers with dynamic configuration + required + interactive input merging

This test failed when buildProviderConfig still used configs.MergeBodies instead of hcl.MergeBodies
2021-06-25 08:48:47 -04:00
Izaak Lauer 231175204d
Small comment typo 2021-06-24 16:41:58 -04:00
Martin Atkins a945b379d8 website: Explicit examples of -var escaping in various shells
The -var command line option comes with the disadvantage that a user must
contend both with Terraform's own parser and with the parser in whichever
shell they've decided to use, and different shells on different platforms
have different rules.

Previously we've largely just assumed that folks know the appropriate
syntax for the shell they chose, but it seems that command lines involving
spaces and other special characters arise rarely enough in other commands
that Terraform is often the first time someone needs to learn the
appropriate syntax for their shell.

We can't possibly capture all of the details of all shells in our docs,
because that's far outside of our own scope, but hopefully this new
section will go some way to give some real examples that will help folks
figure out how to write suitable escape sequences, if they choose to
set complex variable values on the command line rather than in .tfvars
as we recommend elsewhere on this page.
2021-06-22 14:10:04 -07:00
Robin Norwood 50fe980877
Merge pull request #28998 from hashicorp/rln-add-versions-tutorials-links
Add links to terraform versions tutorials
2021-06-22 11:50:18 -05:00
Vlad Romanenko d4d56a96b1
Add back missing closing quote character 2021-06-22 15:20:31 +01:00
Robin Norwood 2c71bb3a2e Add links to terraform versions tutorials 2021-06-21 14:26:43 -05:00
Alisdair McDiarmid d54bcb6276
Merge pull request #28994 from hashicorp/alisdair/cty-1.8.4
Upgrade cty to v1.8.4
2021-06-21 12:48:31 -04:00
Alisdair McDiarmid ed0fc8a3ff go get github.com/zclconf/go-cty@v1.8.4 2021-06-21 12:14:14 -04:00
Kristin Laemmert 3acb5e2841
configs: add decodeMovedBlock behind a locked gate. (#28973)
This PR adds decoding for the upcoming "moved" blocks in configuration. This code is gated behind an experiment called EverythingIsAPlan, but the experiment is not registered as an active experiment, so it will never run (there is a test in place which will fail if the experiment is ever registered).

This also adds a new function to the Targetable interface, AddrType, to simplifying comparing two addrs.Targetable.

There is some validation missing still: this does not (yet) descend into resources to see if the actual resource types are the same (I've put this off in part because we will eventually need the provider schema to verify aliased resources, so I suspect this validation will have to happen later on).
2021-06-21 10:53:16 -04:00
Radek Simko bb868606ea
docs: Document naming conventions for templates & backend configs (#28924)
* docs: Document naming conventions for templates & backend configs

* Update website/docs/cli/config/config-file.html.md

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>

* Update website/docs/language/functions/templatefile.html.md

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>

Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2021-06-18 17:20:00 +01:00
Alisdair McDiarmid 4daf798b21
Update CHANGELOG.md 2021-06-18 12:05:22 -04:00
Kurt Lehnardt 165b2a2509
fixed typo 2021-06-18 09:59:56 -06:00
Alisdair McDiarmid 5611da8eb5
Merge pull request #28975 from hashicorp/alisdair/jsonplan-drift
json-output: Omit unchanged resource_drift entries
2021-06-18 11:37:49 -04:00
James Bardin b7180d07f8
Merge pull request #28979 from hashicorp/jbardin/fixup-body-context
blocktoattr fixup dropping MissingItemRange
2021-06-18 09:58:52 -04:00
James Bardin 6a495c8d42 fixupBody missing MissingItemRange
When blocktoattr.fixupBody returned its content, the value for
`MissingItemRange` was omitted, losing the diagnostic Subject.
2021-06-18 09:05:56 -04:00
Alisdair McDiarmid 3326ab7dae json-output: Omit unchanged resource_drift entries
Previously, if any resources were found to have drifted, the JSON plan
output would include a drift entry for every resource in state. This
commit aligns the JSON plan output with the CLI UI, and only includes
those resources where the old value does not equal the new value---i.e.
drift has been detected.

Also fixes a bug where the "address" field was missing from the drift
output, and adds some test coverage.
2021-06-17 15:09:16 -04:00
Kristin Laemmert af68a1e55a
Update CHANGELOG.md 2021-06-17 12:10:55 -04:00
Kristin Laemmert 583859e510
commands: `terraform add` (#28874)
* command: new command, terraform add, generates resource templates

terraform add ADDRESS generates a resource configuration template with all required (and optionally optional) attributes set to null. This can optionally also pre-populate nonsesitive attributes with values from an existing resource of the same type in state (sensitive vals will be populated with null and a comment indicating sensitivity)

* website: terraform add documentation
2021-06-17 12:08:37 -04:00
hc-github-team-tf-core d6e9739b26 Cleanup after v1.1.0-alpha20210616 release 2021-06-16 13:42:38 +00:00
hc-github-team-tf-core 191ccfd5ab
Release v1.1.0-alpha20210616 2021-06-16 13:25:04 +00:00
Bryan Eastes 714632206c
Quoting filesystem path in scp command argument (#28626)
* Quoting filesystem path in scp command argument

* Adding proper shell quoting for scp commands

* Running go fmt

* Using a library for quoting shell commands

* Don't export quoteShell function
2021-06-15 10:04:01 -07:00
James Bardin 2ecdf44918
Merge pull request #28941 from hashicorp/jbardin/objchange-unknown-blocks
handle unexpected changes to unknown block
2021-06-14 10:31:31 -04:00
Kristin Laemmert adc1321a19
Update CHANGELOG.md 2021-06-14 09:25:58 -04:00