generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Migration of cloud monitoring from observability-instances #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e03b66c
migrate cloud monitoring from observability
ebf0706
update test and codeowner
f1984eb
update code
1a92ab1
Merge branch 'main' into 12594-cm
iamar7 1d5d5ee
add metrics router support
96e15d5
Merge branch '12594-cm' of https://github.com/terraform-ibm-modules/t…
b5d9f0c
resolves pc
iamar7 8902557
SKIP UPGRADE TEST
iamar7 bfa774a
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
iamar7 04834b5
remove cloud monitoring provision variable
8ba57ff
remove cloud monitoring provision
9d376c2
resolves pc
iamar7 e87953a
resolve comments
85dd8db
Revert "resolves pc"
1eedbca
revert changes
32cce9e
resolve comments
ca432fd
update readme
iamar7 688d7da
resolve comments
19e617a
resolve pc
1de2db4
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
1af430b
remove common-dev
104efe0
resolve pc
iamar7 71c6668
resolve comments
1c89618
resolve pc
03452c4
update cdev asset
803fd13
remove cdev
51cf35f
Merge branch 'main' into 12594-cm
iamar7 8e722f1
update readme
iamar7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| # Primary owner should be listed first in list of global owners, followed by any secondary owners | ||
| * @ocofaigh @daniel-butler-irl | ||
|
|
||
| * @iamar7 @shemau |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| # Advanced example | ||
|
|
||
| <!-- There is a pre-commit hook that will take the title of each example add include it in the repos main README.md --> | ||
| <!-- Add text below should describe exactly what resources are provisioned / configured by the example --> | ||
| Example that configures: | ||
|
|
||
| - IBM Cloud Monitoring instance | ||
| - IBM Cloud Metrics Routing |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| ######################################################################################################################## | ||
| # Resource group | ||
| ######################################################################################################################## | ||
| ############################################################################## | ||
| # Resource Group | ||
| ############################################################################## | ||
|
|
||
| module "resource_group" { | ||
| source = "terraform-ibm-modules/resource-group/ibm" | ||
|
|
@@ -10,23 +10,71 @@ module "resource_group" { | |
| existing_resource_group_name = var.resource_group | ||
| } | ||
|
|
||
| ######################################################################################################################## | ||
| # COS | ||
| ######################################################################################################################## | ||
|
|
||
| # | ||
| # Developer tips: | ||
| # - Call the local module / modules in the example to show how they can be consumed | ||
| # - Include the actual module source as a code comment like below so consumers know how to consume from correct location | ||
| # | ||
|
|
||
| module "cos" { | ||
| source = "../.." | ||
| # remove the above line and uncomment the below 2 lines to consume the module from the registry | ||
| # source = "terraform-ibm-modules/<replace>/ibm" | ||
| # version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release | ||
| name = "${var.prefix}-cos" | ||
| ############################################################################## | ||
| # Cloud Monitoring | ||
| ############################################################################## | ||
|
|
||
| locals { | ||
| cloud_monitoring_instance_name = "${var.prefix}-cloud-monitoring" | ||
| metrics_router_target_name = "${var.prefix}-cloud-monitoring-target" | ||
| } | ||
|
|
||
| module "cloud_monitoring" { | ||
| source = "../../" | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| region = var.region | ||
| resource_tags = var.resource_tags | ||
| plan = "cos-one-rate-plan" | ||
| access_tags = var.access_tags | ||
| plan = "graduated-tier" | ||
| instance_name = local.cloud_monitoring_instance_name | ||
| } | ||
|
|
||
| ############################################################################## | ||
| # IBM Cloud Metrics Routing | ||
| # - Cloud Monitoring target | ||
| # - Metrics Router route to the target | ||
|
||
| ############################################################################## | ||
|
|
||
| module "metrics_routing" { | ||
| source = "../../modules/metrics_routing" | ||
|
|
||
| metrics_router_targets = [ | ||
| { | ||
| destination_crn = module.cloud_monitoring.crn | ||
| target_name = local.metrics_router_target_name | ||
| target_region = var.region | ||
| } | ||
| ] | ||
|
|
||
| metrics_router_routes = [ | ||
| { | ||
| name = "${var.prefix}-metric-routing-route" | ||
| rules = [ | ||
| { | ||
| action = "send" | ||
| targets = [{ | ||
| id = module.metrics_routing.metrics_router_targets[local.metrics_router_target_name].id | ||
| }] | ||
| inclusion_filters = [{ | ||
| operand = "location" | ||
| operator = "is" | ||
| values = ["us-south"] | ||
| }] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
|
|
||
| ############################################################################## | ||
| # - Global Metrics Routing configuration | ||
| ############################################################################## | ||
|
|
||
| metrics_router_settings = { | ||
| default_targets = [{ | ||
| id = module.metrics_routing.metrics_router_targets[local.metrics_router_target_name].id | ||
| }] | ||
| permitted_target_regions = ["us-south", "eu-de", "us-east", "eu-es", "eu-gb", "au-syd", "br-sao", "ca-tor", "jp-tok", "jp-osa"] | ||
| primary_metadata_region = var.region | ||
| private_api_endpoint_only = false | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the usage is showing metrics config too. I would suggest to just remove the sentence and use code comments in the example tf code itself to explain the usage