Skip to content

Commit

Permalink
Added new service Metrics Router to terraform repo (#4337)
Browse files Browse the repository at this point in the history
* Added new service Metrics Router to repo

* Updated secret baseline file

* Updated baseline file with is_secret

* Changed sdk repo path

* Fixed a couple typos

Found a couple typos when I was deploying a cluster. This should fix it.

* Updates to tekton-pipeline support (#4235)

* fix(tekton): pos-GA updates

* chore(tekton): update Go SDK version

* fix(tekton): finalise tekton updates

Signed-off-by: Brian Gleeson <[email protected]>

* fix(tekton): Address Worker and href feedback

Signed-off-by: Brian Gleeson <[email protected]>

* add ForceNew tag to OS fields (#4279)

* add ForceNew tag to OS fileds, updated doc

* add forces new resource tag to the doc

Co-authored-by: Zoltan Illes <[email protected]>

* warning state in pending list, WARN logs about warning and critical s… (#4283)

* warning state in pending list, WARN logs about warning and critical states

* added extra clarification in docs about wait_till Normal option

* Continuous Delivery - Git PAT support (#4276)

* Git PAT support

* Fix example

* vpc address prefix and subnet doc fix

* Fix #4132: fix values_metadata argument in schematics resource

* enhancement(vpc-go-sdk) : Migration to latest 0.30.0

* fix(networkacl) : made name optional to allow create_before_destroy

* Remove certificate manager service support

* Fix ibm_appid_cloud_directory_user missing userName

* update provider metadata

* update CHANGELOG

* Bump up version to 1.50.0-beta0

* add optional secondary storage fields to IKS cluster and workerpool (#4255)

* add user defined secondary storage support to vpc cluster and workerpool

* tc fix for non secondarystorage case

* update docs and descriptions

* remove userdefined string, count and size is now integer in secondarystorage schema

* update docs

Co-authored-by: Zoltan Illes <[email protected]>

* CD: Field description updates for PAT

* refactor(Cloud Databases) autoscaling uses cloud-databases-go-sdk  (#4218)

* fix: documentation fix for ibm_cm_object resource

* dependabot: bump github/issue-labeler from 2.5 to 2.6

Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 2.5 to 2.6.
- [Release notes](https://github.com/github/issue-labeler/releases)
- [Commits](github/issue-labeler@v2.5...v2.6)

---
updated-dependencies:
- dependency-name: github/issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(tekton): bump Tekton Go SDK version

* dependabot: bump actions/checkout from 3.2.0 to 3.3.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* update tags from globaltags to search API

* update metadata

* update CHANGELOG

* Bump up version to 1.50.0

* Adding new destination , integration and updating subscription resources for event notifications (#4321)

* adding new destination, updating email subscription and integrayion resources for event notification service

* Update go.mod

updating event notification package

* Update go.sum

updating event-notifications entry in go.sum

* Deprecate: retain schema and remove code

* Remove deprecated resource notification for VPC route resource (#4323)

* removal notification for vpc route

* updated the release number:

v1.51.0  - removal notification
v1.52.0 - resource is removed

* Single node infrastructure added (#4269)

* Single node infrastructure added

* Variable fix

* single-node code added

* Empty-Commit to run tests with updated sdk.

* Updated sdk version

* Added code for data recource

* Added documentation

* Added documentation

* Corrected typo

* Added test case for new variable

* Removed single-node resource. Added single-node parameters to existing create cluster resource.

* Changes reflecting PR comments.

* Added test case for single node clusters. Updated variables.

* Updated version

* fix: allow data to be set/updated when already unquoted

* refactor(Cloud Databases): configuration uses cloud-databases-go-sdk (#4234)

* refactor(Cloud Databases): configuration uses cloud-databases-go-sdk
* address PR comments
* remove unused bluemix client

* Adopted new API changes

* updated .secrets.baseline

* fix formating provider.go

* Corrected the testing target CRN

* Modified the input table of content in README

* Added more examples

* minor changes in service names

* Picking mr gosdk from master

* Added info on settings id

* fixing issues

* Fix removal of permitted_target_regions

* Fix crashing issue due to empty targets

* Added info on first time setting of primary_metadata_region

* Added changes as per comments

---------

Signed-off-by: Brian Gleeson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: ElliotG <[email protected]>
Co-authored-by: Brian Gleeson <[email protected]>
Co-authored-by: Zoltán Illés <[email protected]>
Co-authored-by: Zoltan Illes <[email protected]>
Co-authored-by: attilatabori <[email protected]>
Co-authored-by: gmarjoram <[email protected]>
Co-authored-by: Deepak Selvakumar <[email protected]>
Co-authored-by: hkavya26 <[email protected]>
Co-authored-by: Ujjwal Kumar <[email protected]>
Co-authored-by: hkantare <[email protected]>
Co-authored-by: alex hemard <[email protected]>
Co-authored-by: Ben Buchanan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Divya-Singh1693 <[email protected]>
Co-authored-by: Sandeep S <[email protected]>
Co-authored-by: Bhavesh Shrivastav <[email protected]>
Co-authored-by: Carl Petersson <[email protected]>
  • Loading branch information
18 people authored Jun 15, 2023
1 parent a50a192 commit b5f08f5
Show file tree
Hide file tree
Showing 29 changed files with 3,195 additions and 3 deletions.
72 changes: 72 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -4691,6 +4691,78 @@
"verified_result": null
}
],
"website/docs/r/project_instance.html.markdown": [
{
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 134,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 136,
"type": "Secret Keyword",
"verified_result": null
}
],
"website/docs/r/metrics_router_route.html.markdown": [
{
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 99,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 101,
"type": "Secret Keyword",
"verified_result": null
}
],
"website/docs/r/metrics_router_settings.html.markdown": [
{
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 82,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 84,
"type": "Secret Keyword",
"verified_result": null
}
],
"website/docs/r/metrics_router_target.html.markdown": [
{
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 77,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 79,
"type": "Secret Keyword",
"verified_result": null
}
],
"website/docs/r/resource_instance.html.markdown": [
{
"hashed_secret": "d62552e3d0606ac398b6ee5cbd49e763ac9c3933",
Expand Down
141 changes: 141 additions & 0 deletions examples/ibm-metrics-router/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Example for IBM Cloud Metrics Routing V3 Example

This example illustrates how to use the MetricsRouterV3

These types of resources are supported:

* metrics_router_target
* metrics_router_route
* metrics_router_settings

## Usage

To run this example you need to execute:

```bash
$ terraform init
$ terraform plan
$ terraform apply
```

Run `terraform destroy` when you don't need these resources.


## MetricsRouterV3 resources

metrics_router_target resource:

```hcl
resource "metrics_router_target" "metrics_router_target_instance" {
name = var.metrics_router_target_name
destination_crn = var.metrics_router_target_destination_crn
region = var.metrics_router_target_region
}
```
metrics_router_route resource:

```hcl
resource "metrics_router_route" "metrics_router_route_instance" {
name = var.metrics_router_route_name
rules = var.metrics_router_route_rules
}
```
metrics_router_settings resource:

```hcl
resource "metrics_router_settings" "metrics_router_settings_instance" {
default_targets = var.metrics_router_settings_default_targets
permitted_target_regions = var.metrics_router_settings_permitted_target_regions
primary_metadata_region = var.metrics_router_settings_primary_metadata_region
backup_metadata_region = var.metrics_router_settings_backup_metadata_region
private_api_endpoint_only = var.metrics_router_settings_private_api_endpoint_only
}
```

## MetricsRouterV3 Data sources

metrics_router_targets data source:

```hcl
data "metrics_router_targets" "metrics_router_targets_instance" {
name = var.metrics_router_targets_name
}
```
metrics_router_routes data source:

```hcl
data "metrics_router_routes" "metrics_router_routes_instance" {
name = var.metrics_router_routes_name
}
```

## Assumptions

1. TODO

## Notes

1. TODO

## Requirements

| Name | Version |
|------|---------|
| terraform | ~> 0.12 |

## Providers

| Name | Version |
|------|---------|
| ibm | 1.13.1 |

## Inputs

### Target

| Name | Description | Type | Required |
|------|-------------|------|---------|
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
| name | The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names. | `string` | true |
| destination_crn | The CRN of the destination resource. Ensure you have a service authorization between IBM Cloud Metrics Routing and your Cloud resource. Read [S2S authorization](https://cloud.ibm.com/docs/metrics-router?topic=metrics-router-target-monitoring&interface=ui#target-monitoring-ui) for details.| `string` | true |
| region | Include this optional field if you want to create a target in a different region other than the one you are connected. | `string` | false |

### Route

| Name | Description | Type | Required |
|------|-------------|------|---------|
| name | The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names. | `string` | true |
| rules | Routing rules that will be evaluated in their order of the array. | `list()` | true |

### Settings

| Name | Description | Type | Required |
|------|-------------|------|---------|
| default_targets | A list of default target references. | `list()` | false |
| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false |
| primary_metadata_region | To store all your meta data in a single region. For new accounts, all target / route creation will fail until primary_metadata_region is set. | `string` | false |
| backup_metadata_region | To backup all your meta data in a different region. | `string` | false |
| private_api_endpoint_only | If you set this true then you cannot access api through public network. | `bool` | false |

### Data Source For Target

| Name | Description | Type | Required |
|------|-------------|------|---------|
| name | The name of the target resource. | `string` | false |

### Data Source For Route

| Name | Description | Type | Required |
|------|-------------|------|---------|
| name | The name of the route. | `string` | false |

## Outputs


| Name | Description |
|------|-------------|
| metrics_router_target | metrics_router_target object |
| metrics_router_route | metrics_router_route object |
| metrics_router_settings | metrics_router_settings object |
| metrics_router_targets | metrics_router_targets object |
| metrics_router_routes | metrics_router_routes object |
55 changes: 55 additions & 0 deletions examples/ibm-metrics-router/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
}

// Provision metrics_router_target resource instance
resource "ibm_metrics_router_target" "metrics_router_target_instance" {
name = var.metrics_router_target_name
destination_crn = var.metrics_router_target_destination_crn
region = var.metrics_router_target_region
}

// Provision metrics_router_route resource instance
resource "ibm_metrics_router_route" "metrics_router_route_instance" {
name = var.metrics_router_route_name
rules {
action = "send"
targets {
id = ibm_metrics_router_target.metrics_router_target_instance.id
}
inclusion_filters {
operand = "location"
operator = "is"
values = [ "us-south" ]
}
}
}

// Provision metrics_router_settings resource instance
resource "ibm_metrics_router_settings" "metrics_router_settings_instance" {
default_targets {
id = ibm_metrics_router_target.metrics_router_target_instance.id
}
permitted_target_regions = var.metrics_router_settings_permitted_target_regions
primary_metadata_region = var.metrics_router_settings_primary_metadata_region
backup_metadata_region = var.metrics_router_settings_backup_metadata_region
private_api_endpoint_only = var.metrics_router_settings_private_api_endpoint_only
}

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create metrics_router_targets data source
data "ibm_metrics_router_targets" "metrics_router_targets_instance" {
name = var.metrics_router_targets_name
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create metrics_router_routes data source
data "ibm_metrics_router_routes" "metrics_router_routes_instance" {
name = var.metrics_router_routes_name
}
*/
18 changes: 18 additions & 0 deletions examples/ibm-metrics-router/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This allows metrics_router_target data to be referenced by other resources and the terraform CLI
// Modify this if only certain data should be exposed
output "ibm_metrics_router_target" {
value = ibm_metrics_router_target.metrics_router_target_instance
description = "metrics_router_target resource instance"
}
// This allows metrics_router_route data to be referenced by other resources and the terraform CLI
// Modify this if only certain data should be exposed
output "ibm_metrics_router_route" {
value = ibm_metrics_router_route.metrics_router_route_instance
description = "metrics_router_route resource instance"
}
// This allows metrics_router_settings data to be referenced by other resources and the terraform CLI
// Modify this if only certain data should be exposed
output "ibm_metrics_router_settings" {
value = ibm_metrics_router_settings.metrics_router_settings_instance
description = "metrics_router_settings resource instance"
}
64 changes: 64 additions & 0 deletions examples/ibm-metrics-router/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
variable "ibmcloud_api_key" {
description = "IBM Cloud API key"
type = string
}

// Resource arguments for metrics_router_target
variable "metrics_router_target_name" {
description = "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names."
type = string
default = "my-mr-target"
}
variable "metrics_router_target_destination_crn" {
description = "The CRN of a destination service instance or resource."
type = string
default = "crn:v1:bluemix:public:sysdig-monitor:us-south:a/0be5ad401ae913d8ff665d92680664ed:22222222-2222-2222-2222-222222222222::"
}
variable "metrics_router_target_region" {
description = "Include this optional field if you want to create a target in a different region other than the one you are connected."
type = string
default = "us-south"
}

// Resource arguments for metrics_router_route
variable "metrics_router_route_name" {
description = "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`. Do not include any personal identifying information (PII) in any resource names."
type = string
default = "my-route"
}

// Resource arguments for metrics_router_settings
variable "metrics_router_settings_permitted_target_regions" {
description = "If present then only these regions may be used to define a target."
type = list(string)
default = [ "us-south" ]
}
variable "metrics_router_settings_primary_metadata_region" {
description = "To store all your meta data in a single region."
type = string
default = "us-south"
}
variable "metrics_router_settings_backup_metadata_region" {
description = "To backup all your meta data in a different region."
type = string
default = "us-east"
}
variable "metrics_router_settings_private_api_endpoint_only" {
description = "If you set this true then you cannot access api through public network."
type = bool
default = false
}

// Data source arguments for metrics_router_targets
variable "metrics_router_targets_name" {
description = "The name of the target resource."
type = string
default = "a-mr-target-us-south"
}

// Data source arguments for metrics_router_routes
variable "metrics_router_routes_name" {
description = "The name of the route."
type = string
default = "my-route"
}
3 changes: 3 additions & 0 deletions examples/ibm-metrics-router/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 0.12"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta
github.com/IBM/keyprotect-go-client v0.10.0
github.com/IBM/networking-go-sdk v0.40.0
github.com/IBM/platform-services-go-sdk v0.37.3
github.com/IBM/platform-services-go-sdk v0.38.1
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/scc-go-sdk/v3 v3.1.6
github.com/IBM/scc-go-sdk/v4 v4.0.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ github.com/IBM/keyprotect-go-client v0.10.0 h1:UdVOwJfyVNmL4O3Aw2eGluiEr5FpV5h8E
github.com/IBM/keyprotect-go-client v0.10.0/go.mod h1:yr8h2noNgU8vcbs+vhqoXp3Lmv73PI0zAc6VMgFvWwM=
github.com/IBM/networking-go-sdk v0.40.0 h1:NdHTG0YXtN2D/B62BRgy6iJRFLdiJtSFCdTzAZB5m5k=
github.com/IBM/networking-go-sdk v0.40.0/go.mod h1:lTUZwtUkMANMnrLHFIgRhHrkBfwASY/Iho1fabaPHxo=
github.com/IBM/platform-services-go-sdk v0.37.3 h1:xPJ7M6F+Qmd+4IOMn2eM/UHy2Y1iHB2jRBrKynJA7QE=
github.com/IBM/platform-services-go-sdk v0.37.3/go.mod h1:oFW/DQyAXGBcGytB+DtKjE3yNdEGM2bmw5SDOjrRwTw=
github.com/IBM/platform-services-go-sdk v0.38.1 h1:wyjn61SLcoCvdRMZu7wZIkScaVswXwjrTl8Gif/uESc=
github.com/IBM/platform-services-go-sdk v0.38.1/go.mod h1:rb1IaHGwT8QI8pCYgNbf2VbkuKMgOowl91pZ2QWZuJ4=
github.com/IBM/project-go-sdk v0.0.10 h1:vHSuemwZ4S4c6BEb22tzsEcPTs/5LnZ0yKpP3GG/GL8=
github.com/IBM/project-go-sdk v0.0.10/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
Expand Down
Loading

0 comments on commit b5f08f5

Please sign in to comment.