Skip to content

Commit 82d7a72

Browse files
authored
fix: support for cloud monitoring in Montreal (#706) <br> - configure IBM Cloud Monitoring in Montreal (ca-mon) by using the cloud_services input sysdig-monitor
1 parent d393b85 commit 82d7a72

File tree

16 files changed

+178
-10
lines changed

16 files changed

+178
-10
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ An IBM Provider [issue](https://github.com/IBM-Cloud/terraform-provider-ibm/issu
2828
* [Basic multi-tenant VPE gateway](./examples/basic)
2929
* [Every supported multi-tenant ("provider_cloud_service") VPE gateway](./examples/every-multi-tenant-svc)
3030
* [Existing Reserved IPs example](./examples/reserved-ips)
31+
* [Multi-tenant IBM Cloud Monitoring in Montreal VPE gateway](./examples/montreal-monitoring)
3132
* [Contributing](#contributing)
3233
<!-- END OVERVIEW HOOK -->
3334

examples/advanced/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ module "vpes" {
101101
]
102102
service_endpoints = var.service_endpoints
103103
#vpe_names = local.vpe_names
104-
# See comments below (resource "time_sleep" "sleep_time") for explaination on why this is needed.
104+
# See comments below (resource "time_sleep" "sleep_time") for explanation on why this is needed.
105105
depends_on = [time_sleep.sleep_time]
106106
}
107107

108108
## This sleep serve two purposes:
109-
# 1. Give some extra time after postgresql db creation, and before creating the VPE targetting it. This works around the error "Service does not support VPE extensions."
109+
# 1. Give some extra time after postgresql db creation, and before creating the VPE targeting it. This works around the error "Service does not support VPE extensions."
110110
# 2. Give time on deletion between the VPE destruction and the destruction of the SG that is attached to the VPE. This works around the error "Target not found"
111111
resource "time_sleep" "sleep_time" {
112112
depends_on = [module.vpe_security_group.security_group_id, module.postgresql_db]

examples/advanced/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ terraform {
99
required_providers {
1010
ibm = {
1111
source = "IBM-Cloud/ibm"
12-
# pin above lowest vesion, required for postgresql and IAM auth policy
12+
# pin above lowest version, required for postgresql and IAM auth policy
1313
version = ">=1.81.1"
1414
}
1515
time = {

examples/basic/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ terraform {
99
required_providers {
1010
ibm = {
1111
source = "IBM-Cloud/ibm"
12-
# pin to lowest vesion, required for IAM auth policy
12+
# pin to lowest version, required for IAM auth policy
1313
version = "1.81.1"
1414
}
1515
}

examples/every-multi-tenant-svc/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ terraform {
99
required_providers {
1010
ibm = {
1111
source = "IBM-Cloud/ibm"
12-
# pin to lowest vesion, required for IAM auth policy
12+
# pin to lowest version, required for IAM auth policy
1313
version = "1.81.1"
1414
}
1515
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Multi-tenant IBM Cloud Monitoring in Montreal VPE gateway
2+
3+
This example creates the following infrastructure:
4+
- A resource group, if one is not passed in.
5+
- A VPC
6+
- The VPC is created with three subnets across the three availability zones of the region that is passed as input.
7+
- A virtual private endpoint (VPE) gateways for a couple of the multitenant services
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
##############################################################################
2+
# Resource Group
3+
##############################################################################
4+
module "resource_group" {
5+
source = "terraform-ibm-modules/resource-group/ibm"
6+
version = "1.3.0"
7+
# if an existing resource group is not set (null) create a new one using prefix
8+
resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null
9+
existing_resource_group_name = var.resource_group
10+
}
11+
12+
##############################################################################
13+
# Create a VPC for this example using defaults from terraform-ibm-landing-zone-vpc
14+
# ( 3 subnets across the 3 AZs in the region )
15+
##############################################################################
16+
17+
module "vpc" {
18+
source = "terraform-ibm-modules/landing-zone-vpc/ibm"
19+
version = "8.3.0"
20+
resource_group_id = module.resource_group.resource_group_id
21+
region = var.region
22+
prefix = var.prefix
23+
name = "vpc"
24+
tags = var.resource_tags
25+
}
26+
27+
##############################################################################
28+
# Create every multi-tenant VPEs in the VPC
29+
# NOTE: forcing a shorter VPE name for some services due to length limitations
30+
# on VPE service side
31+
##############################################################################
32+
module "vpes" {
33+
source = "../../"
34+
region = var.region
35+
prefix = var.prefix
36+
vpc_name = module.vpc.vpc_name
37+
vpc_id = module.vpc.vpc_id
38+
subnet_zone_list = module.vpc.subnet_zone_list
39+
resource_group_id = module.resource_group.resource_group_id
40+
cloud_services = [
41+
{
42+
service_name = "cloud-object-storage"
43+
},
44+
{
45+
service_name = "sysdig-monitor"
46+
}
47+
]
48+
}
49+
50+
51+
##############################################################################
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "vpe_ips" {
2+
description = "The endpoint gateway reserved ips"
3+
value = module.vpes.vpe_ips
4+
}
5+
6+
output "crn" {
7+
description = "The CRN of the endpoint gateway"
8+
value = module.vpes.crn
9+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
provider "ibm" {
2+
ibmcloud_api_key = var.ibmcloud_api_key
3+
region = var.region
4+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
variable "ibmcloud_api_key" {
2+
type = string
3+
description = "The IBM Cloud API Key"
4+
sensitive = true
5+
}
6+
7+
variable "region" {
8+
description = "The region where VPC and services are deployed"
9+
type = string
10+
default = "ca-mon"
11+
12+
validation {
13+
condition = var.region == "ca-mon"
14+
error_message = "This code only runs in Montreal, set `region` to `ca-mon`"
15+
}
16+
}
17+
18+
variable "prefix" {
19+
description = "The prefix that you would like to append to your resources"
20+
type = string
21+
}
22+
23+
variable "resource_group" {
24+
type = string
25+
description = "An existing resource group name to use for this example, if unset a new resource group will be created"
26+
default = null
27+
}
28+
29+
variable "resource_tags" {
30+
type = list(string)
31+
description = "Optional list of tags to be added to created resources"
32+
default = []
33+
}

0 commit comments

Comments
 (0)