Commit Graph

10431 Commits

Author SHA1 Message Date
Mitchell Hashimoto d94f503501
command/state meta: State func 2016-05-11 09:16:48 -07:00
clint shryock e33847c8a8 Merge branch 'master' of github.com:hashicorp/terraform
* 'master' of github.com:hashicorp/terraform:
  Update CHANGELOG.md
  provider/vsphere: read gateway and ipv6_gateway
  provider/aws: Fix cloudtrail_tags config formatting in test (#6615)
  build: "make fmt" to ignore vendor packages
2016-05-11 10:39:21 -05:00
clint shryock 8344b4fb4b provider/aws: Format and correct IAM region for Cloudwatch test 2016-05-11 10:39:14 -05:00
James Nugent 9c0a175311 Update CHANGELOG.md 2016-05-11 11:25:35 -04:00
thetuxkeeper 5984f84c12 provider/vsphere: read gateway and ipv6_gateway
read gateway and ipv6_gateway information for vsphere_virtual_machine resources.
2016-05-11 11:21:54 -04:00
Clint 250ee8d089 provider/aws: Fix cloudtrail_tags config formatting in test (#6615) 2016-05-11 10:18:45 -05:00
James Nugent f0b39b6ced Merge pull request #6607 from apparentlymart/make-fmt-nonvendor
build: "make fmt" to ignore vendor packages
2016-05-11 10:51:51 -04:00
Mitchell Hashimoto f34ef1f92a
command: compilation works
This still isn't ready. But this gets tests passing and compilation
working
2016-05-10 17:03:58 -07:00
Martin Atkins 78a9f8bfb4 build: "make fmt" to ignore vendor packages
Several of our vendered dependencies are not gofmt-compliant, but we don't
want to fix that since the vendored code is supposed to exactly match
upstream.
2016-05-10 15:40:02 -07:00
stack72 87d4fd7e0c Merge branch 'db_option_group_settings' of https://github.com/Ticketmaster/terraform into Ticketmaster-db_option_group_settings 2016-05-10 22:37:14 +01:00
Paul Stack b0c37bf99c Update CHANGELOG.md 2016-05-10 22:34:40 +01:00
Thorsten Schifferdecker 4bbb9a674b fix typo (#6564) 2016-05-10 22:32:22 +01:00
qivers 9cc21d62f2 Correcting arn output to id (#6586)
Using `arn` as an output doesn't work, `id` does.
2016-05-10 22:32:07 +01:00
Paul Stack 8fce851878 provider/azurerm: Fixing Acceptance Test for VM tags (#6589) 2016-05-10 22:31:56 +01:00
Paul Hinze e14b21ab00 Update CHANGELOG.md 2016-05-10 16:27:19 -05:00
Paul Hinze 7bf140d573 Merge pull request #6599 from hashicorp/phinze/destroy-interpolation-error-redux
terraform: Correct fix for destroy interp errors
2016-05-10 16:26:08 -05:00
Paul Hinze 559f017ebb
terraform: Correct fix for destroy interp errors
The fix that landed in #6557 was unfortunately the wrong subset of the
work I had been doing locally, and users of the attached bugs are still
reporting problems with Terraform v0.6.16.

At the very last step, I attempted to scope down both the failing test
and the implementation to their bare essentials, but ended up with a
test that did not exercise the root of the problem and a subset of the
implementation that was insufficient for a full bugfix.

The key thing I removed from the test was a _referencing output_ for the
module, which is what breaks down the #6557 solution.

I've re-tested the examples in #5440 and #3268 to verify this solution
does indeed solve the problem.
2016-05-10 15:58:51 -05:00
Paul Hinze 8223e606df
terraform: add debug logging to Noop impls
This sort of output is needed to debug these codepaths anyways, so I
figured might as well leave it in.
2016-05-10 15:58:46 -05:00
James Nugent ac8bbd571d Merge pull request #6578 from f440/update-changelog
Update CHANGELOG.md
2016-05-10 16:26:36 -04:00
Mitchell Hashimoto 9ddf73ad81
website: update docs 2016-05-10 13:25:43 -07:00
Mitchell Hashimoto eaf3d608ed
terraform: test moving a module to be nested 2016-05-10 13:25:43 -07:00
Mitchell Hashimoto 04598baa25
website: document state mv 2016-05-10 13:25:42 -07:00
Mitchell Hashimoto c966a70ff9
command: update docs for state mv 2016-05-10 13:25:04 -07:00
Mitchell Hashimoto 32d0d29b56
command: test for moving into another state file 2016-05-10 13:25:04 -07:00
Mitchell Hashimoto 235e860118
command/state mv: handle -state-out to a different path 2016-05-10 13:25:04 -07:00
Mitchell Hashimoto c4e5355a02
command/state mv 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto 163f19fd00
terraform: instance => module 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto 4d268b6eca
terraform: instance => resource 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto e497c26517
terraform: resource => module 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto d3fcfcc027
terraform: moving resource to resource 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto e65a726936
terraform: copy deps and provider for resource state 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto cb060f9063
terraform: unify on init addr 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto c324062645
terraform: state add resource existing fails 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto 21d7ffc3f3
terraform: add resource 2016-05-10 13:25:03 -07:00
Mitchell Hashimoto 2de4324607
terraform: add stateadd to its own test file 2016-05-10 13:25:02 -07:00
Mitchell Hashimoto af3c3e4c60
terraform: Module copy copies outputs and dependencies 2016-05-10 13:25:02 -07:00
Mitchell Hashimoto 30cf550fc5
terraform: can't move module to module that exists 2016-05-10 13:25:02 -07:00
Mitchell Hashimoto bbc812d035
terraform: fix failing tests 2016-05-10 13:25:02 -07:00
Mitchell Hashimoto 25098f20c9
terraform: State.Add works for module to module (new) 2016-05-10 13:25:02 -07:00
Mitchell Hashimoto 407be65cc8
terraform: ResourceAddress should output instance type if set 2016-05-10 13:25:02 -07:00
James Nugent 4faa6b37e4 Merge pull request #6596 from hashicorp/merge-dev-0.7
Merge rebased dev-0.7 branch into master
2016-05-10 16:13:20 -04:00
James Nugent f1d0fc46aa core: Fix go vet issues shown by Travis 2016-05-10 16:00:28 -04:00
James Nugent 0f5f73eae1 Update CHANGELOG.md 2016-05-10 15:52:31 -04:00
James Nugent 6a20e8927d core: Fix issues from rebasing dev-0.7 onto master
- Fix sensitive outputs for lists and maps
- Fix test prelude which was missed during conflict resolution
- Fix `terraform output` to match old behaviour and not have outputs
  header and colouring
- Bump timeout on TestAtlasClient_UnresolvableConflict
2016-05-10 15:43:50 -04:00
James Nugent 9d77e0af6c core: Add new providers to internal list 2016-05-10 14:49:14 -04:00
James Nugent 7b6df27e4a helper/schema: Read native maps from configuration
This adds a test and the support necessary to read from native maps
passed as variables via interpolation - for example:

```
resource ...... {
     mapValue = "${var.map}"
}
```

We also add support for interpolating maps from the flat-mapped resource
config, which is necessary to support assignment of computed maps, which
is now valid.

Unfortunately there is no good way to distinguish between a list and a
map in the flatmap. In lieu of changing that representation (which is
risky), we assume that if all the keys are numeric, this is intended to
be a list, and if not it is intended to be a map. This does preclude
maps which have purely numeric keys, which should be noted as a
backwards compatibility concern.
2016-05-10 14:49:14 -04:00
James Nugent 244da895cd core: Remove StringList
Much celebration may now ensue! ♪┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓ ♪
2016-05-10 14:49:14 -04:00
James Nugent f49583d25a core: support native list variables in config
This commit adds support for native list variables and outputs, building
up on the previous change to state. Interpolation functions now return
native lists in preference to StringList.

List variables are defined like this:

variable "test" {
    # This can also be inferred
    type = "list"
    default = ["Hello", "World"]
}

output "test_out" {
    value = "${var.a_list}"
}
This results in the following state:

```
...
            "outputs": {
                "test_out": [
                    "hello",
                    "world"
                ]
            },
...
```

And the result of terraform output is as follows:

```
$ terraform output
test_out = [
  hello
  world
]
```

Using the output name, an xargs-friendly representation is output:

```
$ terraform output test_out
hello
world
```

The output command also supports indexing into the list (with
appropriate range checking and no wrapping):

```
$ terraform output test_out 1
world
```

Along with maps, list outputs from one module may be passed as variables
into another, removing the need for the `join(",", var.list_as_string)`
and `split(",", var.list_as_string)` which was previously necessary in
Terraform configuration.

This commit also updates the tests and implementations of built-in
interpolation functions to take and return native lists where
appropriate.

A backwards compatibility note: previously the concat interpolation
function was capable of concatenating either strings or lists. The
strings use case was deprectated a long time ago but still remained.
Because we cannot return `ast.TypeAny` from an interpolation function,
this use case is no longer supported for strings - `concat` is only
capable of concatenating lists. This should not be a huge issue - the
type checker picks up incorrect parameters, and the native HIL string
concatenation - or the `join` function - can be used to replicate the
missing behaviour.
2016-05-10 14:49:14 -04:00
Mitchell Hashimoto a49b17147a deps: vendor columnize 2016-05-10 14:49:14 -04:00
Mitchell Hashimoto 473a58a672 Add `terraform state list` command
This introduces the terraform state list command to list the resources
within a state. This is the first of many state management commands to
come into 0.7.

This is the first command of many to come that is considered a
"plumbing" command within Terraform (see "plumbing vs porcelain":
http://git.661346.n2.nabble.com/what-are-plumbing-and-porcelain-td2190639.html).
As such, this PR also introduces a bunch of groundwork to support
plumbing commands.

The main changes:

- Main command output is changed to split "common" and "uncommon"
  commands.

- mitchellh/cli is updated to support nested subcommands, since
  terraform state list is a nested subcommand.

- terraform.StateFilter is introduced as a way in core to filter/search
  the state files. This is very basic currently but I expect to make it
  more advanced as time goes on.

- terraform state list command is introduced to list resources in a
  state. This can take a series of arguments to filter this down.

Known issues, or things that aren't done in this PR on purpose:

- Unit tests for terraform state list are on the way. Unit tests for the
  core changes are all there.
2016-05-10 14:49:14 -04:00