Skip to content

Commit 8d97461

Browse files
authored
feat: initial release (#17)
1 parent c64af40 commit 8d97461

17 files changed

+723
-253
lines changed

.github/CODEOWNERS

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Primary owner should be listed first in list of global owners, followed by any secondary owners
2-
* @ocofaigh @daniel-butler-irl
2+
3+
* @iamar7 @shemau

.github/settings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repository:
2222

2323
# Uncomment this description property
2424
# and update the description to the current repo description.
25-
# description: ""
25+
description: "This module supports provisioning an IBM Cloud Activity Tracker Event Routing target & routes"
2626

2727
# Use a comma-separated list of topics to set on the repo (ensure not to use any caps in the topic string).
2828
topics: terraform, ibm-cloud, terraform-module, core-team, activity-tracker, event-routing, at, observability

.secrets.baseline

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2024-11-22T17:36:38Z",
6+
"generated_at": "2025-04-17T11:02:06Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,7 +82,7 @@
8282
"hashed_secret": "ff9ee043d85595eb255c05dfe32ece02a53efbb2",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 74,
85+
"line_number": 54,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
}

README.md

+78-46
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
1-
<!-- Update this title with a descriptive name. Use sentence case. -->
2-
# Terraform modules template project
1+
# IBM Cloud Activity Tracker Event Routing
32

