@ -254,6 +254,10 @@ Performing Terraform operations to a resource will often result in several messa
- `provision_errored`: when an error is enountered during provisioning
- `refresh_start`: when reading a resource during refresh
- `refresh_complete`: on successful refresh
- `ephemeral_op_start`: when starting an ephemeral resource operation
- `ephemeral_op_progress`: periodically showing elapsed time output during ephemeral resource operation
- `ephemeral_op_complete`: on successful ephemeral resource operation completion
- `ephemeral_op_errored`: when an error is encountered during ephemeral resource operation
Each of these messages has a `hook` object, which has different fields for each type. All hooks have a [`resource` object](#resource-object) which identifies which resource is the subject of the operation.
@ -585,6 +589,138 @@ The `refresh_complete` message `hook` object has the following keys:
}
```
## Ephemeral Operation Start
The `ephemeral_op_start` message `hook` object has the following keys:
- `resource`: a [`resource` object](#resource-object) identifying the resource
- `action`: the action the ephemeral resource is going through. Values: `open`, `renew`, `close`
The `ephemeral_op_start` message `hook` object has the following keys:
- `resource`: a [`resource` object](#resource-object) identifying the resource
- `action`: the action the ephemeral resource is going through. Values: `open`, `renew`, `close`
- `elapsed_seconds`: time elapsed since the operation started, expressed as an integer number of seconds
### Example
```json
{
"@level": "info",
"@message": "ephemeral.random_password.example: Opening complete after 1s",
"@module": "terraform.ui",
"@timestamp": "2024-10-30T10:34:26.222465-00:00",
"hook": {
"resource": {
"addr": "ephemeral.random_password.example",
"module": "",
"resource": "ephemeral.random_password.example",
"implied_provider": "random",
"resource_type": "random_password",
"resource_name": "example",
"resource_key": null
},
"action": "open",
"elapsed_seconds": 1
},
"type": "ephemeral_op_complete"
}
```
## Ephemeral Operation Errored
The `ephemeral_op_start` message `hook` object has the following keys:
- `resource`: a [`resource` object](#resource-object) identifying the resource
- `action`: the action the ephemeral resource is going through. Values: `open`, `renew`, `close`
- `elapsed_seconds`: time elapsed since the operation started, expressed as an integer number of seconds
The exact detail of the error will be rendered as a separate `diagnostic` message.
### Example
```json
{
"@level": "info",
"@message": "ephemeral.random_password.example: Opening errored after 2s",
"@module": "terraform.ui",
"@timestamp": "2024-10-30T10:34:26.222465-00:00",
"hook": {
"resource": {
"addr": "ephemeral.random_password.example",
"module": "",
"resource": "ephemeral.random_password.example",
"implied_provider": "random",
"resource_type": "random_password",
"resource_name": "example",
"resource_key": null
},
"action": "open",
"elapsed_seconds": 2
},
"type": "ephemeral_op_errored"
}
```
## Resource Object
The `resource` object is a decomposed structure representing a resource address in configuration, which is used to identify which resource a given message is associated with. The object has the following keys: