-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new service Logs Router to IBM Terraform Provider (#4945)
* Added new service Logs Router to IBM Terraform Provider * Ran detect-secrets and re-generated secrets.baseline * Added emptycredentialsError check for Logs Router Client Error Signed-off-by: Ian Reyes <[email protected]> * Removed redundant general provider set up information. Fixed Service Subcategories Signed-off-by: Ian Reyes <[email protected]> --------- Signed-off-by: Ian Reyes <[email protected]>
- Loading branch information
Showing
18 changed files
with
881 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Example for IBM Logs Router V1 | ||
|
||
This example illustrates how to use IBM LogsRouterV1 | ||
|
||
The following types of resources are supported: | ||
|
||
* logs_router_tenant | ||
|
||
## Usage | ||
|
||
To run this example, execute the following commands: | ||
|
||
```bash | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` | ||
|
||
Run `terraform destroy` when you don't need these resources. | ||
|
||
|
||
## IbmLogsRouterV1 resources | ||
|
||
logs_router_tenant resource: | ||
|
||
```hcl | ||
resource "logs_router_tenant" "logs_router_tenant_instance" { | ||
target_type = var.logs_router_tenant_target_type | ||
target_host = var.logs_router_tenant_target_host | ||
target_port = var.logs_router_tenant_target_port | ||
target_instance_crn = var.logs_router_tenant_target_instance_crn | ||
} | ||
``` | ||
|
||
## IbmLogsRouterV1 data sources | ||
|
||
logs_router_tenant data source: | ||
|
||
```hcl | ||
data "logs_router_tenant" "logs_router_tenant_instance" { | ||
tenant_id = ibm_logs_router_tenant.logs_router_tenant_instance.id | ||
} | ||
``` | ||
|
||
## Assumptions | ||
|
||
1. TODO | ||
|
||
## Notes | ||
|
||
1. TODO | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| terraform | ~> 0.12 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| ibm | 1.13.1 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Required | | ||
|------|-------------|------|---------| | ||
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true | | ||
| target_type | Type of log-sink. | `string` | true | | ||
| target_host | Host name of log-sink. | `string` | true | | ||
| target_port | Network port of log sink. | `number` | true | | ||
| target_instance_crn | Cloud resource name of the log-sink target instance. | `string` | true | | ||
| tenant_id | The instance ID of the tenant. | `` | true | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| logs_router_tenant | logs_router_tenant object | | ||
| logs_router_tenant | logs_router_tenant object | |
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,17 @@ | ||
provider "ibm" { | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
} | ||
|
||
// Provision logs_router_tenant resource instance | ||
resource "ibm_logs_router_tenant" "logs_router_tenant_instance" { | ||
target_type = var.logs_router_tenant_target_type | ||
target_host = var.logs_router_tenant_target_host | ||
target_port = var.logs_router_tenant_target_port | ||
target_instance_crn = var.logs_router_tenant_target_instance_crn | ||
} | ||
|
||
// Create logs_router_tenant data source | ||
data "ibm_logs_router_tenant" "logs_router_tenant_instance" { | ||
tenant_id = ibm_logs_router_tenant.logs_router_tenant_instance.id | ||
} | ||
|
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,6 @@ | ||
// This output allows logs_router_tenant data to be referenced by other resources and the terraform CLI | ||
// Modify this output if only certain data should be exposed | ||
output "ibm_logs_router_tenant" { | ||
value = ibm_logs_router_tenant.logs_router_tenant_instance | ||
description = "logs_router_tenant resource instance" | ||
} |
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,33 @@ | ||
variable "ibmcloud_api_key" { | ||
description = "IBM Cloud API key" | ||
type = string | ||
} | ||
|
||
// Resource arguments for logs_router_tenant | ||
variable "logs_router_tenant_target_type" { | ||
description = "Type of log-sink." | ||
type = string | ||
default = "logdna" | ||
} | ||
variable "logs_router_tenant_target_host" { | ||
description = "Host name of log-sink." | ||
type = string | ||
default = "www.example.com" | ||
} | ||
variable "logs_router_tenant_target_port" { | ||
description = "Network port of log sink." | ||
type = number | ||
default = 10 | ||
} | ||
variable "logs_router_tenant_target_instance_crn" { | ||
description = "Cloud resource name of the log-sink target instance." | ||
type = string | ||
default = "crn:v1:bluemix:public:logdna:us-east:a/36ff82794a734d7580b90c97b0327d28:f08aea7c-dde9-4452-b552-225af4b51eaa::" | ||
} | ||
|
||
// Data source arguments for logs_router_tenant | ||
variable "logs_router_tenant_tenant_id" { | ||
description = "The instance ID of the tenant." | ||
type = string | ||
default = "f3a466c9-c4db-4eee-95cc-ba82db58e2b5" | ||
} |
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,9 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
required_providers { | ||
ibm = { | ||
source = "IBM-Cloud/ibm" | ||
version = "1.52.0-beta0" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Terraform IBM Provider | ||
<!-- markdownlint-disable MD026 --> | ||
This area is primarily for IBM provider contributors and maintainers. For information on _using_ Terraform and the IBM provider, see the links below. | ||
|
||
|
||
## Handy Links | ||
* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider! | ||
* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs) | ||
* IBM Provider Docs: [One of the resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/logs_router_tenant) | ||
* IBM API Docs: [IBM API Docs for IBM Cloud Logs Router](https://test.cloud.ibm.com/apidocs/logs-router-service-api) | ||
* IBM SDK: [IBM SDK for IBM Cloud Logs Router](https://github.com/IBM/logs-router-go-sdk) |
Oops, something went wrong.