4-
<!--
5-
Update status and "latest release" badges:
6-
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
7-
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
8-
-->
9-
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
10-
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-activity-tracker?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-activity-tracker/releases/latest)
3+
[![Graduated (Supported)](https://img.shields.io/badge/Status-Graduated%20(Supported)-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
4+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
115
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
6+
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-activity-tracker?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-activity-tracker/releases/latest)
127
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
13-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
148

15-
<!--
16-
Add a description of modules in this repo.
17-
Expand on the repo short description in the .github/settings.yml file.
18-
19-
For information, see "Module names and descriptions" at
20-
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=module-names-and-descriptions
21-
-->
9+
This module supports configuring an IBM Cloud Activity Tracker event routing target, routes and settings.
2210

23-
TODO: Replace this with a description of the modules in this repo.
24-
25-
26-
<!-- The following content is automatically populated by the pre-commit hook -->
2711
<!-- BEGIN OVERVIEW HOOK -->
2812
## Overview
2913
* [terraform-ibm-activity-tracker](#terraform-ibm-activity-tracker)
@@ -33,7 +17,6 @@ TODO: Replace this with a description of the modules in this repo.
3317
* [Contributing](#contributing)
3418
<!-- END OVERVIEW HOOK -->
3519

36-
3720
<!--
3821
If this repo contains any reference architectures, uncomment the heading below and link to them.
3922
(Usually in the `/reference-architectures` directory.)
@@ -42,19 +25,11 @@ https://terraform-ibm-modules.github.io/documentation/#/implementation-guideline
4225
-->
4326
<!-- ## Reference architectures -->
4427

45-
4628
<!-- Replace this heading with the name of the root level module (the repo name) -->
4729
## terraform-ibm-activity-tracker
4830

4931
### Usage
5032

51-
<!--
52-
Add an example of the use of the module in the following code block.
53-
54-
Use real values instead of "var.<var_name>" or other placeholder values
55-
unless real values don't help users know what to change.
56-
-->
57-
5833
```hcl
5934
terraform {
6035
required_version = ">= 1.9.0"
@@ -68,19 +43,65 @@ terraform {
6843
6944
locals {
7045
region = "us-south"
46+
target_ids = [
47+
module.activity_tracker.activity_tracker_targets["icl-target"].id,
48+
module.activity_tracker.activity_tracker_targets["cos-target"].id,
49+
module.activity_tracker.activity_tracker_targets["es-target"].id
50+
]
7151
}
7252
7353
provider "ibm" {
7454
ibmcloud_api_key = "XXXXXXXXXX" # replace with apikey value
7555
region = local.region
7656
}
7757
78-
module "module_template" {
79-
source = "terraform-ibm-modules/<replace>/ibm"
58+
module "activity_tracker" {
59+
source = "terraform-ibm-modules/activity-tracker/ibm"
8060
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
81-
region = local.region
82-
name = "instance-name"
83-
resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX" # Replace with the actual ID of resource group to use
61+
62+
# Cloud Logs target
63+
cloud_logs_targets = [
64+
{
65+
instance_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
66+
target_region = local.region
67+
target_name = "icl-target"
68+
}
69+
]
70+
71+
# COS target
72+
cos_targets = [
73+
{
74+
bucket_name = "cos-bucket"
75+
endpoint = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
76+
instance_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
77+
target_region = local.region
78+
target_name = "cos-target"
79+
skip_atracker_cos_iam_auth_policy = false
80+
service_to_service_enabled = true
81+
}
82+
]
83+
84+
# Event Stream target
85+
eventstreams_targets = [
86+
{
87+
instance_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
88+
brokers = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
89+
topic = "es-topic"
90+
target_region = local.region
91+
target_name = "es-target"
92+
service_to_service_enabled = true
93+
skip_atracker_es_iam_auth_policy = false
94+
}
95+
]
96+
97+
# AT Event routing route
98+
activity_tracker_routes = [
99+
{
100+
locations = ["*", "global"]
101+
target_ids = local.target_ids
102+
route_name = "at-route"
103+
}
104+
]
84105
}
85106
```
86107

@@ -115,15 +136,15 @@ statement instead the previous block.
115136

116137
<!-- No permissions are needed to run this module.-->
117138

118-
119139
<!-- The following content is automatically populated by the pre-commit hook -->
120140
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
121141
### Requirements
122142

123143
| Name | Version |
124144
|------|---------|
125145
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
126-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.71.2, < 2.0.0 |
146+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.76.0, < 2.0.0 |
147+
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |
127148

128149
### Modules
129150

@@ -133,25 +154,36 @@ No modules.
133154

134155
| Name | Type |
135156
|------|------|
136-
| [ibm_resource_instance.cos_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
157+
| [ibm_atracker_route.atracker_routes](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/atracker_route) | resource |
158+
| [ibm_atracker_settings.atracker_settings](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/atracker_settings) | resource |
159+
| [ibm_atracker_target.atracker_cloud_logs_targets](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/atracker_target) | resource |
160+
| [ibm_atracker_target.atracker_cos_targets](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/atracker_target) | resource |
161+
| [ibm_atracker_target.atracker_eventstreams_targets](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/atracker_target) | resource |
162+
| [ibm_iam_authorization_policy.atracker_cloud_logs](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
163+
| [ibm_iam_authorization_policy.atracker_cos](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
164+
| [ibm_iam_authorization_policy.atracker_es](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
165+
| [time_sleep.wait_for_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
166+
| [time_sleep.wait_for_cloud_logs_auth_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
167+
| [time_sleep.wait_for_event_stream_auth_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
168+
| [ibm_iam_account_settings.iam_account_settings](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/iam_account_settings) | data source |
137169

138170
### Inputs
139171

140172
| Name | Description | Type | Default | Required |
141173
|------|-------------|------|---------|:--------:|
142-
| <a name="input_name"></a> [name](#input\_name) | A descriptive name used to identify the resource instance. | `string` | n/a | yes |
143-
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the plan type supported by service. | `string` | `"standard"` | no |
144-
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The ID of the resource group where you want to create the service. | `string` | n/a | yes |
145-
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | List of resource tag to associate with the instance. | `list(string)` | `[]` | no |
174+
| <a name="input_activity_tracker_routes"></a> [activity\_tracker\_routes](#input\_activity\_tracker\_routes) | List of routes to be created, maximum four routes are allowed | <pre>list(object({<br/> locations = list(string)<br/> target_ids = list(string)<br/> route_name = string<br/> }))</pre> | `[]` | no |
175+
| <a name="input_cloud_logs_targets"></a> [cloud\_logs\_targets](#input\_cloud\_logs\_targets) | List of Cloud Logs targets to be created | <pre>list(object({<br/> instance_id = string<br/> target_region = optional(string)<br/> target_name = string<br/> skip_atracker_cloud_logs_iam_auth_policy = optional(bool, false)<br/> }))</pre> | `[]` | no |
176+
| <a name="input_cos_targets"></a> [cos\_targets](#input\_cos\_targets) | List of Cloud Object Storage targets to be created | <pre>list(object({<br/> endpoint = string<br/> bucket_name = string<br/> instance_id = string<br/> api_key = optional(string)<br/> service_to_service_enabled = optional(bool, true)<br/> target_region = optional(string)<br/> target_name = string<br/> skip_atracker_cos_iam_auth_policy = optional(bool, false)<br/> }))</pre> | `[]` | no |
177+
| <a name="input_eventstreams_targets"></a> [eventstreams\_targets](#input\_eventstreams\_targets) | List of Event Streams targets to be created | <pre>list(object({<br/> instance_id = string<br/> brokers = list(string)<br/> topic = string<br/> api_key = optional(string)<br/> service_to_service_enabled = optional(bool, true)<br/> target_region = optional(string)<br/> target_name = string<br/> skip_atracker_es_iam_auth_policy = optional(bool, false)<br/> }))</pre> | `[]` | no |
178+
| <a name="input_global_event_routing_settings"></a> [global\_event\_routing\_settings](#input\_global\_event\_routing\_settings) | Global account settings for event routing. [Learn more](https://cloud.ibm.com/docs/atracker?topic=atracker-settings&interface=ui) | <pre>object({<br/> default_targets = optional(list(string), [])<br/> metadata_region_primary = string<br/> metadata_region_backup = optional(string)<br/> permitted_target_regions = list(string)<br/> private_api_endpoint_only = optional(bool, false)<br/> })</pre> | `null` | no |
146179

147180
### Outputs
148181

149182
| Name | Description |
150183
|------|-------------|
151-
| <a name="output_account_id"></a> [account\_id](#output\_account\_id) | An alpha-numeric value identifying the account ID. |
152-
| <a name="output_crn"></a> [crn](#output\_crn) | The CRN of the resource instance. |
153-
| <a name="output_guid"></a> [guid](#output\_guid) | The GUID of the resource instance. |
154-
| <a name="output_id"></a> [id](#output\_id) | The unique identifier of the resource instance. |
184+
| <a name="output_activity_tracker_routes"></a> [activity\_tracker\_routes](#output\_activity\_tracker\_routes) | The map of created routes |
185+
| <a name="output_activity_tracker_settings"></a> [activity\_tracker\_settings](#output\_activity\_tracker\_settings) | AT event routing account global settings. |
186+
| <a name="output_activity_tracker_targets"></a> [activity\_tracker\_targets](#output\_activity\_tracker\_targets) | The map of created targets |
155187
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
156188

157189
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->

0 commit comments

Comments
 (0)