Skip to content

Commit

Permalink
Merge pull request #58 from juan-vg/docs/add-examples-and-imports
Browse files Browse the repository at this point in the history
Improve docs: Add examples and imports (plus section sorting and renaming)
  • Loading branch information
serdec authored May 22, 2024
2 parents d927ba0 + 50ae30e commit 3578072
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 29 deletions.
33 changes: 26 additions & 7 deletions docs/data-sources/private_endpoint_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,36 @@ subcategory: ""
description: |-
---

# clickhouse_private_endpoint_config (Data Source)
# Data Source: clickhouse_private_endpoint_config

<!-- schema generated by tfplugindocs -->
`clickhouse_private_endpoint_config` provides details about the service name that ClickHouse Cloud has for the specified region.

This resource can be useful for getting the service name required for endpoint creation.


## Example Usage

## Schema
```terraform
data "clickhouse_private_endpoint_config" "this" {
cloud_provider = "aws"
region = "us-east-2"
}
resource "aws_vpc_endpoint" "this" {
vpc_id = var.vpc_id
service_name = data.clickhouse_private_endpoint_config.this.endpoint_service_id
}
```


<!-- schema generated by tfplugindocs -->
## Argument Reference

### Required

- `cloud_provider` (String) The cloud provider for the private endpoint. Valid values are 'aws' or 'gcp''.
- `region` (String) The region for the private endpoint. Valid values are specific to the cloud provider i.e. us-east-2
- `cloud_provider` (String) The cloud provider for the private endpoint. Valid values are 'aws' or 'gcp'.
- `region` (String) The region for the private endpoint. Valid values are specific to the cloud provider i.e. 'us-east-2'

### Read-Only
### Attribute Reference

- `endpoint_service_id` (String) The ID of the private endpoint that is used to securely connect to ClickHouse. This is a read-only attribute.
- `endpoint_service_id` (String) The ID of the private endpoint that is used to securely connect to ClickHouse.
31 changes: 29 additions & 2 deletions docs/resources/private_endpoint_registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ description: |-
---

# clickhouse_private_endpoint_registration (Resource)
# Resource: clickhouse_private_endpoint_registration

Registers an Endpoint ID to ClickHouse Cloud organization


## Example Usage

```terraform
resource "clickhouse_private_endpoint_registration" "this" {
cloud_provider = "aws"
region = "us-east-2"
id = "vpce-0abc1def234abc567"
description = "vpce-0abc1def234abc567"
}
```


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

### Required

Expand All @@ -26,3 +37,19 @@ description: |-
- `description` (String) Description of the private endpoint


## Import

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import private endpoint registrations using the VPC endpoint `id`. For example:

```terraform
import {
to = clickhouse_private_endpoint_registration.this
id = "vpce-0abc1def234abc567"
}
```

Using `terraform import`, import private endpoint registrations using the VPC endpoint `id`. For example:

```console
% terraform import clickhouse_private_endpoint_registration.this vpce-0abc1def234abc567
```
68 changes: 48 additions & 20 deletions docs/resources/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ subcategory: ""
description: |-
---

# clickhouse_service (Resource)
# Resource: clickhouse_service

<!-- schema generated by tfplugindocs -->
Creates a new service on ClickHouse Cloud within your Organization.


## Example Usage

```terraform
resource "clickhouse_service" "this" {
cloud_provider = "aws"
region = "us-east-2"
name = var.name
tier = "production"
ip_access = [{ "source" = "0.0.0.0/0", "description" = "Anywhere access" }]
}
```

## Schema

<!-- schema generated by tfplugindocs -->
## Argument Reference

### Required

Expand All @@ -30,41 +45,54 @@ description: |-
- `password_hash` (String, Sensitive) SHA256 hash of password for the default user. One of either `password` or `password_hash` must be specified.
- `private_endpoint_ids` (List of String) List of private endpoint IDs

### Read-Only

- `endpoints` (Attributes List) List of public endpoints. (see [below for nested schema](#nestedatt--endpoints))
- `iam_role` (String) IAM role used for accessing objects in s3.
- `id` (String) ID of the created service. Generated by ClickHouse Cloud.
- `last_updated` (String) Date for when the service was last updated by Terraform.
- `private_endpoint_config` (Attributes) Service config for private endpoints (see [below for nested schema](#nestedatt--private_endpoint_config))

<a id="nestedatt--ip_access"></a>

### Nested Schema for `ip_access`
#### Nested Schema for `ip_access`

Required:

- `source` (String) IP address allowed to access the service. In case you want to set the ip_access to anywhere you should set source to 0.0.0.0/0

Optional:

- `description` (String) Description of the IP address.

<a id="nestedatt--endpoints"></a>

### Nested Schema for `endpoints`
## Attribute Reference

Read-Only:
- `endpoints` (Attributes List) List of public endpoints. (see [below for nested schema](#nestedatt--endpoints))
- `iam_role` (String) IAM role used for accessing objects in s3.
- `id` (String) ID of the created service. Generated by ClickHouse Cloud.
- `last_updated` (String) Date for when the service was last updated by Terraform.
- `private_endpoint_config` (Attributes) Service config for private endpoints (see [below for nested schema](#nestedatt--private_endpoint_config))

<a id="nestedatt--endpoints"></a>

#### Nested Schema for `endpoints`

- `host` (String) Endpoint host.
- `port` (Number) Endpoint port.
- `protocol` (String) Endpoint protocol: https or nativesecure

<a id="nestedatt--private_endpoint_config"></a>

### Nested Schema for `private_endpoint_config`

Read-Only:
#### Nested Schema for `private_endpoint_config`

- `endpoint_service_id` (String) Unique identifier of the interface endpoint you created in your VPC with the AWS(Service Name) or GCP(Target Service) resource
- `private_dns_hostname` (String) Private DNS Hostname of the VPC you created


## Import

In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import services using their `id`. For example:

```terraform
import {
to = clickhouse_service.this
id = "01a2b34c-d56e-7f8a-bc9d-0efabc12defa"
}
```

Using `terraform import`, import services using their `id`. For example:

```console
% terraform import clickhouse_service.this 01a2b34c-d56e-7f8a-bc9d-0efabc12defa
```

0 comments on commit 3578072

Please sign in to comment.