Skip to content

Commit df2bcd2

Browse files
committed
feat: allow env delete timeout customization
1 parent 0409cbb commit df2bcd2

File tree

23 files changed

+175
-30
lines changed

23 files changed

+175
-30
lines changed

docs/data-sources/env_aws.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ data "altinitycloud_env_aws" "current" {
3030

3131
### Optional
3232

33-
- `cloud_connect` (Boolean) `true` indicates that cloud resources are to be managed via altinity/cloud-connect and `false` means direct management (default `true`). **[IMMUTABLE]**
33+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
3434

3535
### Read-Only
3636

@@ -40,6 +40,7 @@ data "altinitycloud_env_aws" "current" {
4040
Examples:
4141
- "10.136.0.0/21"
4242
- "172.20.0.0/21"
43+
- `cloud_connect` (Boolean) `true` indicates that cloud resources are to be managed via altinity/cloud-connect and `false` means direct management (default `true`). **[IMMUTABLE]**
4344
- `custom_domain` (String) Custom domain.
4445

4546
Examples:
@@ -82,6 +83,10 @@ data "altinitycloud_env_aws" "current" {
8283
- ["us-east-1a", "us-east-1b"]
8384
- ["sa-east-1c", "sa-east-1d"]
8485

86+
<a id="nestedatt--timeouts"></a>
87+
### Nested Schema for `timeouts`
88+
89+
8590
<a id="nestedatt--endpoints"></a>
8691
### Nested Schema for `endpoints`
8792

docs/data-sources/env_azure.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ data "altinitycloud_env_azure" "current" {
2828
Examples:
2929
- "acme-staging" (where "acme" is your account name)
3030

31+
### Optional
32+
33+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
34+
3135
### Read-Only
3236

3337
- `cidr` (String) VPC CIDR block from the private IPv4 address ranges as specified in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). At least /21 required. **[IMMUTABLE]**
@@ -77,6 +81,14 @@ data "altinitycloud_env_azure" "current" {
7781
Examples:
7882
- ["eastus-1", "eastus-2"]
7983

84+
<a id="nestedatt--timeouts"></a>
85+
### Nested Schema for `timeouts`
86+
87+
Optional:
88+
89+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
90+
91+
8092
<a id="nestedatt--load_balancers"></a>
8193
### Nested Schema for `load_balancers`
8294

docs/data-sources/env_gcp.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ data "altinitycloud_env_gcp" "current" {
2828
Examples:
2929
- "acme-staging" (where "acme" is your account name)
3030

31+
### Optional
32+
33+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
34+
3135
### Read-Only
3236

3337
- `cidr` (String) VPC CIDR block from the private IPv4 address ranges as specified in RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). At least /21 required. **[IMMUTABLE]**
@@ -72,6 +76,14 @@ data "altinitycloud_env_gcp" "current" {
7276
Examples:
7377
- ["us-west1a", "us-west1b"]
7478

79+
<a id="nestedatt--timeouts"></a>
80+
### Nested Schema for `timeouts`
81+
82+
Optional:
83+
84+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
85+
86+
7587
<a id="nestedatt--load_balancers"></a>
7688
### Nested Schema for `load_balancers`
7789

docs/data-sources/env_k8s.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ data "altinitycloud_env_k8s" "current" {
2828
Examples:
2929
- "acme-staging" (where "acme" is your account name)
3030

31+
### Optional
32+
33+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
34+
3135
### Read-Only
3236

3337
- `custom_domain` (String) Custom domain.
@@ -68,6 +72,14 @@ data "altinitycloud_env_k8s" "current" {
6872
- `skip_deprovision_on_destroy` (Boolean)
6973
- `spec_revision` (Number) Spec revision
7074

75+
<a id="nestedatt--timeouts"></a>
76+
### Nested Schema for `timeouts`
77+
78+
Optional:
79+
80+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
81+
82+
7183
<a id="nestedatt--custom_node_types"></a>
7284
### Nested Schema for `custom_node_types`
7385

docs/resources/env_aws.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ resource "altinitycloud_env_aws" "this" {
159159
}
160160
peering_connections = [
161161
{
162-
aws_account_id = local.aws_account_id # This only required if the VPC is it not in the same account as the environment.
162+
aws_account_id = local.aws_account_id # This only required if the VPC is not in the same account as the environment.
163163
vpc_id = "vpc-xyz"
164164
}
165165
]
@@ -246,6 +246,7 @@ resource "aws_vpc_peering_connection_accepter" "peer" {
246246
- `peering_connections` (Attributes List) AWS environment VPC peering configuration. (see [below for nested schema](#nestedatt--peering_connections))
247247
- `skip_deprovision_on_destroy` (Boolean)
248248
- `tags` (Attributes List) Tags to apply to AWS resources. (see [below for nested schema](#nestedatt--tags))
249+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
249250
- `zones` (List of String) Explicit list of AWS availability zones. At least 2 required.
250251

251252
Examples:
@@ -364,6 +365,14 @@ Required:
364365
- `key` (String) Name of the key
365366
- `value` (String) Value of the key
366367

368+
369+
<a id="nestedatt--timeouts"></a>
370+
### Nested Schema for `timeouts`
371+
372+
Optional:
373+
374+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
375+
367376
## Import
368377

369378
Import is supported using the following syntax:

docs/resources/env_azure.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "altinitycloud_env_azure" "azure" {
115115
- `private_link_service` (Attributes) Azure Private Link service configuration. (see [below for nested schema](#nestedatt--private_link_service))
116116
- `skip_deprovision_on_destroy` (Boolean)
117117
- `tags` (Attributes List) Tags to apply to Azure resources. (see [below for nested schema](#nestedatt--tags))
118+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
118119
- `zones` (List of String) Explicit list of Azure availability zones. At least 2 required.
119120

120121
Examples:
@@ -212,6 +213,14 @@ Required:
212213
- `key` (String) Name of the key
213214
- `value` (String) Value of the key
214215

216+
217+
<a id="nestedatt--timeouts"></a>
218+
### Nested Schema for `timeouts`
219+
220+
Optional:
221+
222+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
223+
215224
## Import
216225

217226
Import is supported using the following syntax:

docs/resources/env_gcp.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ resource "altinitycloud_env_gcp" "this" {
121121
- `maintenance_windows` (Attributes List) List of maintenance windows during which automatic maintenance is permitted. By default updates are applied as soon as they are available. (see [below for nested schema](#nestedatt--maintenance_windows))
122122
- `number_of_zones` (Number) Number of zones where the environment will be available. When set, zones will be set automatically based on your cloud provider (Do not use it together with zones)
123123
- `skip_deprovision_on_destroy` (Boolean)
124+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
124125
- `zones` (List of String) Explicit list of GCP zones. At least 2 required.
125126
Examples:
126127
- ["us-west1a", "us-west1b"]
@@ -200,6 +201,14 @@ Optional:
200201

201202
- `enabled` (Boolean) Set to `true` if maintenance window is enabled, `false` otherwise. (default `false`)
202203

204+
205+
<a id="nestedatt--timeouts"></a>
206+
### Nested Schema for `timeouts`
207+
208+
Optional:
209+
210+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
211+
203212
## Import
204213

205214
Import is supported using the following syntax:

docs/resources/env_k8s.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ resource "altinitycloud_env_k8s" "this" {
136136
- `maintenance_windows` (Attributes List) List of maintenance windows during which automatic maintenance is permitted. By default updates are applied as soon as they are available. (see [below for nested schema](#nestedatt--maintenance_windows))
137137
- `metrics` (Attributes) Metrics configuration (see [below for nested schema](#nestedatt--metrics))
138138
- `skip_deprovision_on_destroy` (Boolean)
139+
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
139140

140141
### Read-Only
141142

@@ -322,6 +323,14 @@ Optional:
322323

323324
- `retention_period_in_days` (Number) Metrics retention period in days (default `30`).
324325

326+
327+
<a id="nestedatt--timeouts"></a>
328+
### Nested Schema for `timeouts`
329+
330+
Optional:
331+
332+
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
333+
325334
## Import
326335

327336
Import is supported using the following syntax:

examples/resources/altinitycloud_env_aws/peering/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ resource "altinitycloud_env_aws" "this" {
2929
}
3030
peering_connections = [
3131
{
32-
aws_account_id = local.aws_account_id # This only required if the VPC is it not in the same account as the environment.
32+
aws_account_id = local.aws_account_id # This only required if the VPC is not in the same account as the environment.
3333
vpc_id = "vpc-xyz"
3434
}
3535
]

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515

1616
require (
1717
github.com/MakeNowJust/heredoc/v2 v2.0.1
18+
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1
1819
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
1920
github.com/hashicorp/terraform-plugin-testing v1.8.0
2021
)

0 commit comments

Comments
 (0)