This project is mirrored from https://:*****@github.com/hashicorp/terraform.git.
Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
- 05 Apr, 2019 2 commits
-
-
Matthew Sanabria authored
Fixes #15849
-
Martin Atkins authored
The v0.12 language supports numeric constants only in decimal notation, as a simplification. For rare situations where a different base is more appropriate, such as unix-style file modes, we've found it better for providers to accept a string containing a representation in the appropriate base, since that way the interpretation can be validated and it will be displayed in the same way in the rendered plan diff, in outputs, etc. We use tv.Value() here to mimick how HCL 1 itself would have interpreted these, and then format them back out in the canonical form, which implicitly converts any non-decimal constants to decimal on the way through.
-
- 04 Apr, 2019 3 commits
-
-
Martin Atkins authored
-
Martin Atkins authored
The re-introduction of some of the ambiguity between argument and nested block syntax (for compatibility with existing provider patterns) unfortunately leads to some interesting consequences for attributes using this mode. While the behavior is generally as before in straightforward cases, this page aims to spell out some of the different usage patterns explicitly for the benefit of those writing more complex configurations, such as generic re-usable modules where using argument vs. block syntax leads to some real differences. This page is intentionally not linked from anywhere in the part of the website maintained in the Terraform repository. Instead, it can be linked from the provider documentation for any argument where this pattern is used, to help users understand the ways in which that argument might deviate from the usual behaviors of arguments vs. nested blocks.
-
Jeff authored
* fix docs typo * restore trailing newline
-
- 03 Apr, 2019 11 commits
-
-
Martin Atkins authored
Previously it was calling directly to hcldec.Variables, and thus missing the special fixups we do inside ReferencesInBlock to deal with Terraform-specific concerns such as our attribute-as-blocks preprocessing.
-
James Bardin authored
Allow all planned computed diff fields
-
James Bardin authored
Stripping these was a patch for some provider behavior which was fixed in other ways, and is no longer needed. Removing this allows us to implement correct CusomizeDiffFuncs in providers so that they can mark fields with empty values as computed during a plan.
-
James Bardin authored
These are the largest source of the old "diffs didn't match after apply" errors. It's almost always an upstream dependency that caused the final error.
-
Kristin Laemmert authored
Fixes #20917
-
James Bardin authored
Validate configuration shims for nulls in lists
-
Kristin Laemmert authored
* vendor: update hcl2 dependency * command/format: revert diagnostic format behavior if snippet or highlight range is empty
-
James Bardin authored
This reverts commit 97bde546.
-
James Bardin authored
A list-like attribute containing null values will present a list to helper/schema with nils, which can cause panics. Since null values were not possible in configuration before HCL2 and not supported by the legacy SDK, return an error to the user.
-
Brian Flad authored
-
Brian Flad authored
helper/schema: Prevent setSet() panic with typed nil
-
- 02 Apr, 2019 6 commits
-
-
James Bardin authored
increase grpc recv limit
-
James Bardin authored
-
James Bardin authored
Some providers may generate quite large schemas, and the internal default grpc response size limit is 4MB. 64MB should cover most any use case, and if we get providers nearing that we may want to consider a finer-grained API to fetch individual resource schemas.
-
James Bardin authored
filter nulls when shimming a config
-
James Bardin authored
Nulls can't exist in HCL, and the legacy sdk will panic when encountering them. The map shim already did this, just copy the same pattern in the list case.
-
Brian Flad authored
References: * https://github.com/hashicorp/terraform/issues/14418 * v0.9.5 (original bug report): https://github.com/hashicorp/terraform/blob/a59ee0b30e1350d18e44a3a2a405124302751f93/helper/schema/field_writer_map.go#L311 * v0.11.12 (Terraform AWS Provider discovery): https://github.com/hashicorp/terraform/blob/057286e5228559722bfc9bf6a03679650358c9d2/helper/schema/field_writer_map.go#L343 When creating flatten functions in Terraform Providers that return *schema.Set, its possible to return a typed `nil`, e.g. ```go func flattenHeaders(h *cloudfront.Headers) *schema.Set { if h.Items != nil { return schema.NewSet(schema.HashString, flattenStringList(h.Items)) } return nil } ``` This previously could cause a panic, e.g. ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1881911] goroutine 1325 [running]: github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc00054bf00, 0xc00073efa0, 0x5, 0x5, 0x5828140, 0x0, 0xc0002cea50, 0xc000e996a8, 0xc001026e40) /Users/bflad/go/pkg/mod/github.com/hashicorp/terraform@v0.11.12/helper/schema/field_writer_map.go:343 +0x211 ``` Here we catch the typed `nil` and return an empty list flatmap result instead. Unit testing result prior to code update: ``` --- FAIL: TestMapFieldWriter (0.00s) panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1777cdc] goroutine 913 [running]: testing.tRunner.func1(0xc00045b800) /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:830 +0x392 panic(0x192cf20, 0x2267ca0) /usr/local/Cellar/go/1.12.1/libexec/src/runtime/panic.go:522 +0x1b5 github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0xc00045c600, 0x30, 0x19e0080) /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:344 +0x68c github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0x1, 0x18) /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:107 +0x28b github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).WriteField(0xc0004648a0, 0xc0004408d0, 0x1, 0x1, 0x19e3de0, 0x0, 0x0, 0x0) /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:89 +0x504 github.com/hashicorp/terraform/helper/schema.TestMapFieldWriter(0xc00045b800) /Users/bflad/src/github.com/hashicorp/terraform/helper/schema/field_writer_map_test.go:337 +0x2ddd testing.tRunner(0xc00045b800, 0x1a44f90) /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:865 +0xc0 created by testing.(*T).Run /usr/local/Cellar/go/1.12.1/libexec/src/testing/testing.go:916 +0x35a ```
-
- 01 Apr, 2019 4 commits
-
-
Chris Griggs authored
[Website] Update provider name
-
Martin Atkins authored
In order to preserve pre-v0.12 idiom for list-of-object attributes, we'll prefer to use block syntax for them except for the special situation where the user explicitly assigns an empty list, where attribute syntax is required in order to allow existing provider logic to differentiate from an implicit lack of blocks.
-
cgriggs01 authored
-
Kristin Laemmert authored
-
- 29 Mar, 2019 11 commits
-
-
Bruno Tavares authored
We don't appear to actually need to constrain these, and removing these decls may help avoid the need for `bzr` to install all the dependencies.
-
Martin Atkins authored
-
Frederic authored
-
James Bardin authored
Better handling of unknowns in sdk shims
-
James Bardin authored
It turns out that collections containing only unknowns could be lost, meaning there wasn't a direct correlation between the unknown and null value which would have otherwise been restored.
-
James Bardin authored
NewRemoved diff values were somtimes left in maps and lists.
-
James Bardin authored
The legacy diff process inserts unknown values into an optional+computed map. Fix these up in post-plan normalization process, by looking for known strings that were changed to unknown.
-
James Bardin authored
Because schema.ResourceDiff can't differentiate between unknown values and new computed values, unknowns can be lost during an update. If a planned value converted an unknown to a null, restore the unknown so that it can be correctly replaced in the final plan.
-
James Bardin authored
-
Sander van Harmelen authored
-
Sander van Harmelen authored
backend/remote: correctly load remote variables
-
- 28 Mar, 2019 3 commits
-
-
Kristin Laemmert authored
-
Pam Selle authored
-
Kristin Laemmert authored
* configs/configupgrade: detect invalid resource names and print a TODO message In terraform 0.11 and prior it was possible to start a resource name with a number. This is no longer valid, as the resource name would would be ambiguous with number values in HCL expressions. Fixes #19919 * Update configs/configupgrade/test-fixtures/valid/invalid-resource-name/want/resource.tf Co-Authored-By:
mildwonkey <mildwonkey@users.noreply.github.com>
-