Skip to content

Commit

Permalink
docs: add status datasource to env examples and improve its docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianaya89 committed Aug 2, 2024
1 parent 55d69b5 commit ff1d62a
Show file tree
Hide file tree
Showing 46 changed files with 286 additions and 86 deletions.
6 changes: 0 additions & 6 deletions docs/data-sources/env_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ description: |-

Bring Your Own Cloud (BYOC) AWS environment data source.

## Example Usage

```terraform
data "altinitycloud_env_aws" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
38 changes: 34 additions & 4 deletions docs/data-sources/env_aws_status.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,53 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "altinitycloud_env_aws_status Data Source - terraform-provider-altinitycloud"
subcategory: ""
description: |-
Altinity.Cloud AWS environment status data source. It will long pool the status until matching_spec is true.
Altinity.Cloud AWS environment status data source. It will long pool the status until matching_spec is true. Use this data source to wait for the environment is fully provisioned.
---

# altinitycloud_env_aws_status (Data Source)

Altinity.Cloud AWS environment status data source. It will long pool the status until `matching_spec` is `true`.
Altinity.Cloud AWS environment status data source. It will long pool the status until `matching_spec` is `true`. Use this data source to wait for the environment is fully provisioned.

## Example Usage

### Read AWS environment status:
```terraform
data "altinitycloud_env_aws_status" "current" {
name = "acme-staging"
}
```

### Wait for AWS environment to be fully provisioned:
```terraform
resource "altinitycloud_env_aws" "this" {
name = "acme-staging"
aws_account_id = "123456789012"
region = "us-east-1"
zones = ["us-east-1a", "us-east-1b"]
cidr = "10.67.0.0/21"
node_groups = [
{
node_type = "t4g.large"
capacity_per_zone = 10
reservations = ["SYSTEM", "ZOOKEEPER"]
},
{
node_type = "m6i.large"
capacity_per_zone = 10
reservations = ["CLICKHOUSE"]
}
]
cloud_connect = true
}
data "altinitycloud_env_aws_status" "current" {
name = altinitycloud_env_aws.this.name
wait_for_applied_spec_revision = altinitycloud_env_aws.this.spec_revision
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand All @@ -30,7 +60,7 @@ data "altinitycloud_env_aws_status" "current" {

### Optional

- `wait_for_applied_spec_revision` (Number) Applied spec revision
- `wait_for_applied_spec_revision` (Number) Use this attribute to wait for the environment to be fully provisioned. It will long pull environment status until it matches the applied spec revision.

### Read-Only

Expand Down
6 changes: 0 additions & 6 deletions docs/data-sources/env_azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ description: |-

Bring Your Own Cloud (BYOC) Azure environment data source.

## Example Usage

```terraform
data "altinitycloud_env_azure" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
12 changes: 3 additions & 9 deletions docs/data-sources/env_azure_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
page_title: "altinitycloud_env_azure_status Data Source - terraform-provider-altinitycloud"
subcategory: ""
description: |-
Altinity.Cloud Azure environment status data source. It will long pool the status until matching_spec is true.
Altinity.Cloud Azure environment status data source. It will long pool the status until matching_spec is true. Use this data source to wait for the environment is fully provisioned.
---

# altinitycloud_env_azure_status (Data Source)

Altinity.Cloud Azure environment status data source. It will long pool the status until `matching_spec` is `true`.
Altinity.Cloud Azure environment status data source. It will long pool the status until `matching_spec` is `true`. Use this data source to wait for the environment is fully provisioned.

## Example Usage

```terraform
data "altinitycloud_env_azure_status" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -30,7 +24,7 @@ data "altinitycloud_env_azure_status" "current" {

### Optional

- `wait_for_applied_spec_revision` (Number) Applied spec revision
- `wait_for_applied_spec_revision` (Number) Use this attribute to wait for the environment to be fully provisioned. It will long pull environment status until it matches the applied spec revision.

### Read-Only

Expand Down
6 changes: 0 additions & 6 deletions docs/data-sources/env_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ description: |-

Bring Your Own Cloud (BYOC) GCP environment data source.

## Example Usage

```terraform
data "altinitycloud_env_gcp" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
12 changes: 3 additions & 9 deletions docs/data-sources/env_gcp_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
page_title: "altinitycloud_env_gcp_status Data Source - terraform-provider-altinitycloud"
subcategory: ""
description: |-
Altinity.Cloud GCP environment status data source. It will long pool the status until matching_spec is true.
Altinity.Cloud GCP environment status data source. It will long pool the status until matching_spec is true. Use this data source to wait for the environment is fully provisioned.
---

# altinitycloud_env_gcp_status (Data Source)

Altinity.Cloud GCP environment status data source. It will long pool the status until `matching_spec` is `true`.
Altinity.Cloud GCP environment status data source. It will long pool the status until `matching_spec` is `true`. Use this data source to wait for the environment is fully provisioned.

## Example Usage

```terraform
data "altinitycloud_env_gcp_status" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -30,7 +24,7 @@ data "altinitycloud_env_gcp_status" "current" {

### Optional

- `wait_for_applied_spec_revision` (Number) Applied spec revision
- `wait_for_applied_spec_revision` (Number) Use this attribute to wait for the environment to be fully provisioned. It will long pull environment status until it matches the applied spec revision.

### Read-Only

Expand Down
6 changes: 0 additions & 6 deletions docs/data-sources/env_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ description: |-

Bring Your Own Kubernetes (BYOK) environment data source.

## Example Usage

```terraform
data "altinitycloud_env_k8s" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
12 changes: 3 additions & 9 deletions docs/data-sources/env_k8s_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
page_title: "altinitycloud_env_k8s_status Data Source - terraform-provider-altinitycloud"
subcategory: ""
description: |-
Altinity.Cloud K8S environment status data source. It will long pool the status until matching_spec is true.
Altinity.Cloud K8S environment status data source. It will long pool the status until matching_spec is true. Use this data source to wait for the environment is fully provisioned.
---

# altinitycloud_env_k8s_status (Data Source)

Altinity.Cloud K8S environment status data source. It will long pool the status until `matching_spec` is `true`.
Altinity.Cloud K8S environment status data source. It will long pool the status until `matching_spec` is `true`. Use this data source to wait for the environment is fully provisioned.

## Example Usage

```terraform
data "altinitycloud_env_k8s_status" "current" {
name = "acme-staging"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -30,7 +24,7 @@ data "altinitycloud_env_k8s_status" "current" {

### Optional

- `wait_for_applied_spec_revision` (Number) Applied spec revision
- `wait_for_applied_spec_revision` (Number) Use this attribute to wait for the environment to be fully provisioned. It will long pull environment status until it matches the applied spec revision.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ terraform {
altinitycloud = {
source = "altinity/altinitycloud"
# https://github.com/altinity/terraform-provider-altinitycloud/blob/master/CHANGELOG.md
version = "0.2.3"
version = "0.2.6"
}
}
}
Expand Down
15 changes: 11 additions & 4 deletions docs/resources/env_aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Bring Your Own Cloud (BYOC) AWS environment resource.

## Example Usage

AWS environment with public Load Balancer:
### AWS environment with public Load Balancer:
```terraform
resource "altinitycloud_env_certificate" "this" {
env_name = "acme-staging"
Expand Down Expand Up @@ -58,9 +58,15 @@ resource "altinitycloud_env_aws" "this" {
module.altinitycloud_connect_aws
]
}
// Since the environment provisioning is an async process, this data source is used to wait for environment to be fully provisioned.
data "altinitycloud_env_aws_status" "this" {
name = altinitycloud_env_aws.this.name
wait_for_applied_spec_revision = altinitycloud_env_aws.this.spec_revision
}
```

AWS environment accessible over VPC Endpoint:
### AWS environment accessible over VPC Endpoint:
```terraform
resource "altinitycloud_env_certificate" "this" {
env_name = "acme-staging"
Expand Down Expand Up @@ -112,6 +118,7 @@ resource "altinitycloud_env_aws" "this" {
]
}
// Since the environment provisioning is an async process, this data source is used to wait for environment to be fully provisioned.
data "altinitycloud_env_aws_status" "this" {
name = altinitycloud_env_aws.this.name
wait_for_applied_spec_revision = altinitycloud_env_aws.this.spec_revision
Expand All @@ -128,7 +135,7 @@ resource "aws_vpc_endpoint" "this" {
}
```

AWS environment with VPC peering:
### AWS environment with VPC peering:
```terraform
resource "altinitycloud_env_certificate" "this" {
env_name = "acme-staging"
Expand Down Expand Up @@ -184,6 +191,7 @@ resource "altinitycloud_env_aws" "this" {
]
}
// Since the environment provisioning is an async process, this data source is used to wait for environment to be fully provisioned.
data "altinitycloud_env_aws_status" "this" {
name = altinitycloud_env_aws.this.name
wait_for_applied_spec_revision = altinitycloud_env_aws.this.spec_revision
Expand Down Expand Up @@ -365,7 +373,6 @@ Required:

- `key` (String) Name of the key
- `value` (String) Value of the key

## Import

Import is supported using the following syntax:
Expand Down
9 changes: 7 additions & 2 deletions docs/resources/env_azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Bring Your Own Cloud (BYOC) Azure environment resource.

## Example Usage

Azure environment with public Load Balancer:
### Azure environment with public Load Balancer:
```terraform
provider "azurerm" {
skip_provider_registration = true
Expand Down Expand Up @@ -63,6 +63,12 @@ resource "altinitycloud_env_azure" "azure" {
reservations = ["CLICKHOUSE", "ZOOKEEPER", "SYSTEM"]
}]
}
// Since the environment provisioning is an async process, this data source is used to wait for environment to be fully provisioned.
data "altinitycloud_env_azure_status" "this" {
name = altinitycloud_env_azure.this.name
wait_for_applied_spec_revision = altinitycloud_env_azure.this.spec_revision
}
```

<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -213,7 +219,6 @@ Required:

- `key` (String) Name of the key
- `value` (String) Value of the key

## Import

Import is supported using the following syntax:
Expand Down
9 changes: 7 additions & 2 deletions docs/resources/env_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Bring Your Own Cloud (BYOC) GCP environment resource.

## Example Usage

GCP environment with public Load Balancer:
### GCP environment with public Load Balancer:
```terraform
provider "google" {
}
Expand Down Expand Up @@ -71,6 +71,12 @@ resource "altinitycloud_env_gcp" "this" {
}
]
}
// Since the environment provisioning is an async process, this data source is used to wait for environment to be fully provisioned.
data "altinitycloud_env_gcp_status" "this" {
name = altinitycloud_env_gcp.this.name
wait_for_applied_spec_revision = altinitycloud_env_gcp.this.spec_revision
}
```

<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -199,7 +205,6 @@ Required:
Optional:

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

## Import

Import is supported using the following syntax:
Expand Down
Loading

0 comments on commit ff1d62a

Please sign in to comment.