Skip to content

Commit bba151c

Browse files
committed
feat(atracker): support for managed_by property in iac.
Signed-off-by: Fidel Ruiz <[email protected]>
1 parent 9f99846 commit bba151c

22 files changed

+529
-271
lines changed

examples/ibm-atracker/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ resource "ibm_atracker_target" "atracker_target_instance" {
3535
cos_endpoint = var.atracker_target_cos_endpoint
3636
eventstreams_endpoint = var.atracker_target_eventstreams_endpoint
3737
cloudlogs_endpoint = var.atracker_target_cloudlogs_endpoint
38+
managed_by = var.atracker_target_managed_by
3839
}
3940
```
4041

@@ -49,6 +50,7 @@ resource "ibm_atracker_target" "atracker_target_instance" {
4950
| cos_endpoint | Property values for a Cloud Object Storage Endpoint in responses. | `` | false |
5051
| eventstreams_endpoint | Property values for the Event Streams Endpoint in responses. | `` | false |
5152
| cloudlogs_endpoint | Property values for the IBM Cloud Logs endpoint in responses. | `` | false |
53+
| managed_by | Identifies who manages the target. | `string` | false |
5254

5355
#### Outputs
5456

@@ -67,6 +69,7 @@ resource "ibm_atracker_target" "atracker_target_instance" {
6769
resource "ibm_atracker_route" "atracker_route_instance" {
6870
name = var.atracker_route_name
6971
rules = var.atracker_route_rules
72+
managed_by = var.atracker_route_managed_by
7073
}
7174
```
7275

