Commit Graph

550 Commits

Author SHA1 Message Date
James Bardin 9acb86a182 Merge pull request #11187 from hashicorp/jbardin/state-locking
State Locking initial implementations
2017-02-01 14:35:55 -05:00
Seth Vargo 0d39123cb0
Update error message when no outputs are defined
Terraform can't tell the difference between an empty output and an
undefined output. This is often confusing for folks using interpolation.
As much as it would be great to fix upstream, changing this error
message to be a bit more helpful is a good stop-gap to avoid
frustration.
2017-01-31 15:20:11 -08:00
Seth Vargo 037d4b6c87
Suggest refresh instead of apply
Suggesting an apply could actually change remote resources whereas a
refresh will at-worst modify local state.
2017-01-31 15:12:11 -08:00
James Bardin 11d601ad6d TestRefresh_badState can be re-enabled
Refactored the code to maintain the behavior.
2017-01-30 18:06:30 -05:00
James Bardin 1380bbedb2 don't print err in Fatalf when it's nil 2017-01-30 18:02:35 -05:00
James Bardin b8bd4846db fix test despite original comments
Original comments were incorrect, and the test was checking for the
absence of state
2017-01-30 17:55:49 -05:00
James Bardin 39ca4fa2f8 Ensure that backend tests check for data in state
Test should not simply check for the existence of a file for state, but
make sure that file also contains data.
2017-01-30 17:48:39 -05:00
James Bardin 8f7f1917f2 Remove state file data when writing a nil state
The old behavior in this situation was to simply delete the file. Since
we now have a lock on this file we don't want to close or delete it, so
instead truncate the file at offset 0.

