opentofu/internal/configs
Alisdair McDiarmid 650380f3ae configs: Add default argument to optional()
The optional modifier previously accepted a single argument: the
attribute type. This commit adds an optional second argument, which
specifies a default value for the attribute.

To record the default values for a variable's type, we use a separate
parallel structure of `typeexpr.Defaults`, rather than extending
`cty.Type` to include a `cty.Value` of defaults (which may in turn
include a `cty.Type` with defaults, and so on, and so forth).

The new `typeexpr.TypeConstraintWithDefaults` returns a type constraint
and defaults value. Defaults will be `nil` unless there are default
values specified somewhere in the variable's type.
2022-05-31 12:11:15 -04:00
..
configload Merge pull request #31060 from hashicorp/alisdair/fix-configload-snapshot-panic 2022-05-23 13:56:33 -04:00
configschema configs: Add sensitive marks for nested attributes 2021-11-25 11:55:17 -05:00
hcl2shim Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
testdata configs: Add default argument to optional() 2022-05-31 12:11:15 -04:00
backend.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
checks.go core: Check rule error message expressions 2022-03-04 15:35:39 -05:00
cloud.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
compat_shim.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
config_build_test.go configs: Refined error messages for mismatched provider passing 2022-03-10 10:05:56 -08:00
config_build.go configs: Refined error messages for mismatched provider passing 2022-03-10 10:05:56 -08:00
config_test.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
config.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
depends_on.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
doc.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
escaping_blocks_test.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
experiments_test.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
experiments.go Conclude preconditions/postconditions experiment 2022-04-04 15:54:40 -04:00
module_call_test.go addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
module_call.go addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
module_merge_body.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
module_merge_test.go add failing test for IgnoreAllChanges override 2021-11-01 19:00:54 +00:00
module_merge.go IgnoreAllChanges should override during merge 2021-11-01 19:08:30 +00:00
module_test.go Allow cloud block overrides 2021-10-28 19:29:09 -05:00
module.go Allow cloud block overrides 2021-10-28 19:29:09 -05:00
moved_test.go normalise test names 2021-11-14 21:51:53 +00:00
moved.go configs: For Moved blocks, use addrs.MoveEndpoint instead of addrs.Target 2021-07-01 08:28:02 -07:00
named_values.go configs: Add default argument to optional() 2022-05-31 12:11:15 -04:00
parser_config_dir_test.go configs: valid-modules test ignores experimental features warning 2021-07-01 08:28:02 -07:00
parser_config_dir.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
parser_config_test.go configs: Decode preconditions and postconditions 2022-01-28 11:00:29 -05:00
parser_config.go configs: Decode preconditions and postconditions 2022-01-28 11:00:29 -05:00
parser_test.go Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
parser_values_test.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
parser_values.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
parser.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider_meta.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider_requirements_test.go addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
provider_requirements.go de-linting 2021-09-01 11:36:21 -04:00
provider_test.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provider_validation.go configs: fix module for_each call bug (#31091) 2022-05-20 16:58:46 +01:00
provider.go configs: Refined error messages for mismatched provider passing 2022-03-10 10:05:56 -08:00
provisioner.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provisioneronfailure_string.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
provisionerwhen_string.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
resource.go core: Defer on transitive dependencies for data resources with conditions 2022-05-11 11:01:38 -07:00
synth_body_test.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
synth_body.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
util.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variable_type_hint.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
variabletypehint_string.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
version_constraint.go Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00