-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into f-helperschema-timeout
* master: (499 commits) provider/aws: Fix the panic in ssm_association with parameters (#12215) Setting incident_urgency_rule as optional (#12211) Latest Section (#12151) provider/pagerduty: Import support for service integrations (#12141) command: fix test for new Meta type terraform: InstanceState.Meta is value type interface{} Update CHANGELOG.md flatmap: mark computed list as a computed value in Expand provider/azurerm: Bump AzureRM SDK to v8.0.1-beta (#11866) provider/profitbricks: fmt changes post cherry-pick provider/aws: Add missing SSM Links to documentation nav bar (#12202) update azure_network_interface documentation to say required for ip_configuration (#12185) Profitbricks primary nic fix (#12197) Update CHANGELOG.md Update CHANGELOG.md Update CHANGELOG.md Update CHANGELOG.md provider/aws: Lambda DeadLetterConfig support what was the value of the cluster id which caused the problem Corrected example code, cleared up token confusion (#12177) ...
- Loading branch information
Showing
1,614 changed files
with
126,204 additions
and
20,604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
*.go eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Package init contains the list of backends that can be initialized and | ||
// basic helper functions for initializing those backends. | ||
package init | ||
|
||
import ( | ||
"sync" | ||
|
||
"github.com/hashicorp/terraform/backend" | ||
|
||
backendlegacy "github.com/hashicorp/terraform/backend/legacy" | ||
backendlocal "github.com/hashicorp/terraform/backend/local" | ||
backendconsul "github.com/hashicorp/terraform/backend/remote-state/consul" | ||
backendinmem "github.com/hashicorp/terraform/backend/remote-state/inmem" | ||
) | ||
|
||
// backends is the list of available backends. This is a global variable | ||
// because backends are currently hardcoded into Terraform and can't be | ||
// modified without recompilation. | ||
// | ||
// To read an available backend, use the Backend function. This ensures | ||
// safe concurrent read access to the list of built-in backends. | ||
// | ||
// Backends are hardcoded into Terraform because the API for backends uses | ||
// complex structures and supporting that over the plugin system is currently | ||
// prohibitively difficult. For those wanting to implement a custom backend, | ||
// they can do so with recompilation. | ||
var backends map[string]func() backend.Backend | ||
var backendsLock sync.Mutex | ||
|
||
func init() { | ||
// Our hardcoded backends. We don't need to acquire a lock here | ||
// since init() code is serial and can't spawn goroutines. | ||
backends = map[string]func() backend.Backend{ | ||
"local": func() backend.Backend { return &backendlocal.Local{} }, | ||
"consul": func() backend.Backend { return backendconsul.New() }, | ||
"inmem": func() backend.Backend { return backendinmem.New() }, | ||
} | ||
|
||
// Add the legacy remote backends that haven't yet been convertd to | ||
// the new backend API. | ||
backendlegacy.Init(backends) | ||
} | ||
|
||
// Backend returns the initialization factory for the given backend, or | ||
// nil if none exists. | ||
func Backend(name string) func() backend.Backend { | ||
backendsLock.Lock() | ||
defer backendsLock.Unlock() | ||
return backends[name] | ||
} | ||
|
||
// Set sets a new backend in the list of backends. If f is nil then the | ||
// backend will be removed from the map. If this backend already exists | ||
// then it will be overwritten. | ||
// | ||
// This method sets this backend globally and care should be taken to do | ||
// this only before Terraform is executing to prevent odd behavior of backends | ||
// changing mid-execution. | ||
func Set(name string, f func() backend.Backend) { | ||
backendsLock.Lock() | ||
defer backendsLock.Unlock() | ||
|
||
if f == nil { | ||
delete(backends, name) | ||
return | ||
} | ||
|
||
backends[name] = f | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.