Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(service): add connection_info field to components #1457

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ nav_order: 1
- Add `emit_backward_heartbeats_enabled` field support in Mirrormaker replication flow
- Add validation for email fields in `account_team_member`, `organization_user` and `project_user` resources to check
if email is lowercase and valid
- Add `connection_info` field to components of all services. This field contains connection information for the
component, and is a combination of the `host` and `port` fields

## [4.9.3] - 2023-10-27

Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Read-Only:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Read-Only:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_flink" "flink" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_grafana" "gr1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_influxdb" "inf1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ data "aiven_kafka" "kafka1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/kafka_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_kafka_connect" "kc1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/kafka_mirrormaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_kafka_mirrormaker" "mm1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/m3aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_m3aggregator" "m3a" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/m3db.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_m3db" "m3" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_mysql" "mysql1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_opensearch" "os1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_pg" "pg" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data "aiven_redis" "redis1" {
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Read-Only:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Read-Only:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/kafka_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/kafka_mirrormaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/m3aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/m3db.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Optional:
Read-Only:

- `component` (String)
- `connection_info` (String)
- `host` (String)
- `kafka_authentication_method` (String)
- `port` (Number)
Expand Down
25 changes: 16 additions & 9 deletions internal/schemautil/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,24 @@ func ServiceCommonSchema() map[string]*schema.Schema {
"host": {
Type: schema.TypeString,
Computed: true,
Description: "DNS name for connecting to the service component",
},
"kafka_authentication_method": {
Type: schema.TypeString,
Computed: true,
Description: "Kafka authentication method. This is a value specific to the 'kafka' service component",
Description: "Host name for connecting to the service component",
},
"port": {
Type: schema.TypeInt,
Computed: true,
Description: "Port number for connecting to the service component",
},
"connection_info": {
Type: schema.TypeString,
Computed: true,
Description: "Connection info for connecting to the service component." +
" This is a combination of host and port.",
},
"kafka_authentication_method": {
Type: schema.TypeString,
Computed: true,
Description: "Kafka authentication method. This is a value specific to the 'kafka' service component",
},
"route": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -744,12 +750,13 @@ func FlattenServiceComponents(r *aiven.Service) []map[string]interface{} {
"component": c.Component,
"host": c.Host,
"port": c.Port,
"route": c.Route,
"usage": c.Usage,
"connection_info": fmt.Sprintf("%s:%d", c.Host, c.Port),
"kafka_authentication_method": c.KafkaAuthenticationMethod,
"route": c.Route,
// By default, endpoints are always encrypted and
// this property is only included for service components that may disable encryption.
"ssl": PointerValueOrDefault(c.Ssl, true),
"ssl": PointerValueOrDefault(c.Ssl, true),
"usage": c.Usage,
}
components = append(components, component)
}
Expand Down