Fix a number of related tests
2017-01-30 17:16:57 -05:00
James Bardin eb59b5925e Fix some tests, and make rest fail with good errs
Having the state files always created for locking breaks a lot of tests.
Most can be fixed by simple checking for state within a file, but a few
still might be writing state when they shouldn't.
2017-01-30 17:16:57 -05:00
Mitchell Hashimoto 61881d2795 Merge pull request #10934 from hashicorp/f-provisioner-stop
core: stoppable provisioners, helper/schema for provisioners
2017-01-30 12:53:15 -08:00
Mitchell Hashimoto b8c310c61e
command: update test failure to correct message 2017-01-27 21:24:58 -08:00
Mitchell Hashimoto 09242fab09
terraform: remove legacy graph builder 2017-01-26 15:18:42 -08:00
Mitchell Hashimoto 83cc54bfbe
updated generate output 2017-01-26 15:11:47 -08:00
Mitchell Hashimoto 09e0727d5e
command/plan: revert test change on this output 2017-01-26 14:48:17 -08:00
Mitchell Hashimoto d9bc1572eb
command: remove old State funcs 2017-01-26 14:33:50 -08:00
Mitchell Hashimoto ad7b063262
command: convert to use backends 2017-01-26 14:33:49 -08:00
Mitchell Hashimoto 9654387771
command: meta.Backend is used for initializing the backend
This is a complex function that handles all the potential cases that can
happen with legacy remote state, new configurations, etc.
2017-01-26 14:33:49 -08:00
Mitchell Hashimoto 0a0842a7d9
command/format: a package for formatting plans/state for output 2017-01-26 14:33:49 -08:00
Mitchell Hashimoto f84fd39ef9
command/import: document -var-file and -var is available #11211 2017-01-24 13:02:54 -08:00
Paul Stack 987b910828 Ns1 provider (#10782)
* vendor: update gopkg.in/ns1/ns1-go.v2

* provider/ns1: Port the ns1 provider to Terraform core

* docs/ns1: Document the ns1 provider

* ns1: rename remaining nsone -> ns1 (#10805)

* Ns1 provider (#11300)

* provider/ns1: Flesh out support for meta structs.

Following the structure outlined by @pashap.

Using reflection to reduce copy/paste.

Putting metas inside single-item lists.  This is clunky, but I couldn't
figure out how else to have a nested struct.  Maybe the Terraform people
know a better way?

Inside the meta struct, all fields are always written to the state; I
can't figure out how to omit fields that aren't used.  This is not just
verbose, it actually causes issues because you can't have both "up" and
"up_feed" set).

Also some minor other changes:
- Add "terraform" import support to records and zones.
- Create helper class StringEnum.

* provider/ns1: Make fmt

* provider/ns1: Remove stubbed out RecordRead (used for testing metadata change).

* provider/ns1: Need to get interface that m contains from Ptr Value with Elem()

* provider/ns1: Use empty string to indicate no feed given.

* provider/ns1: Remove old record.regions fields.

* provider/ns1: Removes redundant testAccCheckRecordState

* provider/ns1: Moves account permissions logic to permissions.go

* provider/ns1: Adds tests for team resource.

* provider/ns1: Move remaining permissions logic to permissions.go

* ns1/provider: Adds datasource.config

* provider/ns1: Small clean up of datafeed resource tests

* provider/ns1: removes testAccCheckZoneState in favor of explicit name check

* provider/ns1: More renaming of nsone -> ns1

* provider/ns1: Comment out metadata for the moment.

* Ns1 provider (#11347)

* Fix the removal of empty containers from a flatmap

Removal of empty nested containers from a flatmap would sometimes fail a
sanity check when removed in the wrong order. This would only fail
sometimes due to map iteration. There was also an off-by-one error in
the prefix check which could match the incorrect keys.

* provider/ns1: Adds ns1 go client through govendor.

* provider/ns1: Removes unused debug line

* docs/ns1: Adds docs around apikey/datasource/datafeed/team/user/record.

* provider/ns1: Gets go vet green
2017-01-23 21:41:07 +00:00
Paul Stack 798bf60ef9 command/plugin_list: Adding Alicloud to the plugin list file (#11292) 2017-01-19 17:01:14 +00:00
Jasmin Gacic 7e9c850936 Terraform ProfitBricks Builder (#7943)
* Terraform ProfitBricks Builder

* make fmt

* Merge remote-tracking branch 'upstream/master' into terraform-provider-profitbricks

# Conflicts:
#	command/internal_plugin_list.go

* Addressing PR remarks

* Removed importers
2017-01-18 14:43:09 +00:00
clint shryock 87bb691800 Revert "New provider arukas (#10862)"
This reverts commit 9176bd4861.
This provider includes a dependency that at time of writing requires a
*nix system, and will not build on Windows.
2017-01-11 09:04:32 -06:00
Kazumichi Yamamoto 9176bd4861 New provider arukas (#10862)
* Add a Arukas provider

* Add dependencies for the Arukas provider

* Add documents for the Arukas
2017-01-09 17:14:33 +00:00
Tom Harvey 05d00a93ce New Provider: OpsGenie (#11012)
* Importing the OpsGenie SDK

* Adding the goreq dependency

* Initial commit of the OpsGenie / User provider

* Refactoring to return a single client

* Adding an import test / fixing a copy/paste error

* Adding support for OpsGenie docs

* Scaffolding the user documentation for OpsGenie

* Adding a TODO

* Adding the User data source

* Documentation for OpsGenie

* Adding OpsGenie to the internal plugin list

* Adding support for Teams

* Documentation for OpsGenie Team's

* Validation for Teams

* Removing Description for now

* Optional fields for a User: Locale/Timezone

* Removing an implemented TODO

* Running makefmt

* Downloading about half the internet

Someone witty might simply sign this commit with "npm install"

* Adding validation to the user object

* Fixing the docs

* Adding a test creating multple users

* Prompting for the API Key if it's not specified

* Added a test for multiple users / requested changes

* Fixing the linting
2017-01-05 19:25:04 +00:00
Máximo Cuadros 85f0fba9f9 Ignition provider (#6189)
* providers: ignition, basic config, version and config

* providers: ignition, user and passwd example, general cache implementation

* vendor: Capture new dependency upstream-pkg

* providers: ignition ignition_user

* providers: ignition ignition_disk, ignition_group and ignition_raid

* providers: ignition_file and ignition_filesystem

* providers: ignition_systemd_unit and ignition_networkd_unit

* providers: ignition_config improvements

* vendor: Capture new dependency upstream-pkg

* providers: ignition main

* documentation: ignition provider

* providers: ignition minor changes

* providers: ignition, fix test

* fixing tests and latest versions
2017-01-03 11:29:14 +00:00
Paul Tyng 3dfe5a47f1
provider/newrelic: Add new provider for New Relic 2016-12-15 19:14:59 +00:00
Mitchell Hashimoto 751e45c1d2 Merge pull request #10654 from hashicorp/b-vars
Maps with -var-file or -var always merge
2016-12-12 10:51:41 -08:00
Mitchell Hashimoto 1c537f6295 Merge pull request #10639 from hashicorp/b-plan-plan
command/plan: user friendly error if plan file given to plan command
2016-12-12 10:50:01 -08:00
Mitchell Hashimoto 36ff8b3c02
command/plan: show a warning when a plan file is given 2016-12-12 10:45:26 -08:00
Len Smith 015e96d0dd Initial check in for Icinga2 Provider/Resource (#8306)
* Initial checkin for PR request

* Added an argument to provider to allow control over whether or not TLS Certs will skip verification. Controllable via provider or env variable being set

* Initial check-in to use refactored module

* Checkin of very MVP for creating/deleting host test which works and validates basic host creation and deletion

* Check in with support for creating hosts with variables working

* Checking in work to date

* Remove code that causes travis CI to fail while I debug

* Adjust create to accept multivale

* Back on track. Working basic tests. go-icinga2-api needs more test too

* Squashing

* Back on track. Working basic tests. go-icinga2-api needs more test too

* Check in refactored hostgroup support

* Check in refactored check_command, hosts, and hsotgroup with a few test

* Checking in service code

* Add in dependency for icinga2 provider

* Add documentation. Refactor, fix and extend based on feedback from Hashicorp

* Added checking and validation around invalid URL and unavailable server
2016-12-12 15:28:26 +00:00
Mitchell Hashimoto 77efacf30e
command: use helper/variables for flags and parsing 2016-12-10 14:30:40 -05:00
James Bardin fc13a1b814 Disaply interpolation strings for computed fields
Displaying interpolations strings when possible for computed fields in
the plan output makes for a nicer UX
2016-12-09 13:30:00 -05:00
Mitchell Hashimoto 7f87a0109b
command/plan: user friendly error if plan file given to plan command 2016-12-09 11:34:38 -05:00
Mitchell Hashimoto a4ceb4a772 Merge pull request #10518 from hashicorp/b-graph
command/graph: work with new graphs
2016-12-05 21:36:33 -08:00
Martin Atkins e772b45970 "external" data source, for integrating with external programs (#8768)
* "external" provider for gluing in external logic

This provider will become a bit of glue to help people interface external
programs with Terraform without writing a full Terraform provider.

It will be nowhere near as capable as a first-class provider, but is
intended as a light-touch way to integrate some pre-existing or custom
system into Terraform.

* Unit test for the "resourceProvider" utility function

This small function determines the dependable name of a provider for
a given resource name and optional provider alias. It's simple but it's
a key part of how resource nodes get connected to provider nodes so
worth specifying the intended behavior in the form of a test.

* Allow a provider to export a resource with the provider's name

If a provider only implements one resource of each type (managed vs. data)
then it can be reasonable for the resource names to exactly match the
provider name, if the provider name is descriptive enough for the
purpose of the each resource to be obvious.

* provider/external: data source

A data source that executes a child process, expecting it to support a
particular gateway protocol, and exports its result. This can be used as
a straightforward way to retrieve data from sources that Terraform
doesn't natively support..

* website: documentation for the "external" provider
2016-12-05 17:24:57 +00:00
John Engelman 243ecf3b4f [Provider] Rancher (#9173)
* Vendor Rancher Go library.

* Implement Rancher Provider.

Starting implementation taken from
https://github.com/platanus/terraform-provider-rancher

Commits from jidonoso@gmail.com and raphael.pinson@camptocamp.com
2016-12-05 15:29:41 +00:00
Mitchell Hashimoto 22e868b966
command/graph: update for new graphs 2016-12-03 15:17:10 -08:00
Mitchell Hashimoto a2f3259e51 Merge pull request #10404 from hashicorp/b-plan-deposed
terraform: diff shows pure deposed destroy
2016-11-30 16:57:44 -08:00
Mitchell Hashimoto 2f8bf5b7ec
terraform: add variables to Interpolator value
Fixes #10412

The context wasn't properly adding variable values to the Interpolator
instance which made it so that the `console` command couldn't access
variables set via tfvars and the CLI.

This also adds better test coverage in command itself for this.
2016-11-30 11:56:31 -08:00
Mitchell Hashimoto ab1e512ae2
command: use reset instead of reset_bold
Fixes #10337

The `reset_bold` escape code (21) causes the text on Windows command
prompts to just become invisible. `reset` does the same job for us in
this scenario so do that.
2016-11-29 09:52:58 -08:00
Mitchell Hashimoto 80457b689c
terraform: do the deposed check within EvalDiff
There is never any reason to separate the two.
2016-11-28 14:34:24 -08:00
Mitchell Hashimoto 8701434b4d
command: plan formatting for deposed destroy 2016-11-28 14:34:24 -08:00
Mitchell Hashimoto 28d933f6dd
nitpicks for #10310 2016-11-23 09:40:11 -08:00
Mitchell Hashimoto c15754c365 Merge pull request #10310 from spangenberg/custom-import-provider
Implements import with specified provider
2016-11-23 09:37:04 -08:00
Daniel Spangenberg 804a5bd3c5 Implements import with specified provider
This allows the import with a specified provider.
So far it was not possible to get resources imported from a different provider
than the default.
2016-11-23 11:58:58 +01:00
James Bardin bf20db688c Remove extra dot from state backup file
The state subcommand was adding an extra dot to the backup file
2016-11-22 15:39:00 -05:00
Mitchell Hashimoto 251231e3ee
command: more manageable shadow error output 2016-11-21 15:05:49 -08:00
James Bardin b8adf10236 Add debug command with json2dot
Add `terraform debug json2dot` to convert debug log graphs to dot
format. This is not meant to be in place of more advanced debug
visualization, but may continue to be a useful way to work with the
debug output.
2016-11-21 11:59:20 -05:00
Mitchell Hashimoto aaf1ad0532 Merge pull request #10093 from hashicorp/f-console
Add `terraform console` for REPL
2016-11-14 11:53:49 -08:00