Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vandyliu committed Apr 9, 2024
1 parent 1d4dfe7 commit 98e6e6d
Show file tree
Hide file tree
Showing 15 changed files with 154 additions and 93 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ If you wish to work on the provider, you'll first need [Go](http://www.golang.or

To compile the provider, see [Building The Provider](## Building The Provider).

To add example docs, add the correspond `.tf` files to the `examples` directory.

To run terraform with the provider, create a `.terraformrc` file in your home directory (`~`) with the following content to override the provider installation with the local build:

```hcl
Expand Down
58 changes: 31 additions & 27 deletions docs/data-sources/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ description: |-

Deployment data source

## Example Usage

```terraform
data "astronomer_deployment" "example" {
id = "clozc036j01to01jrlgvueo8t"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -25,7 +31,6 @@ Deployment data source
- `astro_runtime_version` (String) Deployment Astro Runtime version
- `cloud_provider` (String) Deployment cloud provider
- `cluster_id` (String) Deployment cluster identifier
- `cluster_name` (String) Deployment cluster name
- `contact_emails` (List of String) Deployment contact emails
- `created_at` (String) Deployment creation timestamp
- `created_by` (Attributes) Deployment creator (see [below for nested schema](#nestedatt--created_by))
Expand All @@ -40,10 +45,10 @@ Deployment data source
- `image_repository` (String) Deployment image repository
- `image_tag` (String) Deployment mage tag
- `image_version` (String) Deployment image version
- `is_cicd_enforced` (Boolean) Deployment CI/CD enforced
- `is_dag_deploy_enabled` (Boolean) Deployment DAG deploy enabled
- `is_development_mode` (Boolean) Deployment development mode
- `is_high_availability` (Boolean) Deployment high availability
- `is_cicd_enforced` (Boolean) Whether the Deployment enforces CI/CD deploys
- `is_dag_deploy_enabled` (Boolean) Whether DAG deploy is enabled
- `is_development_mode` (Boolean) Whether Deployment is in development mode
- `is_high_availability` (Boolean) Whether Deployment has high availability
- `name` (String) Deployment name
- `namespace` (String) Deployment namespace
- `oidc_issuer_url` (String) Deployment OIDC issuer URL
Expand Down Expand Up @@ -72,7 +77,6 @@ Deployment data source
- `worker_queues` (Attributes List) Deployment worker queues (see [below for nested schema](#nestedatt--worker_queues))
- `workload_identity` (String) Deployment workload identity
- `workspace_id` (String) Deployment workspace identifier
- `workspace_name` (String) Deployment workspace name

<a id="nestedatt--created_by"></a>
### Nested Schema for `created_by`
Expand Down Expand Up @@ -118,20 +122,20 @@ Read-Only:

Read-Only:

- `is_active` (Boolean)
- `is_hibernating` (Boolean)
- `override_until` (String)
- `is_active` (Boolean) Whether the override is active
- `is_hibernating` (Boolean) Whether the override is hibernating
- `override_until` (String) Time until the override is active


<a id="nestedatt--scaling_spec--hibernation_spec--schedules"></a>
### Nested Schema for `scaling_spec.hibernation_spec.schedules`

Read-Only:

- `description` (String)
- `hibernate_at_cron` (String)
- `is_enabled` (Boolean)
- `wake_at_cron` (String)
- `description` (String) Description of the schedule
- `hibernate_at_cron` (String) Cron expression for hibernation
- `is_enabled` (Boolean) Whether the schedule is enabled
- `wake_at_cron` (String) Cron expression for waking



Expand All @@ -148,10 +152,10 @@ Read-Only:

Read-Only:

- `is_hibernating` (Boolean)
- `next_event_at` (String)
- `next_event_type` (String)
- `reason` (String)
- `is_hibernating` (Boolean) Whether the deployment is hibernating
- `next_event_at` (String) Time of the next event
- `next_event_type` (String) Type of the next event
- `reason` (String) Reason for the current state



Expand All @@ -173,13 +177,13 @@ Read-Only:

Read-Only:

- `astro_machine` (String)
- `id` (String)
- `is_default` (Boolean)
- `max_worker_count` (Number)
- `min_worker_count` (Number)
- `name` (String)
- `node_pool_id` (String)
- `pod_cpu` (String)
- `pod_memory` (String)
- `worker_concurrency` (Number)
- `astro_machine` (String) Worker queue Astro machine value
- `id` (String) Worker queue identifier
- `is_default` (Boolean) Whether Worker queue is default
- `max_worker_count` (Number) Worker queue max worker count
- `min_worker_count` (Number) Worker queue min worker count
- `name` (String) Worker queue name
- `node_pool_id` (String) Worker queue node pool identifier
- `pod_cpu` (String) Worker queue pod CPU
- `pod_memory` (String) Worker queue pod memory
- `worker_concurrency` (Number) Worker queue worker concurrency
64 changes: 37 additions & 27 deletions docs/data-sources/deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ description: |-

Deployments data source

## Example Usage

```terraform
data "astronomer_deployments" "example_deployments" {}
data "astronomer_deployments" "example_deployments_filter_by_deployment_ids" {
deployment_ids = ["clozc036j01to01jrlgvueo8t", "clozc036j01to01jrlgvueo81"]
}
data "astronomer_deployments" "example_deployments_filter_by_names" {
deployment_ids = ["my first deployment", "my second deployment"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -37,7 +49,6 @@ Read-Only:
- `astro_runtime_version` (String) Deployment Astro Runtime version
- `cloud_provider` (String) Deployment cloud provider
- `cluster_id` (String) Deployment cluster identifier
- `cluster_name` (String) Deployment cluster name
- `contact_emails` (List of String) Deployment contact emails
- `created_at` (String) Deployment creation timestamp
- `created_by` (Attributes) Deployment creator (see [below for nested schema](#nestedatt--deployments--created_by))
Expand All @@ -52,10 +63,10 @@ Read-Only:
- `image_repository` (String) Deployment image repository
- `image_tag` (String) Deployment mage tag
- `image_version` (String) Deployment image version
- `is_cicd_enforced` (Boolean) Deployment CI/CD enforced
- `is_dag_deploy_enabled` (Boolean) Deployment DAG deploy enabled
- `is_development_mode` (Boolean) Deployment development mode
- `is_high_availability` (Boolean) Deployment high availability
- `is_cicd_enforced` (Boolean) Whether the Deployment enforces CI/CD deploys
- `is_dag_deploy_enabled` (Boolean) Whether DAG deploy is enabled
- `is_development_mode` (Boolean) Whether Deployment is in development mode
- `is_high_availability` (Boolean) Whether Deployment has high availability
- `name` (String) Deployment name
- `namespace` (String) Deployment namespace
- `oidc_issuer_url` (String) Deployment OIDC issuer URL
Expand Down Expand Up @@ -84,7 +95,6 @@ Read-Only:
- `worker_queues` (Attributes List) Deployment worker queues (see [below for nested schema](#nestedatt--deployments--worker_queues))
- `workload_identity` (String) Deployment workload identity
- `workspace_id` (String) Deployment workspace identifier
- `workspace_name` (String) Deployment workspace name

<a id="nestedatt--deployments--created_by"></a>
### Nested Schema for `deployments.created_by`
Expand Down Expand Up @@ -130,20 +140,20 @@ Read-Only:

Read-Only:

- `is_active` (Boolean)
- `is_hibernating` (Boolean)
- `override_until` (String)
- `is_active` (Boolean) Whether the override is active
- `is_hibernating` (Boolean) Whether the override is hibernating
- `override_until` (String) Time until the override is active


<a id="nestedatt--deployments--scaling_spec--hibernation_spec--schedules"></a>
### Nested Schema for `deployments.scaling_spec.hibernation_spec.schedules`

Read-Only:

- `description` (String)
- `hibernate_at_cron` (String)
- `is_enabled` (Boolean)
- `wake_at_cron` (String)
- `description` (String) Description of the schedule
- `hibernate_at_cron` (String) Cron expression for hibernation
- `is_enabled` (Boolean) Whether the schedule is enabled
- `wake_at_cron` (String) Cron expression for waking



Expand All @@ -160,10 +170,10 @@ Read-Only:

Read-Only:

- `is_hibernating` (Boolean)
- `next_event_at` (String)
- `next_event_type` (String)
- `reason` (String)
- `is_hibernating` (Boolean) Whether the deployment is hibernating
- `next_event_at` (String) Time of the next event
- `next_event_type` (String) Type of the next event
- `reason` (String) Reason for the current state



Expand All @@ -185,13 +195,13 @@ Read-Only:

Read-Only:

- `astro_machine` (String)
- `id` (String)
- `is_default` (Boolean)
- `max_worker_count` (Number)
- `min_worker_count` (Number)
- `name` (String)
- `node_pool_id` (String)
- `pod_cpu` (String)
- `pod_memory` (String)
- `worker_concurrency` (Number)
- `astro_machine` (String) Worker queue Astro machine value
- `id` (String) Worker queue identifier
- `is_default` (Boolean) Whether Worker queue is default
- `max_worker_count` (Number) Worker queue max worker count
- `min_worker_count` (Number) Worker queue min worker count
- `name` (String) Worker queue name
- `node_pool_id` (String) Worker queue node pool identifier
- `pod_cpu` (String) Worker queue pod CPU
- `pod_memory` (String) Worker queue pod memory
- `worker_concurrency` (Number) Worker queue worker concurrency
12 changes: 12 additions & 0 deletions docs/data-sources/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ description: |-

Workspaces data source

## Example Usage

```terraform
data "astronomer_workspaces" "example_workspaces" {}
data "astronomer_workspaces" "example_workspaces_filter_by_workspace_ids" {
workspace_ids = ["clozc036j01to01jrlgvueo8t", "clozc036j01to01jrlgvueo81"]
}
data "astronomer_workspaces" "example_workspaces_filter_by_names" {
workspace_ids = ["my first workspace", "my second workspace"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
3 changes: 3 additions & 0 deletions examples/data-sources/astronomer_deployment/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "astronomer_deployment" "example" {
id = "clozc036j01to01jrlgvueo8t"
}
9 changes: 9 additions & 0 deletions examples/data-sources/astronomer_deployments/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data "astronomer_deployments" "example_deployments" {}

data "astronomer_deployments" "example_deployments_filter_by_deployment_ids" {
deployment_ids = ["clozc036j01to01jrlgvueo8t", "clozc036j01to01jrlgvueo81"]
}

data "astronomer_deployments" "example_deployments_filter_by_names" {
deployment_ids = ["my first deployment", "my second deployment"]
}
9 changes: 9 additions & 0 deletions examples/data-sources/astronomer_workspaces/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data "astronomer_workspaces" "example_workspaces" {}

data "astronomer_workspaces" "example_workspaces_filter_by_workspace_ids" {
workspace_ids = ["clozc036j01to01jrlgvueo8t", "clozc036j01to01jrlgvueo81"]
}

data "astronomer_workspaces" "example_workspaces_filter_by_names" {
workspace_ids = ["my first workspace", "my second workspace"]
}
5 changes: 1 addition & 4 deletions internal/provider/models/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

import (
"context"

"github.com/astronomer/astronomer-terraform-provider/internal/clients/platform"
"github.com/astronomer/astronomer-terraform-provider/internal/provider/schemas"
"github.com/astronomer/astronomer-terraform-provider/internal/utils"
Expand All @@ -19,9 +20,7 @@ type DeploymentDataSource struct {
CreatedBy types.Object `tfsdk:"created_by"`
UpdatedBy types.Object `tfsdk:"updated_by"`
WorkspaceId types.String `tfsdk:"workspace_id"`
WorkspaceName types.String `tfsdk:"workspace_name"`
ClusterId types.String `tfsdk:"cluster_id"`
ClusterName types.String `tfsdk:"cluster_name"`
Region types.String `tfsdk:"region"`
CloudProvider types.String `tfsdk:"cloud_provider"`
AstroRuntimeVersion types.String `tfsdk:"astro_runtime_version"`
Expand Down Expand Up @@ -105,9 +104,7 @@ func (data *DeploymentDataSource) ReadFromResponse(
return diags
}
data.WorkspaceId = types.StringValue(deployment.WorkspaceId)
data.WorkspaceName = types.StringPointerValue(deployment.WorkspaceName)
data.ClusterId = types.StringPointerValue(deployment.ClusterId)
data.ClusterName = types.StringPointerValue(deployment.ClusterName)
data.Region = types.StringPointerValue(deployment.Region)
data.CloudProvider = types.StringPointerValue((*string)(deployment.CloudProvider))
data.AstroRuntimeVersion = types.StringValue(deployment.AstroRuntimeVersion)
Expand Down
1 change: 1 addition & 0 deletions internal/provider/models/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

import (
"context"

"github.com/astronomer/astronomer-terraform-provider/internal/clients/platform"
"github.com/astronomer/astronomer-terraform-provider/internal/provider/schemas"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down
1 change: 1 addition & 0 deletions internal/provider/models/subject_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

import (
"context"

"github.com/astronomer/astronomer-terraform-provider/internal/clients/iam"
"github.com/astronomer/astronomer-terraform-provider/internal/provider/schemas"
"github.com/hashicorp/terraform-plugin-log/tflog"
Expand Down
1 change: 1 addition & 0 deletions internal/provider/models/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

import (
"context"

"github.com/astronomer/astronomer-terraform-provider/internal/clients/platform"
"github.com/astronomer/astronomer-terraform-provider/internal/provider/schemas"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down
Loading

0 comments on commit 98e6e6d

Please sign in to comment.