Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ A `module` block supports the following configuration:
- [`depends_on`](#depends_on) &nbsp list of references
- [`for_each`](#for_each): &nbsp map or set of strings | mutually exclusive with `count`
- [`providers`](#providers) &nbsp map
- [`ignore_nested_deprecations`](#ignore_nested_deprecations) &nbsp boolean

## Complete configuration

Expand All @@ -47,6 +48,7 @@ module "<LABEL>" {
]
provider = "<alias.provider-configuration>"
depends_on = [ <resource.address.reference> ]
ignore_nested_deprecations = <true|false>
}
```

Expand Down Expand Up @@ -468,6 +470,28 @@ module "<LABEL>" {

`depends_on` is a **meta-argument**. Meta-arguments are built into the Terraform language and control how Terraform creates resources. Refer to the [`depends_on` reference](/terraform/language/meta-arguments/depends_on) for details about how the argument works.

### `ignore_nested_deprecations`

<Note>

Deprecated values are available in Terraform v1.15 and later.

</Note>

If the `ignore_nested_deprecations` argument is set to true, Terraform won't show any deprecation warnings within the module call or nested modules.

```hcl
module "<LABEL>" {
ignore_nested_deprecations = true
}
```

#### Summary

- Data type: Boolean
- Default: false


## Examples

The following examples show how to write configuration for common use cases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The `output` block supports the following arguments:
- [`sensitive`](#sensitive) &nbsp; boolean
- [`ephemeral`](#ephemeral) &nbsp; boolean
- [`depends_on`](#depends_on) &nbsp; list of references
- [`deprecated`](#deprecated) &nbsp; string
- [`precondition`](#precondition) &nbsp; block
- [`condition`](#precondition) &nbsp; expression
- [`error_message`](#precondition) &nbsp; string
Expand All @@ -47,6 +48,7 @@ output "<LABEL>" {
sensitive = <true|false>
ephemeral = <true|false>
depends_on = [<REFERENCE>]
deprecated = "<STRING>"

precondition {
condition = <EXPRESSION>
Expand All @@ -72,6 +74,7 @@ The following arguments are supported in an `output` block:
| `sensitive` | Specifies if Terraform hides this value in CLI output. | Boolean | Optional |
| `ephemeral` | Specifies whether to prevent storing this value in state. | Boolean | Optional |
| `depends_on` | A list of explicit dependencies for this output. | List | Optional |
| `deprecated` | Deprecation message for the output. Only valid within child modules. | String | Optional |
| `precondition` | A condition to validate before computing the output or storing it in state. | Block | Optional |

### `value`
Expand Down Expand Up @@ -184,6 +187,33 @@ output "unique_name" {

`depends_on` is a **meta-argument**. Meta-arguments are built into the Terraform language and control how Terraform creates resources. Refer to the [`depends_on` reference](/terraform/language/meta-arguments/depends_on) for details about how the argument works.

### `deprecated`

<Note>

Deprecated outputs are available in Terraform v1.15 and later.

</Note>

If set the `deprecated` argument specifies the reason for deprecating an output.
This reason will be shown when the output is used in the configuration.
You can only add the `deprecated` argument to `output` blocks in child modules, not in the root module.

```hcl
output "old_name" {
value = <expression-to-evaluate>
deprecated = "Please use 'new_name' instead."
}

output "new_name" {
value = <expression-to-evaluate>
}
```

If the output contains a value that is deprecated and has the `deprecated` argument set, Terraform will not show a deprecation warning. Only consumers of the module using the output will see the deprecation warning of this module.
If you want to mute deprecation warnings for a module, you can set the [`ignore_nested_deprecations` argument](/terraform/language/modules#ignore_nested_deprecations) on the module block.


### `precondition`

The `precondition` block lets you validate that the value of an `output` block meets specific requirements. Use preconditions on outputs to validate that your output values meet your requirements before Terraform exposes them or stores their values in state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The `variable` block supports the following arguments:
- [`sensitive`](#sensitive) &nbsp; boolean
- [`nullable`](#nullable) &nbsp; boolean
- [`ephemeral`](#ephemeral) &nbsp; boolean
- [`deprecated`](#deprecated) &nbsp; string

## Complete configuration

Expand Down Expand Up @@ -250,6 +251,34 @@ If another expression references a variable with the `ephemeral` argument, that
- Default: `false`
- Example: [Ephemeral variable](#ephemeral-variable)

### `deprecated`

<Note>

Deprecated variables are available in Terraform v1.15 and later.

</Note>

If set the `deprecated` argument specifies the reason for deprecating the variable. This reason will be shown when the variable is set. This applies both to variables in root modules and in child modules.


```hcl
variable "old_input" {
type = string
deprecated = "This variable is deprecated, please use 'new_input' instead."
}
variable "new_input" {
type = list(string)
default = []
}
```

#### Summary

- Data type: String
- Default: `false`


## Examples

The following examples demonstrate common use cases for `variable` blocks.
Expand Down
Loading