diff --git a/Gopkg.lock b/Gopkg.lock index 8ac99343f..cdc73c308 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,11 +2,11 @@ [[projects]] - digest = "1:e7d639ec86898de9f66871353d23d3ffa7a10851c8f482e13e465ba189095863" + digest = "1:6dc488b91a2b40fa969ff8f363995cda842b7bf63b04c5f3d7b5b931e49a4a83" name = "github.com/aiven/aiven-go-client" packages = ["."] pruneopts = "UT" - revision = "ec0871c583db5c4c154c68d814099fedacfc8ba5" + revision = "1229534dc578f64766c377491fd727d08fd95ac5" source = "github.com/aiven/aiven-go-client" [[projects]] diff --git a/Gopkg.toml b/Gopkg.toml index 24418fbe0..74f3ba9fb 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -13,7 +13,7 @@ [[constraint]] name = "github.com/aiven/aiven-go-client" - revision = "ec0871c583db5c4c154c68d814099fedacfc8ba5" + revision = "1229534dc578f64766c377491fd727d08fd95ac5" source = "github.com/aiven/aiven-go-client" [prune] diff --git a/Makefile b/Makefile index 11532f9e6..25183bde1 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,8 @@ update-vendor: ################################################# bins: vendor - packr build -o terraform-provider-aiven . + GOOS=linux GOARCH=amd64 packr build -o terraform-provider-aiven-linux_amd64 . + GOOS=darwin GOARCH=amd64 packr build -o terraform-provider-aiven-darwin_amd64 . ################################################# # Testing and linting diff --git a/resource_service_integration_endpoint.go b/resource_service_integration_endpoint.go index d9ff3f251..be3732110 100644 --- a/resource_service_integration_endpoint.go +++ b/resource_service_integration_endpoint.go @@ -39,6 +39,12 @@ func resourceServiceIntegrationEndpoint() *schema.Resource { Required: true, Type: schema.TypeString, }, + "endpoint_config": { + Description: "Integration endpoint specific backend configuration", + Computed: true, + Type: schema.TypeMap, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "datadog_user_config": { Description: "Datadog specific user configurable settings", Elem: &schema.Resource{ @@ -49,6 +55,16 @@ func resourceServiceIntegrationEndpoint() *schema.Resource { Optional: true, Type: schema.TypeList, }, + "prometheus_user_config": { + Description: "Prometheus specific user configurable settings", + Elem: &schema.Resource{ + Schema: GenerateTerraformUserConfigSchema( + GetUserConfigSchema("endpoint")["prometheus"].(map[string]interface{})), + }, + MaxItems: 1, + Optional: true, + Type: schema.TypeList, + }, }, } } @@ -156,6 +172,14 @@ func copyServiceIntegrationEndpointPropertiesFromAPIResponseToTerraform( if len(userConfig) > 0 { d.Set(endpointType+"_user_config", userConfig) } + // Must coerse all values into strings + endpointConfig := map[string]string{} + if len(endpoint.EndpointConfig) > 0 { + for key, value := range endpoint.EndpointConfig { + endpointConfig[key] = fmt.Sprintf("%v", value) + } + } + d.Set("endpoint_config", endpointConfig) return nil } diff --git a/templates/integration_endpoints_user_config_schema.json b/templates/integration_endpoints_user_config_schema.json index f92e39e20..4fdb296aa 100644 --- a/templates/integration_endpoints_user_config_schema.json +++ b/templates/integration_endpoints_user_config_schema.json @@ -26,5 +26,25 @@ "datadog_api_key" ], "type": "object" + }, + "prometheus": { + "additionalProperties": false, + "properties": { + "basic_auth_password": { + "example": "fhyFNBjj3R", + "maxLength": 64, + "minLength": 8, + "title": "Prometheus basic authentication password", + "type": "string" + }, + "basic_auth_username": { + "example": "prom4851", + "maxLength": 32, + "minLength": 5, + "title": "Prometheus basic authentication username", + "type": "string" + } + }, + "type": "object" } } diff --git a/templates/integrations_user_config_schema.json b/templates/integrations_user_config_schema.json index 71f5f2b66..213691e9a 100644 --- a/templates/integrations_user_config_schema.json +++ b/templates/integrations_user_config_schema.json @@ -49,5 +49,10 @@ } }, "type": "object" + }, + "prometheus": { + "additionalProperties": true, + "title": "Integration user config", + "type": "object" } } diff --git a/templates/service_user_config_schema.json b/templates/service_user_config_schema.json index c481fbefe..a2445b4e0 100644 --- a/templates/service_user_config_schema.json +++ b/templates/service_user_config_schema.json @@ -507,6 +507,38 @@ "title": "Enable Kafka-REST service", "type": "boolean" }, + "kafka_rest_config": { + "additionalProperties": false, + "properties": { + "consumer_request_max_bytes": { + "default": 67108864, + "maximum": 671088640, + "minimum": 0, + "title": "Maximum number of bytes in unencoded message keys and values by a single request", + "type": "integer" + }, + "producer_acks": { + "default": "1", + "enum": [ + "all", + "-1", + "0", + "1" + ], + "title": "The number of acknowledgments the producer requires the leader to have received before considering a request complete. If set to 'all' or '-1', the leader will wait for the full set of in-sync replicas to acknowledge the record.", + "type": "string" + }, + "producer_linger_ms": { + "default": 0, + "maximum": 5000, + "minimum": 0, + "title": "Wait for up to the given delay to allow batching records together", + "type": "integer" + } + }, + "title": "Kafka REST configuration", + "type": "object" + }, "kafka_version": { "enum": [ "1.0", @@ -756,7 +788,8 @@ "9.3", "9.5", "9.6", - "10" + "10", + "11" ], "title": "PostgreSQL major version", "type": [