Skip to content
Open
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
18 changes: 18 additions & 0 deletions example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,21 @@ resource "tsuru_app_env" "env" {
"ENV3" = "12"
}
}

resource "tsuru_service_broker" "test_broker" {
name = "test_name"
url = "https://broker.example.com"
config {
insecure = false
context = {
test_context_1 = "TEST_CONTEXT_1"
test_context_2 = "TEST_CONTEXT_2"
}
cache_expiration_seconds = 3600
auth_config {
bearer_config {
token = "random token"
}
}
}
}
4 changes: 4 additions & 0 deletions examples/resources/tsuru_service_broker/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
terraform import tsuru_service_broker.test_broker "broker_name"

# example
terraform import tsuru_service_broker.test_broker "test_broker"
38 changes: 38 additions & 0 deletions examples/resources/tsuru_service_broker/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# tsuru service broekr with basic_auth_config
resource "tsuru_service_broker" "test_broker" {
name = "test_name"
url = "https://broker.example.com"
config {
insecure = false
context = {
test_context_1 = "TEST_CONTEXT_1"
test_context_2 = "TEST_CONTEXT_2"
}
cache_expiration_seconds = 3600
auth_config {
basic_auth_config {
username = "TEST_USERNAME"
password = "TEST_PASSWORD"
}
}
}
}

# tsuru service broker with bearer_config
resource "tsuru_service_broker" "test_broker" {
name = "test_name"
url = "https://broker.example.com"
config {
insecure = true
context = {
test_context_1 = "TEST_CONTEXT_1"
test_context_2 = "TEST_CONTEXT_2"
}
cache_expiration_seconds = 3600
auth_config {
bearer_config {
token = "SENSITIVE_TOKEN"
}
}
}
}
2 changes: 2 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func Provider() *schema.Provider {
"tsuru_service_instance_grant": resourceTsuruServiceInstanceGrant(),
"tsuru_service_instance": resourceTsuruServiceInstance(),

"tsuru_service_broker": resourceTsuruServiceBroker(),

"tsuru_volume_bind": resourceTsuruVolumeBind(),
"tsuru_volume": resourceTsuruVolume(),

Expand Down
Loading