website: Document lifecycle
This commit is contained in:
parent
1aaddafba0
commit
8d5d7c32c8
|
@ -49,6 +49,17 @@ There are **meta-parameters** available to all resources:
|
|||
resource. The dependencies are in the format of `TYPE.NAME`,
|
||||
for example `aws_instance.web`.
|
||||
|
||||
* `lifecycle` (configuration block) - Customizes the lifecycle
|
||||
behavior of the resource. The specific options are documented
|
||||
below.
|
||||
|
||||
The `lifecycle` block allows the following keys to be set:
|
||||
|
||||
* `create_before_destroy` (bool) - This flag is used to ensure
|
||||
the replacement of a resource is created before the original
|
||||
instance is destroyed. As an example, this can be used to
|
||||
create an new DNS record before removing an old record.
|
||||
|
||||
-------------
|
||||
|
||||
Within a resource, you can optionally have a **connection block**.
|
||||
|
@ -88,6 +99,7 @@ resource TYPE NAME {
|
|||
CONFIG ...
|
||||
[count = COUNT]
|
||||
[depends_on = [RESOURCE NAME, ...]]
|
||||
[LIFECYCLE]
|
||||
|
||||
[CONNECTION]
|
||||
[PROVISIONER ...]
|
||||
|
@ -104,6 +116,14 @@ KEY {
|
|||
}
|
||||
```
|
||||
|
||||
where `LIFECYCLE` is:
|
||||
|
||||
```
|
||||
lifecycle {
|
||||
[create_before_destroy = true|false]
|
||||
}
|
||||
```
|
||||
|
||||
where `CONNECTION` is:
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue