Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/ibm-atracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ resource "ibm_atracker_target" "atracker_target_instance" {
cos_endpoint = var.atracker_target_cos_endpoint
eventstreams_endpoint = var.atracker_target_eventstreams_endpoint
cloudlogs_endpoint = var.atracker_target_cloudlogs_endpoint
managed_by = var.atracker_target_managed_by
}
```

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

#### Outputs

Expand All @@ -67,6 +69,7 @@ resource "ibm_atracker_target" "atracker_target_instance" {
resource "ibm_atracker_route" "atracker_route_instance" {
name = var.atracker_route_name
rules = var.atracker_route_rules
managed_by = var.atracker_route_managed_by
}
```

Expand All @@ -77,6 +80,7 @@ resource "ibm_atracker_route" "atracker_route_instance" {
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
| name | The name of the route. | `string` | true |
| 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 |
| managed_by | Present when the route is enterprise-managed (`managed_by: enterprise`). | `string` | false |

#### Outputs

Expand Down Expand Up @@ -106,7 +110,7 @@ resource "ibm_atracker_settings" "atracker_settings_instance" {
| Name | Description | Type | Required |
|------|-------------|------|---------|
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
| 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 |
| 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 |
| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false |
| metadata_region_primary | To store all your meta data in a single region. | `string` | true |
| metadata_region_backup | To store all your meta data in a backup region. | `string` | false |
Expand Down
54 changes: 34 additions & 20 deletions examples/ibm-atracker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,36 @@ provider "ibm" {

// Provision atracker_target resource instance
resource "ibm_atracker_target" "atracker_target_instance" {
name = var.atracker_target_name
name = var.atracker_target_name
target_type = var.atracker_target_target_type
region = var.atracker_target_region

cos_endpoint {
endpoint = "s3.private.us-east.cloud-object-storage.appdomain.cloud"
target_crn = "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
bucket = "my-atracker-bucket"
api_key = "xxxxxxxxxxxxxx"
endpoint = "s3.private.us-east.cloud-object-storage.appdomain.cloud"
target_crn = "crn:v1:bluemix:public:cloud-object-storage:global:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
bucket = "my-atracker-bucket"
service_to_service_enabled = true
}
region = var.atracker_target_region

managed_by = var.atracker_target_managed_by

}

resource "ibm_atracker_target" atracker_target_eventstreams_instance {
name = var.atracker_target_name
resource "ibm_atracker_target" "atracker_target_eventstreams_instance" {
name = var.atracker_target_name
target_type = "event_streams"
eventstreams_endpoint {
target_crn = "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
brokers = [ "kafka-x:9094" ]
topic = "my-topic"
api_key = "xxxxxxxxxxxxxx"
target_crn = "crn:v1:bluemix:public:messagehub:us-south:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
brokers = ["kafka-x:9094"]
topic = "my-topic"
api_key = "xxxxxxxxxxxxxx"
service_to_service_enabled = false
}
region = var.atracker_target_region
}

resource "ibm_atracker_target" atracker_target_cloudlogs_instance {
name = var.atracker_target_name
resource "ibm_atracker_target" "atracker_target_cloudlogs_instance" {
name = var.atracker_target_name
target_type = "cloud_logs"
cloudlogs_endpoint {
target_crn = "crn:v1:bluemix:public:logs:eu-es:a/11111111111111111111111111111111:22222222-2222-2222-2222-222222222222::"
Expand All @@ -41,26 +45,36 @@ resource "ibm_atracker_target" atracker_target_cloudlogs_instance {
resource "ibm_atracker_route" "atracker_route_instance" {
name = var.atracker_route_name
rules {
target_ids = [ ibm_atracker_target.atracker_target_instance.id ]
locations = [ "us-south" ]
target_ids = [ibm_atracker_target.atracker_target_instance.id]
locations = ["us-south"]
}
managed_by = var.atracker_route_managed_by
}

// Provision atracker_settings resource instance
resource "ibm_atracker_settings" "atracker_settings_instance" {
default_targets = var.atracker_settings_default_targets
permitted_target_regions = var.atracker_settings_permitted_target_regions
metadata_region_primary = var.atracker_settings_metadata_region_primary
metadata_region_backup = var.atracker_settings_metadata_region_backup
default_targets = var.atracker_settings_default_targets
permitted_target_regions = var.atracker_settings_permitted_target_regions
metadata_region_primary = var.atracker_settings_metadata_region_primary
metadata_region_backup = var.atracker_settings_metadata_region_backup
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
}

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create atracker_targets data source
data "ibm_atracker_targets" "atracker_targets_instance" {
region = var.atracker_targets_region
name = var.atracker_targets_name
}
*/

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create atracker_routes data source
data "ibm_atracker_routes" "atracker_routes_instance" {
name = var.atracker_routes_name
}
*/
72 changes: 42 additions & 30 deletions examples/ibm-atracker/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ variable "ibmcloud_api_key" {

// Resource arguments for atracker_target
variable "atracker_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) - . _ :`."
description = "The name of the target resource."
type = string
default = "my-cos-target"
}
Expand All @@ -14,19 +14,17 @@ variable "atracker_target_target_type" {
type = string
default = "cloud_object_storage"
}

variable "atracker_target_region" {
description = "Included this optional field if you used it to create a target in a different region other than the one you are connected."
type = string
default = "us-south"
}

// Resource arguments for atracker_route
variable "atracker_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) - . _ :`."
variable "atracker_target_managed_by" {
description = "Identifies who manages the target."
type = string
default = "my-route"
default = "enterprise"
}

variable "atracker_route_receive_global_events" {
description = "Indicates whether or not all global events should be forwarded to this region."
type = bool
Expand All @@ -40,46 +38,60 @@ variable "atracker_route_rules" {
}))
default = [ ]
}

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

// Data source arguments for atracker_routes
variable "atracker_routes_name" {
// Resource arguments for atracker_route
variable "atracker_route_name" {
description = "The name of the route."
type = string
default = "my-route"
}
variable "atracker_route_managed_by" {
description = "Present when the route is enterprise-managed (`managed_by: enterprise`)."
type = string
default = "enterprise"
}

// Resource arguments for atracker_settings
variable "atracker_settings_default_targets" {
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."
type = list(string)
default = [ "c3af557f-fb0e-4476-85c3-0889e7fe7bc4" ]
}
variable "atracker_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 "atracker_settings_metadata_region_primary" {
description = "To store all your meta data in a single region."
type = string
default = "us-south"
}

variable "atracker_settings_metadata_region_backup" {
description = "To store all your meta data in a single region."
description = "To store all your meta data in a backup region."
type = string
default = "us-east"
default = "eu-de"
}

variable "atracker_settings_private_api_endpoint_only" {
description = "If you set this true then you cannot access api through public network."
type = bool
default = false
}
variable "atracker_settings_default_targets" {
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."
type = list(string)
default = [ "c3af557f-fb0e-4476-85c3-0889e7fe7bc4" ]

// Data source arguments for atracker_targets
variable "atracker_targets_region" {
description = "Limit the query to the specified region."
type = string
default = "placeholder"
}
variable "atracker_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 "atracker_targets_name" {
description = "The name of the target resource."
type = string
default = "a-cos-target-us-south"
}

// Data source arguments for atracker_routes
variable "atracker_routes_name" {
description = "The name of the route."
type = string
default = "my-route"
}
// Data source arguments for atracker_endpoints
2 changes: 1 addition & 1 deletion examples/ibm-atracker/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ terraform {
version = "1.52.0-beta0"
}
}
}
}
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.6
github.com/IBM/event-notifications-go-admin-sdk v0.21.0
github.com/IBM/eventstreams-go-sdk v1.4.0
github.com/IBM/go-sdk-core/v5 v5.21.0
github.com/IBM/go-sdk-core/v5 v5.21.2
github.com/IBM/ibm-backup-recovery-sdk-go v1.0.5
github.com/IBM/ibm-cos-sdk-go v1.12.2
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.3.0
Expand All @@ -30,7 +30,7 @@ require (
github.com/IBM/logs-router-go-sdk v1.0.8
github.com/IBM/mqcloud-go-sdk v0.4.0
github.com/IBM/networking-go-sdk v0.51.14
github.com/IBM/platform-services-go-sdk v0.90.0
github.com/IBM/platform-services-go-sdk v0.90.4
github.com/IBM/project-go-sdk v0.4.0
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/sarama v1.45.0
Expand All @@ -46,7 +46,7 @@ require (
github.com/akamai/AkamaiOPEN-edgegrid-golang/v5 v5.0.0
github.com/apache/openwhisk-client-go v0.0.0-20200201143223-a804fb82d105
github.com/apparentlymart/go-cidr v1.1.0
github.com/go-openapi/strfmt v0.24.1-0.20250928163735-5c9b6bdeb47c
github.com/go-openapi/strfmt v0.25.0
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -95,13 +95,13 @@ require (
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/gabriel-vasile/mimetype v1.4.11 // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/go-jose/go-jose/v4 v4.1.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.3 // indirect
github.com/go-openapi/errors v0.22.4 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
Expand All @@ -112,7 +112,7 @@ require (
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.27.0 // indirect
github.com/go-playground/validator/v10 v10.28.0 // indirect
github.com/go-test/deep v1.1.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -138,10 +138,10 @@ require (
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
github.com/hashicorp/hcl/v2 v2.24.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.23.1 // indirect
github.com/hashicorp/terraform-json v0.27.1 // indirect
github.com/hashicorp/terraform-exec v0.24.0 // indirect
github.com/hashicorp/terraform-json v0.27.2 // indirect
github.com/hashicorp/terraform-plugin-go v0.29.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.10.0 // indirect
github.com/hashicorp/terraform-registry-address v0.4.0 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/vault/api v1.16.0 // indirect
Expand Down Expand Up @@ -194,15 +194,15 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/zclconf/go-cty v1.17.0 // indirect
go.mongodb.org/mongo-driver v1.17.4 // indirect
go.mongodb.org/mongo-driver v1.17.6 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
Expand Down
Loading