Skip to content

Commit

Permalink
feat: update provider docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gezi-lzq committed Aug 19, 2024
2 parents 9bda22d + 4bdfc91 commit c114de7
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 37 deletions.
8 changes: 4 additions & 4 deletions docs/data-sources/kafka_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "automq_kafka_instance Data Source - automq"
subcategory: ""
description: |-
Using the automq_kafka_instance resource type, you can create and manage Kafka instances, where each instance represents a physical cluster.
Using the automq_kafka_instance data source, you can manage kafka resoure within instance.
---

# automq_kafka_instance (Data Source)

![Preview](https://img.shields.io/badge/Lifecycle_Stage-Preview-blue?style=flat&logoColor=8A3BE2&labelColor=rgba)<br><br>Using the `automq_kafka_instance` resource type, you can create and manage Kafka instances, where each instance represents a physical cluster.
![Preview](https://img.shields.io/badge/Lifecycle_Stage-Preview-blue?style=flat&logoColor=8A3BE2&labelColor=rgba)<br><br>Using the `automq_kafka_instance` data source, you can manage kafka resoure within instance.



Expand All @@ -24,9 +24,9 @@ description: |-
### Read-Only

- `acl` (Boolean) The ACL status the Kafka instance.
- `cloud_provider` (String) The cloud provider of kafka instance. Currently, 'aws' is supported.
- `cloud_provider` (String) The cloud provider of kafka instance. Currently, `aws` is supported.
- `compute_specs` (Attributes) The compute specs of the instance, contains aku and version. (see [below for nested schema](#nestedatt--compute_specs))
- `configs` (Map of String) Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/release-notes).
- `configs` (Map of String) Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/using-automq-for-kafka/restrictions#instance-level-configuration).
- `created_at` (String)
- `description` (String) The instance description are used to differentiate the purpose of the instance. They support letters (a-z or A-Z), numbers (0-9), underscores (_), spaces( ) and hyphens (-), with a length limit of 3 to 128 characters.
- `endpoints` (Attributes List) The bootstrap endpoints of instance. AutoMQ supports multiple access protocols; therefore, the Endpoint is a list. (see [below for nested schema](#nestedatt--endpoints))
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The AutoMQ environment represents a namespace, with each environment containing
The AutoMQ Provider is used to manage an already installed AutoMQ environment. Therefore, before using the AutoMQ Provider, you need to complete the environment installation and obtain the access point and initial account information.

Refer to the following for specific operations:
- Install the AutoMQ environment by following the [documentation](https://github.com/AutoMQ/terraform-provider-automq/pull/22).
- Create a ServiceAccount and obtain an AccessKey: After the environment is installed, users need to access the AutoMQ environment console through a web browser, create a Service Account, and use the AccessKey of the Service Account. You can get these by creating a Service account; refer to [docs](https://docs.automq.com/automq-cloud/manage-identities-and-access).
- Install the AutoMQ environment by following the [documentation](https://registry.terraform.io/modules/AutoMQ/automq-byoc-environmet/aws/latest).
- Create a ServiceAccount and obtain an AccessKey: After the environment is installed, users need to access the AutoMQ environment console through web browser, create a Service Account, and use the Access Key of the Service Account. Please refer to [document](https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts).


## Example Usage
Expand Down Expand Up @@ -80,9 +80,9 @@ variable "automq_environment_id" {

### Optional

- `automq_byoc_access_key_id` (String) Set the Access Key Id of client. AutoMQ Cloud (BYOC) requires Access Keys to manage access and authentication to different parts of the service. An Access Key consists of an access key id and a secret key. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access).
- `automq_byoc_endpoint` (String) Set the AutoMQ BYOC environment endpoint. The endpoint like http://{hostname}:8080. You can get this endpoint when deploy environment complete.
- `automq_byoc_secret_key` (String) Set the Secret Access Key of client. AutoMQ Cloud (BYOC) requires Access Keys to manage access and authentication to different parts of the service. An Access Key consists of an access key id and a secret key. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access).
- `automq_byoc_access_key_id` (String) Set the Access Key Id of Service Account. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts).
- `automq_byoc_endpoint` (String) Set the AutoMQ BYOC environment endpoint. The endpoint looks like http://{hostname}:8080. You can get this endpoint when deploy environment complete.
- `automq_byoc_secret_key` (String) Set the Secret Access Key of Service Account. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts).
- `automq_environment_id` (String) Target AutoMQ BYOC environment, this attribute is specified during the deployment and installation process.

## Helpful Links/Information
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/kafka_acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ resource "automq_kafka_acl" "example" {
### Required

- `kafka_instance_id` (String) Target Kafka instance ID, each instance represents a kafka cluster. The instance id looks like kf-xxxxxxx.
- `operation_group` (String) Set the authorized operation group. For the Topic resource type, the supported operations are `ALL (all permissions)`, `PRODUCE (produce messages only)`, and `CONSUME (consume messages only)`. For other resource types, only `ALL (all permissions)` is supported.
- `operation_group` (String) Set the authorized operation group. For the Topic resource type, the supported operations are `ALL` (all permissions), `PRODUCE` (produce messages only), and `CONSUME` (consume messages only). For other resource types, only `ALL` (all permissions) is supported.
- `pattern_type` (String) Set the resource name matching pattern, supporting `LITERAL` and `PREFIXED`. `LITERAL` represents exact matching, while `PREFIXED` represents prefix matching.
- `principal` (String) Set the authorized target principal, which currently supports Kafka User type principals, i.e., User:xxxx. Specify the Kafka user name. Principal must start with `User:` and contact with kafka_username.
- `resource_name` (String) The target resource name for Kafka ACL authorization, can be a specific resource name or a resource name prefix (when using prefix matching, only the prefix needs to be provided without ending with "\*"). If only "\*" is specified, it represents all resources.
- `principal` (String) Set the authorized target principal, which currently supports Kafka User type principals, i.e., `User:xxxx`. Specify the Kafka user name. Principal must start with `User:` and contact with `kafka_user`.
- `resource_name` (String) The target resource name for Kafka ACL authorization, can be a specific resource name or a resource name prefix (when using prefix matching, only the prefix needs to be provided without ending with `*`). If only `*` is specified, it represents all resources.
- `resource_type` (String) The Kafka ACL authorized resource types, currently support `CLUSTER`, `TOPIC`, `CONSUMERGROUP` and `TRANSACTION_ID`.

### Optional

- `environment_id` (String) Target AutoMQ BYOC environment, this attribute is specified during the deployment and installation process.
- `permission` (String) Set the permission type, which supports `ALLOW` and `DENY`. `ALLOW` grants permission to perform the operation, while `DENY` prohibits the operation. `DENY` takes precedence over `ALLOW`.
- `permission` (String) Set the permission type, which supports `ALLOW` and `DENY`. Default value is `ALLOW`. `ALLOW` grants permission to perform the operation, while `DENY` prohibits the operation. `DENY` takes precedence over `ALLOW`.

### Read-Only

Expand Down
10 changes: 5 additions & 5 deletions docs/resources/kafka_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ variable "instance_deploy_subnet" {

### Required

- `cloud_provider` (String) To set up a Kafka instance, you need to specify the target cloud provider environment for deployment. Currently, 'aws' is supported.
- `cloud_provider` (String) To set up a Kafka instance, you need to specify the target cloud provider environment for deployment. Currently, `aws` is supported. This parameter must match the cloud provider and region where the current environment is deployed.
- `compute_specs` (Attributes) The compute specs of the instance, contains aku and version. (see [below for nested schema](#nestedatt--compute_specs))
- `name` (String) The name of the Kafka instance. It can contain letters (a-z or A-Z), numbers (0-9), underscores (_), and hyphens (-), with a length limit of 3 to 64 characters.
- `networks` (Attributes List) To configure the network settings for an instance, you need to specify the availability zone(s) and subnet information. Currently, you can set either one availability zone or three availability zones. (see [below for nested schema](#nestedatt--networks))
- `region` (String) To set up an instance, you need to specify the target region for deployment. Refer to the RegionId list provided by each cloud provider for available regions. Using AWS as an example, refer to this [documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) to set the correct `RegionId`.
- `region` (String) To set up an instance, you need to specify the target region for deployment. This parameter must match the cloud provider and region where the current environment is deployed.

### Optional

- `acl` (Boolean) Configure ACL enablement. Default is false (disabled).
- `configs` (Map of String) Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/release-notes).
- `configs` (Map of String) Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/using-automq-for-kafka/restrictions#instance-level-configuration).
- `description` (String) The instance description are used to differentiate the purpose of the instance. They support letters (a-z or A-Z), numbers (0-9), underscores (_), spaces( ) and hyphens (-), with a length limit of 3 to 128 characters.
- `environment_id` (String) Target AutoMQ BYOC environment, this attribute is specified during the deployment and installation process.
- `integrations` (List of String) Configure integration settings. AutoMQ supports integration with external products like `prometheus` and `cloudWatch`, forwarding instance Metrics data to Prometheus and CloudWatch.
- `integrations` (List of String) Configure integration setting. Set existed integration id. AutoMQ supports integration with external products like `prometheus` and `cloudWatch`, forwarding instance Metrics data to Prometheus and CloudWatch. Currently, only one integration is supported. Configuring multiple integrations simultaneously is not supported.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only
Expand All @@ -76,7 +76,7 @@ variable "instance_deploy_subnet" {

Required:

- `aku` (Number) AutoMQ defines AKU (AutoMQ Kafka Unit) to measure the scale of the cluster. Each AKU provides 20 MiB/s of read/write throughput. For more details on AKU, please refer to the [documentation](https://docs.automq.com/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc). The currently supported AKU specifications are 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24. If an invalid AKU value is set, the instance cannot be created.
- `aku` (Number) AutoMQ defines AKU (AutoMQ Kafka Unit) to measure the scale of the cluster. Each AKU provides 20 MiB/s of read/write throughput. For more details on AKU, please refer to the [documentation](https://docs.automq.com/automq-cloud/subscriptions-and-billings/byoc-env-billings/billing-instructions-for-byoc#indicator-constraints). The currently supported AKU specifications are 6, 8, 10, 12, 14, 16, 18, 20, 22, and 24. If an invalid AKU value is set, the instance cannot be created.

Optional:

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "automq_kafka_topic" "example" {

- `configs` (Map of String) Additional configuration for the Kafka topic. Please refer to the [documentation](https://docs.automq.com/automq-cloud/using-automq-for-kafka/restrictions#topic-level-configuration) to set the current supported custom parameters.
- `environment_id` (String) Target AutoMQ BYOC environment, this attribute is specified during the deployment and installation process.
- `partition` (Number) Number of partitions for the Kafka topic. The number of partitions must be at least greater than the number of consumers.
- `partition` (Number) Number of partitions for the Kafka topic. The valid range is 1-1024. The number of partitions must be at least greater than the number of consumers.

### Read-Only

Expand Down
6 changes: 3 additions & 3 deletions internal/provider/datasource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *KafkaInstanceDataSource) Metadata(ctx context.Context, req datasource.M
func (r *KafkaInstanceDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
resp.Schema = schema.Schema{
// This description is used by the documentation generator and the language server.
MarkdownDescription: "![Preview](https://img.shields.io/badge/Lifecycle_Stage-Preview-blue?style=flat&logoColor=8A3BE2&labelColor=rgba)<br><br>Using the `automq_kafka_instance` resource type, you can create and manage Kafka instances, where each instance represents a physical cluster.",
MarkdownDescription: "![Preview](https://img.shields.io/badge/Lifecycle_Stage-Preview-blue?style=flat&logoColor=8A3BE2&labelColor=rgba)<br><br>Using the `automq_kafka_instance` data source, you can manage kafka resoure within instance.",

Attributes: map[string]schema.Attribute{
"environment_id": schema.StringAttribute{
Expand All @@ -55,7 +55,7 @@ func (r *KafkaInstanceDataSource) Schema(_ context.Context, _ datasource.SchemaR
Computed: true,
},
"cloud_provider": schema.StringAttribute{
MarkdownDescription: "The cloud provider of kafka instance. Currently, 'aws' is supported.",
MarkdownDescription: "The cloud provider of kafka instance. Currently, `aws` is supported.",
Computed: true,
},
"region": schema.StringAttribute{
Expand Down Expand Up @@ -100,7 +100,7 @@ func (r *KafkaInstanceDataSource) Schema(_ context.Context, _ datasource.SchemaR
},
"configs": schema.MapAttribute{
ElementType: types.StringType,
MarkdownDescription: "Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/release-notes).",
MarkdownDescription: "Additional configuration for the Kafka Instance. The currently supported parameters can be set by referring to the [documentation](https://docs.automq.com/automq-cloud/using-automq-for-kafka/restrictions#instance-level-configuration).",
Computed: true,
},
"integrations": schema.ListAttribute{
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ func (p *AutoMQProvider) Schema(ctx context.Context, req provider.SchemaRequest,
Optional: true,
},
"automq_byoc_access_key_id": schema.StringAttribute{
MarkdownDescription: "Set the Access Key Id of client. AutoMQ Cloud (BYOC) requires Access Keys to manage access and authentication to different parts of the service. An Access Key consists of an access key id and a secret key. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access).",
MarkdownDescription: "Set the Access Key Id of Service Account. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts).",
Optional: true,
},
"automq_byoc_secret_key": schema.StringAttribute{
MarkdownDescription: "Set the Secret Access Key of client. AutoMQ Cloud (BYOC) requires Access Keys to manage access and authentication to different parts of the service. An Access Key consists of an access key id and a secret key. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access).",
MarkdownDescription: "Set the Secret Access Key of Service Account. You can create and manage Access Keys by using the AutoMQ Cloud BYOC Console. Learn more about AutoMQ Cloud BYOC Console access [here](https://docs.automq.com/automq-cloud/manage-identities-and-access/service-accounts).",
Optional: true,
},
"automq_byoc_endpoint": schema.StringAttribute{
MarkdownDescription: "Set the AutoMQ BYOC environment endpoint. The endpoint like http://{hostname}:8080. You can get this endpoint when deploy environment complete.",
MarkdownDescription: "Set the AutoMQ BYOC environment endpoint. The endpoint looks like http://{hostname}:8080. You can get this endpoint when deploy environment complete.",
Optional: true,
},
},
Expand Down
Loading

0 comments on commit c114de7

Please sign in to comment.