Skip to content

Commit dad7de9

Browse files
authored
feat(atracker): regen code for apidoc update and remove logdna target (due to logdna end of service) (IBM-Cloud#6056)
* fix(atracker): remove logdna target type due to logdna end of service Signed-off-by: Wenjian Qiao <[email protected]> * update tests * minor update * restore subcategory --------- Signed-off-by: Wenjian Qiao <[email protected]>
1 parent f846432 commit dad7de9

20 files changed

+1225
-964
lines changed

examples/ibm-atracker/README.md

Lines changed: 113 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
# Example for AtrackerV2
1+
# Examples for Activity Tracker API Version 2
22

3-
This example illustrates how to use the AtrackerV2
3+
These examples illustrate how to use the resources and data sources associated with Activity Tracker API Version 2.
44

5-
The following types of resources are supported:
5+
The following resources are supported:
6+
* ibm_atracker_target
7+
* ibm_atracker_route
8+
* ibm_atracker_settings
69

7-
* Activity Tracker Event Routing Target
8-
* Activity Tracker Event Routing Route
9-
* Activity Tracker Event Routing Settings
10+
The following data sources are supported:
11+
* ibm_atracker_targets
12+
* ibm_atracker_routes
1013

1114
## Usage
1215

@@ -20,60 +23,146 @@ $ terraform apply
2023

2124
Run `terraform destroy` when you don't need these resources.
2225

26+
## Activity Tracker API Version 2 resources
2327

24-
## AtrackerV2 resources
25-
26-
atracker_target resource:
28+
### Resource: ibm_atracker_target
2729

2830
```hcl
29-
# Deprecated: logdna_endpoint is no longer in use and will be removed in the next major version of the provider.
30-
resource "atracker_target" "atracker_target_instance" {
31+
resource "ibm_atracker_target" "atracker_target_instance" {
3132
name = var.atracker_target_name
3233
target_type = var.atracker_target_target_type
3334
region = var.atracker_target_region
3435
cos_endpoint = var.atracker_target_cos_endpoint
35-
logdna_endpoint = var.atracker_target_logdna_endpoint
3636
eventstreams_endpoint = var.atracker_target_eventstreams_endpoint
37-
cloudlogs_endpoint = var.atracker_target_cloudlogs_instance
37+
cloudlogs_endpoint = var.atracker_target_cloudlogs_endpoint
3838
}
3939
```
40-
atracker_route resource:
40+
41+
#### Inputs
42+
43+
| Name | Description | Type | Required |
44+
|------|-------------|------|---------|
45+
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
46+
| name | The name of the target resource. | `string` | true |
47+
| target_type | The type of the target. | `string` | true |
48+
| region | Included this optional field if you used it to create a target in a different region other than the one you are connected. | `string` | false |
49+
| cos_endpoint | Property values for a Cloud Object Storage Endpoint in responses. | `` | false |
50+
| eventstreams_endpoint | Property values for the Event Streams Endpoint in responses. | `` | false |
51+
| cloudlogs_endpoint | Property values for the IBM Cloud Logs endpoint in responses. | `` | false |
52+
53+
#### Outputs
54+
55+
| Name | Description |
56+
|------|-------------|
57+
| crn | The crn of the target resource. |
58+
| write_status | The status of the write attempt to the target with the provided endpoint parameters. |
59+
| created_at | The timestamp of the target creation time. |
60+
| updated_at | The timestamp of the target last updated time. |
61+
| message | An optional message containing information about the target. |
62+
| api_version | The API version of the target. |
63+
64+
### Resource: ibm_atracker_route
4165

4266
```hcl
43-
resource "atracker_route" "atracker_route_instance" {
67+
resource "ibm_atracker_route" "atracker_route_instance" {
4468
name = var.atracker_route_name
4569
rules = var.atracker_route_rules
4670
}
4771
```
4872

49-
atracker_settings resource:
73+
#### Inputs
74+
75+
| Name | Description | Type | Required |
76+
|------|-------------|------|---------|
77+
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
78+
| name | The name of the route. | `string` | true |
79+
| 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 |
80+
81+
#### Outputs
82+
83+
| Name | Description |
84+
|------|-------------|
85+
| crn | The crn of the route resource. |
86+
| version | The version of the route. |
87+
| created_at | The timestamp of the route creation time. |
88+
| updated_at | The timestamp of the route last updated time. |
89+
| api_version | The API version of the route. |
90+
| message | An optional message containing information about the route. |
91+
92+
### Resource: ibm_atracker_settings
5093

5194
```hcl
52-
resource "atracker_settings" "atracker_settings_instance" {
53-
metadata_region_primary = var.atracker_settings_metadata_region_primary
54-
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
95+
resource "ibm_atracker_settings" "atracker_settings_instance" {
5596
default_targets = var.atracker_settings_default_targets
5697
permitted_target_regions = var.atracker_settings_permitted_target_regions
98+
metadata_region_primary = var.atracker_settings_metadata_region_primary
99+
metadata_region_backup = var.atracker_settings_metadata_region_backup
100+
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
57101
}
58102
```
59103

60-
## AtrackerV2 Data sources
104+
#### Inputs
105+
106+
| Name | Description | Type | Required |
107+
|------|-------------|------|---------|
108+
| 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 |
110+
| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false |
111+
| metadata_region_primary | To store all your meta data in a single region. | `string` | true |
112+
| metadata_region_backup | To store all your meta data in a backup region. | `string` | false |
113+
| private_api_endpoint_only | If you set this true then you cannot access api through public network. | `bool` | true |
114+
115+
#### Outputs
116+
117+
| Name | Description |
118+
|------|-------------|
119+
| api_version | API version used for configuring IBM Cloud Activity Tracker Event Routing resources in the account. |
120+
| message | An optional message containing information about the audit log locations. |
121+
122+
## Activity Tracker API Version 2 data sources
61123

62-
atracker_targets data source:
124+
### Data source: ibm_atracker_targets
63125

64126
```hcl
65-
data "atracker_targets" "atracker_targets_instance" {
127+
data "ibm_atracker_targets" "atracker_targets_instance" {
128+
region = var.atracker_targets_region
66129
name = var.atracker_targets_name
67130
}
68131
```
69-
atracker_routes data source:
132+
133+
#### Inputs
134+
135+
| Name | Description | Type | Required |
136+
|------|-------------|------|---------|
137+
| region | Limit the query to the specified region. | `string` | false |
138+
| name | The name of the target resource. | `string` | false |
139+
140+
#### Outputs
141+
142+
| Name | Description |
143+
|------|-------------|
144+
| targets | A list of target resources. |
145+
146+
### Data source: ibm_atracker_routes
70147

71148
```hcl
72-
data "atracker_routes" "atracker_routes_instance" {
149+
data "ibm_atracker_routes" "atracker_routes_instance" {
73150
name = var.atracker_routes_name
74151
}
75152
```
76153

154+
#### Inputs
155+
156+
| Name | Description | Type | Required |
157+
|------|-------------|------|---------|
158+
| name | The name of the route. | `string` | false |
159+
160+
#### Outputs
161+
162+
| Name | Description |
163+
|------|-------------|
164+
| routes | A list of route resources. |
165+
77166
## Assumptions
78167

79168
1. TODO
@@ -93,35 +182,3 @@ data "atracker_routes" "atracker_routes_instance" {
93182
| Name | Version |
94183
|------|---------|
95184
| ibm | 1.13.1 |
96-
97-
## Inputs
98-
99-
| Name | Description | Type | Required |
100-
|------|-------------|------|---------|
101-
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
102-
| name | The name of the target. The name must be 1000 characters or less, and cannot include any special characters other than `(space) - . _ :`. | `string` | true |
103-
| target_type | The type of the target. | `string` | true |
104-
| cos_endpoint | Property values for a Cloud Object Storage Endpoint. | `` | true |
105-
| eventstreams_endpoint | Property values for the Event Streams Endpoint. | `` | false |
106-
| logdna_endpoint | Deprecated. Property values for a LogDNA Endpoint. Remove this attribute as it is no longer in use and it will be removed in the next major version of the provider.| `` | false |
107-
| cloudlogs_endpoint | Property values for the IBM Cloud Logs Endpoint. | `` | false |
108-
| name | The name of the route. The name must be 1000 characters or less and cannot include any special characters other than `(space) - . _ :`. | `string` | true |
109-
| 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 |
110-
| 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 |
111-
| permitted_target_regions | If present then only these regions may be used to define a target. | `list(string)` | false |
112-
| metadata_region_primary | To store all your meta data in a single region. | `string` | true |
113-
| metadata_region_backup | To store all your meta data in a backup region. | `string` | false |
114-
| private_api_endpoint_only | If you set this true then you cannot access api through public network. | `bool` | true |
115-
| region | Limit the query to the specified region. | `string` | false |
116-
| name | The name of the target resource. | `string` | false |
117-
| name | The name of the route. | `string` | false |
118-
119-
## Outputs
120-
121-
| Name | Description |
122-
|------|-------------|
123-
| atracker_target | atracker_target object |
124-
| atracker_route | atracker_route object |
125-
| atracker_targets | atracker_targets object |
126-
| atracker_routes | atracker_routes object |
127-
| atracker_settings | atracker_settings object |

examples/ibm-atracker/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ resource "ibm_atracker_target" atracker_target_cloudlogs_instance {
3737
region = var.atracker_target_region
3838
}
3939

40-
4140
// Provision atracker_route resource instance
4241
resource "ibm_atracker_route" "atracker_route_instance" {
4342
name = var.atracker_route_name
@@ -49,10 +48,11 @@ resource "ibm_atracker_route" "atracker_route_instance" {
4948

5049
// Provision atracker_settings resource instance
5150
resource "ibm_atracker_settings" "atracker_settings_instance" {
52-
metadata_region_primary = var.atracker_settings_metadata_region_primary
53-
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
5451
default_targets = var.atracker_settings_default_targets
5552
permitted_target_regions = var.atracker_settings_permitted_target_regions
53+
metadata_region_primary = var.atracker_settings_metadata_region_primary
54+
metadata_region_backup = var.atracker_settings_metadata_region_backup
55+
private_api_endpoint_only = var.atracker_settings_private_api_endpoint_only
5656
}
5757

5858
// Create atracker_targets data source
@@ -63,4 +63,4 @@ data "ibm_atracker_targets" "atracker_targets_instance" {
6363
// Create atracker_routes data source
6464
data "ibm_atracker_routes" "atracker_routes_instance" {
6565
name = var.atracker_routes_name
66-
}
66+
}

examples/ibm-atracker/outputs.tf

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
// This allows atracker_target data to be referenced by other resources and the terraform CLI
2-
// Modify this if only certain data should be exposed
1+
// This output allows atracker_target data to be referenced by other resources and the terraform CLI
2+
// Modify this output if only certain data should be exposed
33
output "ibm_atracker_target" {
44
value = ibm_atracker_target.atracker_target_instance
55
description = "atracker_target resource instance"
66
}
7-
// This allows atracker_route data to be referenced by other resources and the terraform CLI
8-
// Modify this if only certain data should be exposed
7+
// This output allows atracker_route data to be referenced by other resources and the terraform CLI
8+
// Modify this output if only certain data should be exposed
99
output "ibm_atracker_route" {
1010
value = ibm_atracker_route.atracker_route_instance
1111
description = "atracker_route resource instance"
1212
}
13-
14-
// This allows atracker_settings data to be referenced by other resources and the terraform CLI
15-
// Modify this if only certain data should be exposed
13+
// This output allows atracker_settings data to be referenced by other resources and the terraform CLI
14+
// Modify this output if only certain data should be exposed
1615
output "ibm_atracker_settings" {
1716
value = ibm_atracker_settings.atracker_settings_instance
1817
description = "atracker_settings resource instance"

examples/ibm-atracker/variables.tf

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ variable "atracker_route_receive_global_events" {
3434
}
3535
variable "atracker_route_rules" {
3636
description = "Routing rules that will be evaluated in their order of the array."
37-
type = list(object({ example=string }))
38-
default = [ { "target_ids" : [ "target_ids" ] } ]
37+
type = list(object({
38+
target_ids = list(string)
39+
locations = list(string)
40+
}))
41+
default = [ ]
3942
}
4043

4144
// Data source arguments for atracker_targets
@@ -57,6 +60,13 @@ variable "atracker_settings_metadata_region_primary" {
5760
type = string
5861
default = "us-south"
5962
}
63+
64+
variable "atracker_settings_metadata_region_backup" {
65+
description = "To store all your meta data in a single region."
66+
type = string
67+
default = "us-east"
68+
}
69+
6070
variable "atracker_settings_private_api_endpoint_only" {
6171
description = "If you set this true then you cannot access api through public network."
6272
type = bool

ibm/service/atracker/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This area is primarily for IBM provider contributors and maintainers. For inform
55

66
## Environment variables to set for the tests
77
* COS_API_KEY : API Key used for creating COS targets
8-
* INGESTION_KEY : Deprecated. LogDNA Ingestion Key used for creating Logdna targets. This variable is no longer in use and will be removed in the next major version of the provider.
98
* IES_API_KEY : Event streams password used for creating Event streams targets
109

1110
## Handy Links

0 commit comments

Comments
 (0)