An open API service indexing awesome lists of open source software.

https://github.com/truefoundry/terraform-truefoundry-sleep

Terraform module to create some Delay/sleep between cloud resources and platform integrations
https://github.com/truefoundry/terraform-truefoundry-sleep

Last synced: 6 months ago
JSON representation

Terraform module to create some Delay/sleep between cloud resources and platform integrations

Awesome Lists containing this project

README

          

# Truefoundry Terraform Sleep Module

This Terraform module provides a way to add delays/sleep during resource creation or destruction. This can be useful in scenarios where you need to wait for eventual consistency or when you need to introduce delays between resource provisioning.

## Features

- Configurable sleep duration for resource creation
- Configurable sleep duration for resource destruction
- Support for triggers to force new sleep durations

## Usage

```hcl
module "sleep" {
source = "path/to/module"

create_duration = "30s" # Sleep for 30 seconds during creation
destroy_duration = "10s" # Sleep for 10 seconds during destruction
triggers = {
# Changes to these values will trigger a new sleep duration
version = "1.0.0"
}
}
```

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.0.0 |
| [time](#requirement\_time) | ~> 0.12.0 |

## Providers

| Name | Version |
|------|---------|
| [time](#provider\_time) | ~> 0.12.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [time_sleep.wait](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [create\_duration](#input\_create\_duration) | Duration to sleep during create operation. Examples: '30s', '5m', '1h' | `string` | `"30s"` | no |
| [destroy\_duration](#input\_destroy\_duration) | Duration to sleep during destroy operation. Examples: '30s', '5m', '1h' | `string` | `"0s"` | no |
| [triggers](#input\_triggers) | Arbitrary map of values that, when changed, will trigger a new sleep duration | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| [id](#output\_id) | ID of the sleep resource that can be used as an explicit dependency |
| [triggers](#output\_triggers) | Map of trigger values that were provided |

## Examples

### Basic Usage

```hcl
module "sleep" {
source = "path/to/module"

create_duration = "1m"
}
```

### With Triggers

```hcl
module "sleep" {
source = "path/to/module"

create_duration = "30s"
triggers = {
deployment_id = "v1.2.3"
environment = "production"
}
}
```

### As a Dependency

```hcl
module "sleep" {
source = "path/to/module"

create_duration = "2m"
}

resource "aws_instance" "example" {
# ... instance configuration ...

depends_on = [module.sleep]
}
```