Commit Graph

20312 Commits

Author SHA1 Message Date
James Bardin d216d19f21 change the FolderStorage key
updating the key will cause the FolderStorage hash to change forcing
modules to be re-fetched. This is required because any configurations
using the subDir notation will have the configuration in the wrong
directory.
2017-09-15 16:16:28 -04:00
James Bardin 6c20141c30 remove subdir handling from Tree.Load
Terraform was redundantly handling `//dir` notation which should be
handled by go-getter. Rather than allowing go-getter to unpack a subdir
as expected, the subdir was stripped off and accessed through the module
configuration.

This scheme will no longer works now that go-getter supports `*`
subdirectories
    (e.g. `//*` would be analogous to `tar --strip-components=1`).

Even though this allows Terraform to use go-getter's native unpacking,
detection is still done separately because Detect requires a `pwd` which
is dependent on the configuration directory and not known to the
global FolderStorage.
2017-09-15 16:16:28 -04:00
James Bardin a83ff57aea Add registry detector
Add a getter.Detector for detecting registry modules and looking up
the download location of the latest version. This is essentially a
temporary API until constraint solving is supported by the registry, as
then we'll have to supply the full set of known contraints to the
registry at once for resolution and we will fetch specific versions of
modules.
2017-09-15 16:16:28 -04:00
Martin Atkins 67bdadf5c6 release: clean up after v0.10.5 2017-09-14 21:40:05 +00:00
Martin Atkins 1f054df752
v0.10.5 2017-09-14 18:15:35 +00:00
Martin Atkins 625de9c961 Update CHANGELOG.md 2017-09-14 10:55:37 -07:00
Martin Atkins b161be0b8e Update CHANGELOG.md 2017-09-14 10:54:11 -07:00
Martin Atkins 0fe43c8977 cli: allow disabling "next steps" message in terraform plan
In #15884 we adjusted the plan output to give an explicit command to run
to apply a plan, whereas before this command was just alluded to in the
prose.

Since releasing that, we've got good feedback that it's confusing to
include such instructions when Terraform is running in a workflow
automation tool, because such tools usually abstract away exactly what
commands are run and require users to take different actions to
proceed through the workflow.

To accommodate such environments while retaining helpful messages for
normal CLI usage, here we introduce a new environment variable
TF_IN_AUTOMATION which, when set to a non-empty value, is a hint to
Terraform that it isn't being run in an interactive command shell and
it should thus tone down the "next steps" messaging.

The documentation for this setting is included as part of the "...in
automation" guide since it's not generally useful in other cases. We also
intentionally disclaim comprehensive support for this since we want to
avoid creating an extreme number of "if running in automation..."
codepaths that would increase the testing matrix and hurt maintainability.

The focus is specifically on the output of the three commands we give in
the automation guide, which at present means the following two situations:

* "terraform init" does not include the final paragraphs that suggest
  running "terraform plan" and tell you in what situations you might need
  to re-run "terraform init".
* "terraform plan" does not include the final paragraphs that either
  warn about not specifying "-out=..." or instruct to run
  "terraform apply" with the generated plan file.
2017-09-14 10:51:41 -07:00
Martin Atkins 5221e51749 Update CHANGELOG.md 2017-09-14 09:56:35 -07:00
Martin Atkins 2b8160cafe Update CHANGELOG.md 2017-09-14 09:52:27 -07:00
Martin Atkins b95610c173 Merge #15387: terraform fmt -check option
This new option causes fmt to return a non-zero exit code if any inconsistencies are detected.
2017-09-14 09:51:10 -07:00
Martin Atkins f208fc5a03 Update CHANGELOG.md 2017-09-14 09:48:37 -07:00
Micah Hausler 7fa4b648bb config: multi-line "indent" function
This function prepends a number of spaces on to all but the first line
of a string containing multiple lines of text.
2017-09-14 09:47:48 -07:00
James Bardin 4789045911 Merge pull request #16099 from hashicorp/jbardin/update-go-getter
update go-getter
2017-09-14 12:44:56 -04:00
James Bardin e39da6e1c9 update go-getter 2017-09-14 12:30:55 -04:00
Martin Atkins 144bc9e5f6 Update CHANGELOG.md 2017-09-14 09:29:11 -07:00
Martin Atkins fe4cfd03b5 command/format: restore "(forces new resource)" caption
In 3ea1592 the plan rendering was refactored to add an extra indirection
of producing a display-oriented plan object first and then rendering from
that object.

There was a logic error while adapting the existing plan rendering code
to use the new display-oriented object: the core InstanceDiff object sets
the "Destroy" flag (a boolean) for both DiffDestroy and DiffDestroyCreate,
and so this code previously checked r.Destroy to recognize the
"destroy-create" case. This was incorrectly adapted to a check for the
display action being DiffDestroy, when it should actually have been
DiffDestroyCreate.

The effect of this bug was to cause the "(forces new resource)"
annotations to not be displayed on attributes, though the resource-level
information still correctly reflected that a new resource was required.

This fix restores the attribute-level annotations.
2017-09-11 12:55:32 -07:00
Martin Atkins 93651450b1 website: don't talk about graphs in the Getting Started guide
Previously we just assumed the reader was familiar with the idea of a
graph but didn't explain it.

Since graphs are an implementation detail of Terraform, rather than
essential information needed for new users, this revises the introduction
text to talk only about _dependencies_, which we assume the user is
familiar with as a more practical concept.

Additionally, Paul Hinze did a great talk on how Terraform uses graphs
at HashiConf 2016 which is good additional content for our existing
"Graph Internals" page, which includes a concise explanation of the
basics of graph theory.
2017-09-11 11:09:11 -07:00
Chris Marchesi 9504d17bd9 Merge pull request #16036 from hashicorp/f-import-state-testing-id-func
helper/resource: Add ImportStateIdFunc
2017-09-08 13:40:31 -07:00
Shih Oon Liong bcfb63098a website: Example of using maps with local values 2017-09-08 10:33:56 -07:00
Justin Campbell 1f63a96b10 Merge pull request #16041 from justincampbell/website-local-values-usage-example
docs: Add local values usage example
2017-09-07 18:03:13 -04:00
Justin Campbell fd4cc78839 docs: Add local values usage example 2017-09-07 13:49:33 -04:00
Radek Simko 9f570a0c84 Merge pull request #16037 from hashicorp/b-readme-logo-url
docs: Fix logo URL in Readme
2017-09-07 17:48:40 +01:00
Radek Simko f729ef42ff docs: Fix logo URL in Readme 2017-09-07 11:14:42 +01:00
Chris Marchesi dc1f155728
helper/resource: Failure case for ImportStateIdFunc
Just to make sure returning an error was working.
2017-09-06 19:51:01 -07:00
Chris Marchesi 7bba1d0c95
helper/resource: Add ImportStateIdFunc
Add an ImportStateIdFunc field to the ImportState testing functionality.
This will allow for more powerful generation of complex import state IDs
that can't be accomplished by ImportStateId or ImportStateIdPrefix
themselves.
2017-09-06 19:44:43 -07:00
James Bardin 25f6e61047 release: clean up after v0.10.4 2017-09-06 20:33:48 +00:00
James Bardin 10df48ef40
v0.10.4 2017-09-06 20:22:10 +00:00
Martin Atkins 7360cf4349 Update CHANGELOG.md 2017-09-06 12:44:08 -07:00
tombuildsstuff d074b0da29 Obtaining the current metadata before setting it 2017-09-06 12:41:05 -07:00
tombuildsstuff a10d23dd95 Removing dead code 2017-09-06 12:41:05 -07:00
tombuildsstuff 1425205348 Upgrading to the latest Azure SDK's 2017-09-06 12:41:05 -07:00
James Bardin f5a3dc09a7 update CHANGELOG.md 2017-09-06 14:19:46 -04:00
Chris Doherty ec4cecc67b Merge pull request #15999 from hashicorp/cdoherty/doc-tweak
Cosmetic doc changes
2017-09-06 09:29:34 -07:00
Jake Champlin f49d882f06 Merge pull request #16027 from alexwlchan/quotes-in-docs
Add some missing quotes in the Module docs
2017-09-06 09:09:12 -04:00
Alex Chan a496b45c2c
Add some missing quotes in the Module docs 2017-09-06 10:44:59 +01:00
Chris Doherty 793b986860 Cosmetic doc changes:
- Having a map 'foo' with a key 'foo' is confusing.
  - it's -> its
2017-09-05 15:28:36 -07:00
James Bardin 19f9d1c93a Merge pull request #16023 from hashicorp/jbardin/update-go-getter
update go-getter
2017-09-05 18:11:39 -04:00
James Bardin 42764cbe94 update go-getter
Update to the latest go-getter to support unpacking github release
tarballs as modules.
2017-09-05 16:52:19 -04:00
Jake Champlin a9ef28ff93 Merge pull request #15984 from hashicorp/f-update-policy-vendor
Deps: Update Depedency for license
2017-09-05 16:22:40 -04:00
James Bardin 2863a51095 Merge pull request #15973 from synthdnb/consul-crash-fix
Fix crash when using consul backend
2017-09-05 10:22:08 -04:00
Jake Champlin 5d4931cb2e
Update AWS SDK to match AWS provider dep 2017-09-05 09:21:07 -04:00
Tom Harvey cbb512d374 Updating the AzureRM Backend Documentation (#15990)
* Updating to reference this has been renamed

* Clarifying Blob Storage
2017-09-04 07:56:16 +01:00
Minkyu Kim f12a237747 Fix crash when using consul backend 2017-09-02 20:05:30 +09:00
Martin Atkins 72da85e927 Update CHANGELOG.md 2017-09-01 18:00:16 -07:00
Martin Atkins 83414beb8f command: various adjustments to the diff presentation
The previous diff presentation was rather "wordy", and not very friendly
to those who can't see color either because they have color-blindness or
because they don't have a color-supporting terminal.

This new presentation uses the actual symbols used in the plan output
and tries to be more concise. It also uses some framing characters to
try to separate the different stages of "terraform plan" to make it
easier to visually navigate.

The apply command also adopts this new plan presentation, in preparation
for "terraform apply" (with interactive plan confirmation) becoming the
primary, safe workflow in the next major release.

Finally, we standardize on the terminology "perform" and "actions" rather
than "execute" and "changes" to reflect the fact that reading is now an
action and that isn't actually a _change_.
2017-09-01 17:55:05 -07:00
Martin Atkins 892f60efe0 core: test that we skip hooks for data source destroy
Data source destroy is an implementation detail and not something that
external callers should see or expect.
2017-09-01 17:55:05 -07:00
Martin Atkins e7a0aa96c8 core: add testHook for testing correct interaction with hooks 2017-09-01 17:55:05 -07:00
Martin Atkins 6712192724 core: don't advertise data source destroy via hooks
The fact that we clean up data source state by applying a "destroy" action
for them is an implementation detail, and so should not be visible to
outside callers or to the user.

Signalling these as real destroys creates confusion for users because
they see Terraform say things like:

    data.template_file.foo: Refreshing state..."

...which, to an understandably-nervous sysadmin, might make them suspect
that the underlying object was deleted, rather than just Terraform's
record of it.
2017-09-01 17:55:05 -07:00
Martin Atkins d4efc95191 command: show resource actions using resource addresses
Previously we were using the internal resource id syntax in the UI. Now
we'll use the standard user-facing resource address syntax instead.
2017-09-01 17:55:05 -07:00