@@ -77,6 +80,7 @@ resource "ibm_atracker_route" "atracker_route_instance" {
7780
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
7881
| name | The name of the route. | `string` | true |
7982
| rules | The routing rules that will be evaluated in their order of the array. Once a rule is matched, the remaining rules in the route definition will be skipped. | `list()` | true |
83+
| managed_by | Present when the route is enterprise-managed (`managed_by: enterprise`). | `string` | false |
8084

8185
#### Outputs
8286

@@ -106,7 +110,7 @@ resource "ibm_atracker_settings" "atracker_settings_instance" {
106110
| Name | Description | Type | Required |
107111
|------|-------------|------|---------|
108112
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
109-
| default_targets | The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. | `list(string)` | false |
113+
| default_targets | The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. Enterprise-managed targets are not supported. | `list(string)` | false |
110114
| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false |
111115
| metadata_region_primary | To store all your meta data in a single region. | `string` | true |
112116
| metadata_region_backup | To store all your meta data in a backup region. | `string` | false |

examples/ibm-atracker/main.tf

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,24 @@ provider "ibm" {
66
resource "ibm_atracker_target" "atracker_target_instance" {
77
name = var.atracker_target_name
88
target_type = var.atracker_target_target_type
9+
region = var.atracker_target_region
910
cos_endpoint {
1011
endpoint = "s3.private.us-east.cloud-object-storage.appdomain.cloud"
1112
target_crn = "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
1213
bucket = "my-atracker-bucket"
13-
api_key = "xxxxxxxxxxxxxx"
14+
service_to_service_enabled = true
1415
}
15-
region = var.atracker_target_region
16-
}
17-
18-
resource "ibm_atracker_target" atracker_target_eventstreams_instance {
19-
name = var.atracker_target_name
20-
target_type = "event_streams"
2116
eventstreams_endpoint {
2217
target_crn = "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
2318
brokers = [ "kafka-x:9094" ]
2419
topic = "my-topic"
2520
api_key = "xxxxxxxxxxxxxx"
2621
service_to_service_enabled = false
2722
}
28-
region = var.atracker_target_region
29-
}
30-
31-
resource "ibm_atracker_target" atracker_target_cloudlogs_instance {
32-
name = var.atracker_target_name
33-
target_type = "cloud_logs"
3423
cloudlogs_endpoint {
35-
target_crn = "crn:v1:bluemix:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
24+
target_crn = "crn:v1:bluemix:public:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
3625
}
37-
region = var.atracker_target_region
26+
managed_by = var.atracker_target_managed_by
3827
}
3928

4029
// Provision atracker_route resource instance
@@ -44,6 +33,7 @@ resource "ibm_atracker_route" "atracker_route_instance" {
4433
target_ids = [ ibm_atracker_target.atracker_target_instance.id ]
4534
locations = [ "us-south" ]
4635
}
36+
managed_by = var.atracker_route_managed_by
4737
}
4838

4939
// Provision atracker_settings resource instance
@@ -55,12 +45,21 @@ resource "ibm_atracker_settings" "atracker_settings_instance" {
5545
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
5646
}
5747

48+
// Data source is not linked to a resource instance
49+
// Uncomment if an existing data source instance exists
50+
/*
5851
// Create atracker_targets data source
5952
data "ibm_atracker_targets" "atracker_targets_instance" {
53+
region = var.atracker_targets_region
6054
name = var.atracker_targets_name
6155
}
56+
*/
6257

58+
// Data source is not linked to a resource instance
59+
// Uncomment if an existing data source instance exists
60+
/*
6361
// Create atracker_routes data source
6462
data "ibm_atracker_routes" "atracker_routes_instance" {
6563
name = var.atracker_routes_name
6664
}
65+
*/

examples/ibm-atracker/variables.tf

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variable "ibmcloud_api_key" {
55

66
// Resource arguments for atracker_target
77
variable "atracker_target_name" {
8-
description = "The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`."
8+
description = "The name of the target resource."
99
type = string
1010
default = "my-cos-target"
1111
}
@@ -14,72 +14,71 @@ variable "atracker_target_target_type" {
1414
type = string
1515
default = "cloud_object_storage"
1616
}
17-
1817
variable "atracker_target_region" {
1918
description = "Included this optional field if you used it to create a target in a different region other than the one you are connected."
2019
type = string
2120
default = "us-south"
2221
}
22+
variable "atracker_target_managed_by" {
23+
description = "Identifies who manages the target."
24+
type = string
25+
default = "enterprise"
26+
}
2327

2428
// Resource arguments for atracker_route
2529
variable "atracker_route_name" {
26-
description = "The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`."
30+
description = "The name of the route."
2731
type = string
2832
default = "my-route"
2933
}
30-
variable "atracker_route_receive_global_events" {
31-
description = "Indicates whether or not all global events should be forwarded to this region."
32-
type = bool
33-
default = false
34-
}
35-
variable "atracker_route_rules" {
36-
description = "Routing rules that will be evaluated in their order of the array."
37-
type = list(object({
38-
target_ids = list(string)
39-
locations = list(string)
40-
}))
41-
default = [ ]
42-
}
43-
44-
// Data source arguments for atracker_targets
45-
variable "atracker_targets_name" {
46-
description = "The name of the target resource."
34+
variable "atracker_route_managed_by" {
35+
description = "Present when the route is enterprise-managed (`managed_by: enterprise`)."
4736
type = string
48-
default = "a-cos-target-us-south"
37+
default = "enterprise"
4938
}
5039

51-
// Data source arguments for atracker_routes
52-
variable "atracker_routes_name" {
53-
description = "The name of the route."
54-
type = string
55-
default = "my-route"
56-
}
5740
// Resource arguments for atracker_settings
41+
variable "atracker_settings_default_targets" {
42+
description = "The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event. Enterprise-managed targets are not supported."
43+
type = list(string)
44+
default = [ "c3af557f-fb0e-4476-85c3-0889e7fe7bc4" ]
45+
}
46+
variable "atracker_settings_permitted_target_regions" {
47+
description = "If present then only these regions may be used to define a target."
48+
type = list(string)
49+
default = [ "us-south" ]
50+
}
5851
variable "atracker_settings_metadata_region_primary" {
5952
description = "To store all your meta data in a single region."
6053
type = string
6154
default = "us-south"
6255
}
63-
6456
variable "atracker_settings_metadata_region_backup" {
65-
description = "To store all your meta data in a single region."
57+
description = "To store all your meta data in a backup region."
6658
type = string
67-
default = "us-east"
59+
default = "eu-de"
6860
}
69-
7061
variable "atracker_settings_private_api_endpoint_only" {
7162
description = "If you set this true then you cannot access api through public network."
7263
type = bool
7364
default = false
7465
}
75-
variable "atracker_settings_default_targets" {
76-
description = "The target ID List. In the event that no routing rule causes the event to be sent to a target, these targets will receive the event."
77-
type = list(string)
78-
default = [ "c3af557f-fb0e-4476-85c3-0889e7fe7bc4" ]
66+
67+
// Data source arguments for atracker_targets
68+
variable "atracker_targets_region" {
69+
description = "Limit the query to the specified region."
70+
type = string
71+
default = "placeholder"
7972
}
80-
variable "atracker_settings_permitted_target_regions" {
81-
description = "If present then only these regions may be used to define a target."
82-
type = list(string)
83-
default = [ "us-south" ]
73+
variable "atracker_targets_name" {
74+
description = "The name of the target resource."
75+
type = string
76+
default = "a-cos-target-us-south"
77+
}
78+
79+
// Data source arguments for atracker_routes
80+
variable "atracker_routes_name" {
81+
description = "The name of the route."
82+
type = string
83+
default = "my-route"
8484
}
85-
// Data source arguments for atracker_endpoints

examples/ibm-atracker/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ terraform {
66
version = "1.52.0-beta0"
77
}
88
}
9-
}
9+
}

go.mod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.6
2020
github.com/IBM/event-notifications-go-admin-sdk v0.21.0
2121
github.com/IBM/eventstreams-go-sdk v1.4.0
22-
github.com/IBM/go-sdk-core/v5 v5.21.0
22+
github.com/IBM/go-sdk-core/v5 v5.21.2
2323
github.com/IBM/ibm-backup-recovery-sdk-go v1.0.5
2424
github.com/IBM/ibm-cos-sdk-go v1.12.2
2525
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.3.0
@@ -30,7 +30,7 @@ require (
3030
github.com/IBM/logs-router-go-sdk v1.0.8
3131
github.com/IBM/mqcloud-go-sdk v0.4.0
3232
github.com/IBM/networking-go-sdk v0.51.14
33-
github.com/IBM/platform-services-go-sdk v0.90.0
33+
github.com/IBM/platform-services-go-sdk v0.90.4
3434
github.com/IBM/project-go-sdk v0.4.0
3535
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
3636
github.com/IBM/sarama v1.45.0
@@ -46,7 +46,7 @@ require (
4646
github.com/akamai/AkamaiOPEN-edgegrid-golang/v5 v5.0.0
4747
github.com/apache/openwhisk-client-go v0.0.0-20200201143223-a804fb82d105
4848
github.com/apparentlymart/go-cidr v1.1.0
49-
github.com/go-openapi/strfmt v0.24.1-0.20250928163735-5c9b6bdeb47c
49+
github.com/go-openapi/strfmt v0.25.0
5050
github.com/golang-jwt/jwt/v5 v5.2.2
5151
github.com/google/go-cmp v0.7.0
5252
github.com/google/uuid v1.6.0
@@ -95,13 +95,13 @@ require (
9595
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
9696
github.com/fatih/color v1.16.0 // indirect
9797
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
98-
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
98+
github.com/gabriel-vasile/mimetype v1.4.11 // indirect
9999
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
100100
github.com/go-jose/go-jose/v4 v4.1.1 // indirect
101101
github.com/go-logr/logr v1.4.3 // indirect
102102
github.com/go-logr/stdr v1.2.2 // indirect
103103
github.com/go-openapi/analysis v0.23.0 // indirect
104-
github.com/go-openapi/errors v0.22.3 // indirect
104+
github.com/go-openapi/errors v0.22.4 // indirect
105105
github.com/go-openapi/jsonpointer v0.21.1 // indirect
106106
github.com/go-openapi/jsonreference v0.21.0 // indirect
107107
github.com/go-openapi/loads v0.22.0 // indirect
@@ -112,7 +112,7 @@ require (
112112
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
113113
github.com/go-playground/locales v0.14.1 // indirect
114114
github.com/go-playground/universal-translator v0.18.1 // indirect
115-
github.com/go-playground/validator/v10 v10.27.0 // indirect
115+
github.com/go-playground/validator/v10 v10.28.0 // indirect
116116
github.com/go-test/deep v1.1.0 // indirect
117117
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
118118
github.com/gogo/protobuf v1.3.2 // indirect
@@ -138,10 +138,10 @@ require (
138138
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
139139
github.com/hashicorp/hcl/v2 v2.24.0 // indirect
140140
github.com/hashicorp/logutils v1.0.0 // indirect
141-
github.com/hashicorp/terraform-exec v0.23.1 // indirect
142-
github.com/hashicorp/terraform-json v0.27.1 // indirect
141+
github.com/hashicorp/terraform-exec v0.24.0 // indirect
142+
github.com/hashicorp/terraform-json v0.27.2 // indirect
143143
github.com/hashicorp/terraform-plugin-go v0.29.0 // indirect
144-
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
144+
github.com/hashicorp/terraform-plugin-log v0.10.0 // indirect
145145
github.com/hashicorp/terraform-registry-address v0.4.0 // indirect
146146
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
147147
github.com/hashicorp/vault/api v1.16.0 // indirect
@@ -194,15 +194,15 @@ require (
194194
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
195195
github.com/x448/float16 v0.8.4 // indirect
196196
github.com/zclconf/go-cty v1.17.0 // indirect
197-
go.mongodb.org/mongo-driver v1.17.4 // indirect
197+
go.mongodb.org/mongo-driver v1.17.6 // indirect
198198
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
199199
go.opentelemetry.io/otel v1.37.0 // indirect
200200
go.opentelemetry.io/otel/metric v1.37.0 // indirect
201201
go.opentelemetry.io/otel/trace v1.37.0 // indirect
202202
go.uber.org/automaxprocs v1.6.0 // indirect
203203
go.uber.org/ratelimit v0.2.0 // indirect
204204
go.uber.org/zap v1.27.0 // indirect
205-
go.yaml.in/yaml/v2 v2.4.2 // indirect
205+
go.yaml.in/yaml/v2 v2.4.3 // indirect
206206
golang.org/x/mod v0.29.0 // indirect
207207
golang.org/x/net v0.47.0 // indirect
208208
golang.org/x/oauth2 v0.30.0 // indirect

0 commit comments

Comments
 (0)