generated from hashicorp/terraform-provider-scaffolding-framework
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shawn Castrianni
authored and
Shawn Castrianni
committed
Jun 7, 2023
1 parent
5a6b851
commit 8addd77
Showing
13 changed files
with
349 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
subcategory: "Runtime Configuration" | ||
--- | ||
# Resource: konnect_service | ||
Represents a service within a runtime group | ||
## Example usage | ||
```hcl | ||
data "konnect_runtime_group" "RuntimeGroup" { | ||
name = "TestRuntimeGroup" | ||
} | ||
resource "konnect_service" "example" { | ||
runtime_group_id = data.konnect_runtime_group.RuntimeGroup.id | ||
host = "mockbin.org" | ||
name = "Test" | ||
} | ||
``` | ||
## Argument Reference | ||
* `runtime_group_id` - **(Required, String)** The id of the runtime group. | ||
* `host` - **(Required, String)** The host of the service. | ||
* `name` - **(Optional, String)** The name of the service. | ||
* `retries` - **(Optional, Integer)** The number of retries to execute upon failure to proxy. Default: `5` | ||
* `protocol` - **(Optional, String)** The protocol used to communicate with the host. Allowed values: `grpc`, `grpcs`, `http`, `https`, `tcp`, `tls`, `tls_passthrough`, `udp`, `ws`, `wss` | ||
* `port` - **(Optional, Integer)** The port used to communicate with the host. Default: `80` | ||
* `path` - **(Optional, String)** The path to be used in requests to the host. | ||
* `connect_timeout` - **(Optional, Integer)** The timeout in milliseconds for establishing a connection to the host. Default: `60000` | ||
* `read_timeout` - **(Optional, Integer)** The timeout in milliseconds between two successive read operations for transmitting a request to the host. Default: `60000` | ||
* `write_timeout` - **(Optional, Integer)** The timeout in milliseconds between two successive write operations for transmitting a request to the host. Default: `60000` | ||
* `enabled` - **(Optional, Boolean)** Whether the Service is active. Default: `true` | ||
## Attribute Reference | ||
* `id` - **(String)** Same as `runtime_group_id`:`id` | ||
## Import | ||
Services can be imported using a proper value of `id` as described above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package client | ||
|
||
import "strings" | ||
|
||
const ( | ||
ServicePath = RuntimeGroupPathGet + "/core-entities/services" | ||
ServicePathGet = ServicePath + "/%s" | ||
) | ||
|
||
type Service struct { | ||
RuntimeGroupId string `json:"-"` | ||
Id string `json:"id"` | ||
Name string `json:"name"` | ||
Retries int `json:"retries"` | ||
Protocol string `json:"protocol"` | ||
Host string `json:"host"` | ||
Port int `json:"port"` | ||
Path string `json:"path"` | ||
ConnectTimeout int `json:"connect_timeout"` | ||
ReadTimeout int `json:"read_timeout"` | ||
WriteTimeout int `json:"write_timeout"` | ||
Enabled bool `json:"enabled"` | ||
} | ||
type ServiceCollection struct { | ||
Services []Service `json:"data"` | ||
} | ||
|
||
func (s *Service) ServiceEncodeId() string { | ||
return s.RuntimeGroupId + IdSeparator + s.Id | ||
} | ||
|
||
func ServiceDecodeId(s string) (string, string) { | ||
tokens := strings.Split(s, IdSeparator) | ||
return tokens[0], tokens[1] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.