-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: beacon analytics schema (#544)
* feat: beacon analytics schema * fix: model fix * fix: removed unneccessary cluster type from schema * refactor: package constant for client timeout * fix: typo * fix: schema change requests * feat: beacon analytics create (#549) * fix: model fix * feat: beacon analytics cluster create * fix: examples * fix: rebase fixes * fix: comments * feat: beacon analytics update and import (#550) * fix: examples * feat: beacon analytics cluster update * feat: beacon analytics cluster update and import * fix: examples beacon analytics cluster * fix: beacon analytics delete (#551) * fix: beacon analytics delete cluster * refactor: removed beacon naming (#552) * refactor: removed beacon naming * fix: removed unused struct * fix: typo * fix: cidr optional * fix: examples and beacon naming * fix: wip datasource * fix: bug in analytics cluster resource * fix: datasource fix * fix: import
- Loading branch information
1 parent
1905afd
commit 88c8951
Showing
15 changed files
with
1,079 additions
and
16 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
examples/data-sources/biganimal_analytics_cluster/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
variable "cluster_id" { | ||
type = string | ||
description = "The id of the cluster" | ||
} | ||
|
||
variable "project_id" { | ||
type = string | ||
description = "BigAnimal Project ID" | ||
} | ||
|
||
data "biganimal_analytics_cluster" "this" { | ||
cluster_id = var.cluster_id | ||
project_id = var.project_id | ||
} | ||
|
||
output "backup_retention_period" { | ||
value = data.biganimal_analytics_cluster.this.backup_retention_period | ||
} | ||
|
||
output "cluster_name" { | ||
value = data.biganimal_analytics_cluster.this.cluster_name | ||
} | ||
|
||
output "created_at" { | ||
value = data.biganimal_analytics_cluster.this.created_at | ||
} | ||
|
||
output "csp_auth" { | ||
value = coalesce(data.biganimal_analytics_cluster.this.csp_auth, false) | ||
} | ||
|
||
output "instance_type" { | ||
value = data.biganimal_analytics_cluster.this.instance_type | ||
} | ||
|
||
output "metrics_url" { | ||
value = data.biganimal_analytics_cluster.this.metrics_url | ||
} | ||
|
||
output "logs_url" { | ||
value = data.biganimal_analytics_cluster.this.logs_url | ||
} | ||
|
||
output "pg_type" { | ||
value = data.biganimal_analytics_cluster.this.pg_type | ||
} | ||
|
||
output "pg_version" { | ||
value = data.biganimal_analytics_cluster.this.pg_version | ||
} | ||
|
||
output "phase" { | ||
value = data.biganimal_analytics_cluster.this.phase | ||
} | ||
|
||
output "private_networking" { | ||
value = coalesce(data.biganimal_analytics_cluster.this.private_networking, false) | ||
} | ||
|
||
output "cloud_provider" { | ||
value = data.biganimal_analytics_cluster.this.cloud_provider | ||
} | ||
|
||
output "region" { | ||
value = data.biganimal_analytics_cluster.this.region | ||
} | ||
|
||
output "resizing_pvc" { | ||
value = data.biganimal_analytics_cluster.this.resizing_pvc | ||
} | ||
|
||
output "pe_allowed_principal_ids" { | ||
value = data.biganimal_analytics_cluster.this.pe_allowed_principal_ids | ||
} | ||
|
||
output "service_account_ids" { | ||
value = data.biganimal_analytics_cluster.this.service_account_ids | ||
} |
8 changes: 8 additions & 0 deletions
8
examples/data-sources/biganimal_analytics_cluster/provider.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
biganimal = { | ||
source = "EnterpriseDB/biganimal" | ||
version = "0.10.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# terraform import biganimal_analytics_cluster.<resource_name> <project_id>/<cluster_id> | ||
terraform import biganimal_analytics_cluster.analytics_cluster prj_deadbeef01234567/p-abcd123456 |
74 changes: 74 additions & 0 deletions
74
examples/resources/biganimal_analytics_cluster/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
terraform { | ||
required_providers { | ||
biganimal = { | ||
source = "EnterpriseDB/biganimal" | ||
version = "0.10.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "3.6.0" | ||
} | ||
} | ||
} | ||
|
||
resource "random_password" "password" { | ||
length = 16 | ||
special = true | ||
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
} | ||
|
||
variable "cluster_name" { | ||
type = string | ||
description = "The name of the cluster." | ||
} | ||
|
||
variable "project_id" { | ||
type = string | ||
description = "BigAnimal Project ID" | ||
} | ||
|
||
resource "biganimal_analytics_cluster" "analytics_cluster" { | ||
cluster_name = var.cluster_name | ||
project_id = var.project_id | ||
pause = false | ||
|
||
allowed_ip_ranges = [ | ||
{ | ||
cidr_block = "127.0.0.1/32" | ||
description = "localhost" | ||
}, | ||
{ | ||
cidr_block = "192.168.0.1/32" | ||
description = "description!" | ||
}, | ||
] | ||
|
||
backup_retention_period = "30d" | ||
csp_auth = false | ||
|
||
instance_type = "aws:m6id.12xlarge" | ||
password = resource.random_password.password.result | ||
|
||
maintenance_window = { | ||
is_enabled = false | ||
start_day = 0 | ||
start_time = "00:00" | ||
} | ||
|
||
pg_type = "epas" | ||
pg_version = "16" | ||
private_networking = false | ||
cloud_provider = "bah:aws" | ||
region = "ap-south-1" | ||
# pe_allowed_principal_ids = [ | ||
# <example_value> # AWS example: "123456789012", Azure example: "9334e5e6-7f47-aE61-5A4F-ee067daeEf4A", GCP example: "development-data-123456" | ||
# ] | ||
# service_account_ids = [ | ||
# <only_needed_for_bah:gcp_clusters> # ex: "[email protected]" | ||
# ] | ||
} | ||
|
||
output "password" { | ||
sensitive = true | ||
value = resource.biganimal_analytics_cluster.analytics_cluster.password | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ import ( | |
"time" | ||
) | ||
|
||
const clientTimeoutSeconds = 60 | ||
|
||
type API struct { | ||
BaseURL string | ||
Token string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package api | ||
|
||
import ( | ||
"net/http" | ||
"time" | ||
) | ||
|
||
type BeaconAnalyticsClient struct { | ||
API | ||
} | ||
|
||
func NewBeaconAnalyticsClient(api API) *BeaconAnalyticsClient { | ||
httpClient := http.Client{ | ||
Timeout: clientTimeoutSeconds * time.Second, | ||
} | ||
|
||
api.HTTPClient = httpClient | ||
c := BeaconAnalyticsClient{API: api} | ||
|
||
return &c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.