Skip to content

Commit 315c7c4

Browse files
committed
Move to API Token for terraform module
1 parent e5b2386 commit 315c7c4

File tree

9 files changed

+27
-7
lines changed

9 files changed

+27
-7
lines changed

content/en/imt/monitoring-as-code/_index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ cd ~/observability-content-contrib/integration-examples/terraform-jumpstart
3434

3535
The environment variables needed should already be set from [Installation using Helm](../gdi/#2-installation-using-helm). If not, create the following environment variables to use in the Terraform steps below
3636

37-
{{% tab title="Export ACCESS TOKEN" %}}
37+
{{% tab title="Export API TOKEN" %}}
3838

3939
``` bash
40-
export ACCESS_TOKEN="<replace_with_O11y-Workshop-ACCESS_TOKEN>"
40+
export API_TOKEN="<replace_with_O11y-Workshop-API_TOKEN>"
4141
```
4242

4343
{{% /tab %}}
@@ -124,7 +124,7 @@ The plan command alone will not actually carry out the proposed changes, and so
124124
{{% tab title="Execution Plan" %}}
125125

126126
```bash
127-
terraform plan -var="access_token=$ACCESS_TOKEN" -var="realm=$REALM" -var="o11y_prefix=[$(hostname)]"
127+
terraform plan -var="api_token=$API_TOKEN" -var="realm=$REALM" -var="o11y_prefix=[$(hostname)]"
128128
```
129129

130130
{{% /tab %}}
@@ -145,15 +145,15 @@ If the plan executes successfully, we can go ahead and apply:
145145

146146
The `terraform apply` command executes the actions proposed in the Terraform plan above.
147147

148-
The most straightforward way to use `terraform apply` is to run it without any arguments at all, in which case it will automatically create a new execution plan (as if you had run terraform plan) and then prompt you to provide the Access Token, Realm (the prefix defaults to `Splunk`) and approve the plan, before taking the indicated actions.
148+
The most straightforward way to use `terraform apply` is to run it without any arguments at all, in which case it will automatically create a new execution plan (as if you had run terraform plan) and then prompt you to provide the API Token, Realm (the prefix defaults to `Splunk`) and approve the plan, before taking the indicated actions.
149149

150150
Due to this being a workshop it is required that the prefix is to be unique so you need to run the `terraform apply` below.
151151

152152
{{< tabs >}}
153153
{{% tab title="Apply Plan" %}}
154154

155155
``` bash
156-
terraform apply -var="access_token=$ACCESS_TOKEN" -var="realm=$REALM" -var="o11y_prefix=[$(hostname)]"
156+
terraform apply -var="api_token=$API_TOKEN" -var="realm=$REALM" -var="o11y_prefix=[$(hostname)]"
157157
```
158158

159159
{{% /tab %}}
@@ -188,7 +188,7 @@ Now go and destroy all the Detectors and Dashboards that were previously applied
188188
{{% tab title="Destroy" %}}
189189

190190
``` bash
191-
terraform destroy -var="access_token=$ACCESS_TOKEN" -var="realm=$REALM"
191+
terraform destroy -var="api_token=$API_TOKEN" -var="realm=$REALM"
192192
```
193193

194194
{{% /tab %}}

multipass/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Initializing provider plugins...
6363
### Required variables
6464

6565
- `splunk_access_token`: Observability Access Token
66+
- `splunk_api_token`: Observability API Token
6667
- `splunk_rum_token`: Observability RUM Token
6768
- `splunk_realm`: Observability Realm e.g. `eu0`
6869
- `splunk_hec_url`: Splunk HEC URL

multipass/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ variable "splunk_access_token" {
1515
nullable = false
1616
}
1717

18+
variable "splunk_api_token" {
19+
description = "Splunk Observability Cloud API Token"
20+
type = string
21+
nullable = false
22+
}
23+
1824
variable "splunk_rum_token" {
1925
description = "Splunk Observability Cloud RUM Token"
2026
type = string

multipass/terraform.tfvars.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Required
22
splunk_access_token = ""
3+
splunk_api_token = ""
34
splunk_realm = ""
45

56
# Required if splunk_presetup is true, optional otherwise. See variables.tf and README.md

workshop/aws/ec2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The following variables are available. Edit `terraform.tfvars` to reflect what y
5757
- `aws_instance_count`: How many instances?
5858
- `slug`: Short name/tag, e.g. acme. Used to derive project and hostnames, AWS tags and terraform workspace e.g. `emea-ws`)
5959
- `splunk_access_token`: Observability Access Token
60+
- `splunk_api_token`: Observability API Token
6061
- `splunk_realm`: Observability Realm
6162
- `splunk_rum_token`: Observability RUM Token
6263
- `splunk_hec_url`: Splunk HEC URL

workshop/aws/ec2/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ resource "aws_key_pair" "kp" {
197197
locals {
198198
template_vars = {
199199
access_token = var.splunk_access_token
200+
api_token = var.splunk_api_token
200201
rum_token = var.splunk_rum_token
201202
realm = var.splunk_realm
202203
hec_token = var.splunk_hec_token

workshop/aws/ec2/templates/userdata.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ write_files:
4747
content: |
4848
4949
export ACCESS_TOKEN=${access_token}
50+
export API_TOKEN=${api_token}
5051
export REALM=${realm}
5152
export RUM_TOKEN=${rum_token}
5253
export HEC_TOKEN=${hec_token}
@@ -62,7 +63,7 @@ write_files:
6263
6364
terraform() {
6465
65-
echo >&2 "Using ACCESS_TOKEN=${access_token}"
66+
echo >&2 "Using API_TOKEN=${api_token}"
6667
echo >&2 "Using REALM=${realm}"
6768
6869
command terraform "$@"
@@ -129,6 +130,7 @@ write_files:
129130
export RUM_TOKEN=${rum_token}
130131
export REALM=${realm}
131132
export ACCESS_TOKEN=${access_token}
133+
export API_TOKEN=${api_token}
132134
export HEC_TOKEN=${hec_token}
133135
export HEC_URL=${hec_url}
134136
export INSTANCE="${instance_name}"
@@ -164,6 +166,7 @@ write_files:
164166
export RUM_TOKEN=${rum_token}
165167
export REALM=${realm}
166168
export ACCESS_TOKEN=${access_token}
169+
export API_TOKEN=${api_token}
167170
export HEC_TOKEN=${hec_token}
168171
export HEC_URL=${hec_url}
169172
export INSTANCE="${instance_name}"

workshop/aws/ec2/terraform.tfvars.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ aws_region = ""
33
aws_instance_count = ""
44
slug = ""
55
splunk_access_token = ""
6+
splunk_api_token = ""
67
splunk_realm = ""
78

89
# Required if splunk_presetup is true, optional otherwise. See variables.tf and README.md

workshop/aws/ec2/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ variable "splunk_access_token" {
6666
nullable = false
6767
}
6868

69+
variable "splunk_api_token" {
70+
description = "Splunk Oberservability Cloud API Token"
71+
type = string
72+
nullable = false
73+
}
74+
6975
variable "splunk_rum_token" {
7076
description = "Splunk Oberservability Cloud RUM Token"
7177
type = string

0 commit comments

Comments
 (0)