Skip to content

Commit

Permalink
feat: update integration type to use "cloudWatch" instead of "cloudwa…
Browse files Browse the repository at this point in the history
…tch"
  • Loading branch information
Gezi-lzq committed Aug 16, 2024
1 parent 8bb0424 commit 9bda22d
Show file tree
Hide file tree
Showing 18 changed files with 173 additions and 301 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/kafka_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ description: |-
- `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))
- `instance_status` (String) The status of instance. Currently supports statuses: `Creating`, `Running`, `Deleting`, `Changing` and `Abnormal`. For definitions and limitations of each status, please refer to the [documentation](https://docs.automq.com/automq-cloud/using-automq-for-kafka/manage-instances#lifecycle).
- `integrations` (List of String) List of All Integrations Associated with the Current Instance. AutoMQ supports integration with external products like `prometheus` and `cloudwatch`, forwarding instance Metrics data to Prometheus and CloudWatch.
- `integrations` (List of String) List of All Integrations Associated with the Current Instance. AutoMQ supports integration with external products like `prometheus` and `cloudWatch`, forwarding instance Metrics data to Prometheus and CloudWatch.
- `last_updated` (String)
- `networks` (Attributes List) The networks of the Kafka instance. Currently, you can get one availability zone or three availability zones. (see [below for nested schema](#nestedatt--networks))
- `region` (String) The region of the Kafka instance
Expand Down
46 changes: 42 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,54 @@ Refer to the following for specific operations:
### Example Provider Configuration

```terraform
provider "scaffolding" {
# example configuration here
provider "automq" {
automq_environment_id = var.automq_environment_id
automq_byoc_endpoint = var.automq_byoc_endpoint
automq_byoc_access_key_id = var.automq_byoc_access_key_id
automq_byoc_secret_key = var.automq_byoc_secret_key
}
variable "automq_byoc_endpoint" {
type = string
}
variable "automq_byoc_access_key_id" {
type = string
}
variable "automq_byoc_secret_key" {
type = string
}
variable "automq_environment_id" {
type = string
}
```

### Example Usage for an AWS BYOC environment

```terraform
provider "scaffolding" {
# example configuration here
provider "automq" {
automq_environment_id = var.automq_environment_id
automq_byoc_endpoint = var.automq_byoc_endpoint
automq_byoc_access_key_id = var.automq_byoc_access_key_id
automq_byoc_secret_key = var.automq_byoc_secret_key
}
variable "automq_byoc_endpoint" {
type = string
}
variable "automq_byoc_access_key_id" {
type = string
}
variable "automq_byoc_secret_key" {
type = string
}
variable "automq_environment_id" {
type = string
}
```

Expand Down
48 changes: 21 additions & 27 deletions docs/resources/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,31 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
automq = {
source = "hashicorp.com/edu/automq"
}
resource "automq_integration" "example-1" {
name = "example-1"
type = "cloudWatch"
endpoint = "http://xxxxx.xxx"
cloudwatch_config = {
namespace = "example"
}
}
locals {
env_id = "example"
automq_byoc_host = "http://localhost:8081"
automq_byoc_access_key_id = "RSaIMzrFC0kAmS1x"
automq_byoc_secret_key = "msnGqOuaV5gblXPvkWfxg7Ao7Nq2iyMo"
}
provider "automq" {
automq_byoc_host = local.automq_byoc_host
automq_byoc_access_key_id = local.automq_byoc_access_key_id
automq_byoc_secret_key = local.automq_byoc_secret_key
resource "automq_integration" "example-2" {
name = "example-2"
type = "kafka"
endpoint = "http://xxxxx.xxx"
kafka_config = {
security_protocol = "SASL_PLAINTEXT"
sasl_mechanism = "PLAIN"
sasl_username = "example"
sasl_password = "example"
}
}
resource "automq_integration" "example" {
environment_id = local.env_id
name = "example11"
type = "cloudWatch"
endpoint = "http://localhost:8082"
cloudwatch_config = {
namespace = "example"
}
resource "automq_integration" "example-3" {
name = "example-3"
type = "prometheus"
endpoint = "http://xxxxx.xxx"
}
```

Expand All @@ -53,7 +47,7 @@ resource "automq_integration" "example" {
### Required

- `name` (String) The integrated name identifies different configurations and contains 3 to 64 characters, including letters a to z or a to z, digits 0 to 9, underscores (_), and hyphens (-).
- `type` (String) Type of integration, currently support `kafka` and `cloudwatch`
- `type` (String) Type of integration, currently support `kafka` and `cloudWatch`

### Optional

Expand Down
28 changes: 2 additions & 26 deletions docs/resources/kafka_acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,13 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
automq = {
source = "hashicorp.com/edu/automq"
}
}
}
locals {
env_id = "example"
automq_byoc_host = "http://localhost:8081"
automq_byoc_access_key_id = "RSaIMzrFC0kAmS1x"
automq_byoc_secret_key = "msnGqOuaV5gblXPvkWfxg7Ao7Nq2iyMo"
}
provider "automq" {
automq_byoc_host = local.automq_byoc_host
automq_byoc_access_key_id = local.automq_byoc_access_key_id
automq_byoc_secret_key = local.automq_byoc_secret_key
}
resource "automq_kafka_acl" "example" {
environment_id = local.env_id
kafka_instance_id = "kf-gm4q8tk1wqlavkg2"
kafka_instance_id = "kf-gm4xxxxxxxxg2"
resource_type = "TOPIC"
resource_name = "example-"
pattern_type = "PREFIXED"
principal = "User:automq_kafka_user"
principal = "User:automq_xxxx_user"
operation_group = "ALL"
permission = "ALLOW"
}
Expand Down
53 changes: 22 additions & 31 deletions docs/resources/kafka_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,33 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
automq = {
source = "hashicorp.com/edu/automq"
resource "automq_kafka_instance" "example" {
name = "automq-example-1"
description = "example"
cloud_provider = "aws"
region = local.instance_deploy_region
networks = [
{
zone = var.instance_deploy_zone
subnets = [var.instance_deploy_subnet]
}
]
compute_specs = {
aku = "18"
}
acl = true
configs = {
"auto.create.topics.enable" = "false"
"log.retention.ms" = "3600000"
}
}
locals {
env_id = "example"
automq_byoc_host = "http://localhost:8081"
automq_byoc_access_key_id = "RSaIMzrFC0kAmS1x"
automq_byoc_secret_key = "msnGqOuaV5gblXPvkWfxg7Ao7Nq2iyMo"
}
provider "automq" {
automq_byoc_host = local.automq_byoc_host
automq_byoc_access_key_id = local.automq_byoc_access_key_id
automq_byoc_secret_key = local.automq_byoc_secret_key
variable "instance_deploy_zone" {
type = string
}
resource "automq_kafka_instance" "example" {
environment_id = local.env_id
name = "example123"
description = "example"
cloud_provider = "aliyun"
region = "cn-hangzhou"
networks = [{
zone = "cn-hangzhou-b"
subnet = "vsw-bp14v5eikr8wrgoqje7hr"
}]
compute_specs = {
aku = "12"
version = "1.1.0"
}
variable "instance_deploy_subnet" {
type = string
}
```

Expand All @@ -69,7 +60,7 @@ resource "automq_kafka_instance" "example" {
- `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).
- `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 settings. AutoMQ supports integration with external products like `prometheus` and `cloudWatch`, forwarding instance Metrics data to Prometheus and CloudWatch.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only
Expand Down
29 changes: 2 additions & 27 deletions docs/resources/kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,13 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
automq = {
source = "hashicorp.com/edu/automq"
}
}
}
locals {
env_id = "example"
automq_byoc_host = "http://localhost:8081"
automq_byoc_access_key_id = "RSaIMzrFC0kAmS1x"
automq_byoc_secret_key = "msnGqOuaV5gblXPvkWfxg7Ao7Nq2iyMo"
}
provider "automq" {
automq_byoc_host = local.automq_byoc_host
automq_byoc_access_key_id = local.automq_byoc_access_key_id
automq_byoc_secret_key = local.automq_byoc_secret_key
}
resource "automq_kafka_topic" "example" {
environment_id = local.env_id
kafka_instance_id = "kf-gm4q8tk1wqlavkg2"
kafka_instance_id = "kf-gm4q8xxxxxxvkg2"
name = "example"
partition = 72
partition = 16
compact_strategy = "DELETE"
configs = {
"delete.retention.ms" = "86400"
"retention.ms" = "3600000"
"max.message.bytes" = "1024"
}
}
```
Expand Down
28 changes: 2 additions & 26 deletions docs/resources/kafka_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,9 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
automq = {
source = "hashicorp.com/edu/automq"
}
}
}
locals {
env_id = "example"
automq_byoc_host = "http://localhost:8081"
automq_byoc_access_key_id = "RSaIMzrFC0kAmS1x"
automq_byoc_secret_key = "msnGqOuaV5gblXPvkWfxg7Ao7Nq2iyMo"
}
provider "automq" {
automq_byoc_host = local.automq_byoc_host
automq_byoc_access_key_id = local.automq_byoc_access_key_id
automq_byoc_secret_key = local.automq_byoc_secret_key
}
resource "automq_kafka_user" "example" {
environment_id = local.env_id
kafka_instance_id = "kf-gm4q8tk1wqlavkg2"
username = "automq_kafka_user"
kafka_instance_id = "kf-gm4xxxxxxxxg2"
username = "automq_xxxxx_user"
password = "123456789"
}
```
Expand Down
23 changes: 21 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
provider "scaffolding" {
# example configuration here
provider "automq" {
automq_environment_id = var.automq_environment_id
automq_byoc_endpoint = var.automq_byoc_endpoint
automq_byoc_access_key_id = var.automq_byoc_access_key_id
automq_byoc_secret_key = var.automq_byoc_secret_key
}

variable "automq_byoc_endpoint" {
type = string
}

variable "automq_byoc_access_key_id" {
type = string
}

variable "automq_byoc_secret_key" {
type = string
}

variable "automq_environment_id" {
type = string
}
Loading

0 comments on commit 9bda22d

Please sign in to comment.