Skip to content

Commit dc778fa

Browse files
committed
cleanup sink after
1 parent 8f57327 commit dc778fa

File tree

5 files changed

+148
-0
lines changed

5 files changed

+148
-0
lines changed

internal/provider/account_audit_log_sink_datasource_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ output "account_audit_log_sink" {
130130
return nil
131131
},
132132
},
133+
{
134+
Config: "",
135+
},
133136
},
134137
})
135138
}
@@ -255,6 +258,9 @@ output "account_audit_log_sink" {
255258
return nil
256259
},
257260
},
261+
{
262+
Config: "",
263+
},
258264
},
259265
})
260266
}

test_account_audit_log_sink/.terraform.lock.hcl

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Manual Testing Guide for Account Audit Log Sink
2+
3+
## Prerequisites
4+
5+
1. **API Key**: Get your Temporal Cloud API key
6+
- Docs: https://github.com/temporalio/tcld/tree/release/apikeys#api-key-management-preview
7+
8+
2. **Terraform**: Make sure Terraform is installed
9+
10+
## Step 1: Build and Install Provider Locally
11+
12+
```bash
13+
# Build the provider
14+
go build -o terraform-provider-temporalcloud
15+
16+
# Create plugin directory (adjust version if needed)
17+
mkdir -p ~/.terraform.d/plugins/temporal.io/provider-temporalcloud/temporalcloud/1.0.0/darwin_arm64/
18+
19+
# Install the provider
20+
mv terraform-provider-temporalcloud ~/.terraform.d/plugins/temporal.io/provider-temporalcloud/temporalcloud/1.0.0/darwin_arm64/
21+
```
22+
23+
## Step 2: Create Test Configuration
24+
25+
See `test.tf` for example configurations.
26+
27+
## Step 3: Initialize and Run Terraform
28+
29+
```bash
30+
# Initialize Terraform
31+
terraform init
32+
33+
# Plan (dry-run to see what will be created)
34+
terraform plan
35+
36+
# Apply (actually create the resource)
37+
terraform apply
38+
39+
# Show current state
40+
terraform show
41+
42+
# Destroy (clean up)
43+
terraform destroy
44+
```
45+
46+
## Environment Variables
47+
48+
You can use environment variable instead of hardcoding the API key:
49+
50+
```bash
51+
export TEMPORAL_CLOUD_API_KEY="your-api-key-here"
52+
```
53+
54+
Then omit the `api_key` from the provider block.
55+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
terraform {
2+
required_providers {
3+
temporalcloud = {
4+
version = "~> 1.0.0"
5+
source = "temporal.io/provider-temporalcloud/temporalcloud"
6+
}
7+
}
8+
}
9+
10+
provider "temporalcloud" {
11+
api_key = "eyJhbGciOiJFUzI1NiIsImtpZCI6InBwYWtIQSJ9.eyJhY2NvdW50X2lkIjoidGVtcG9yYWwtZGV2IiwiYXVkIjpbInRlbXBvcmFsLXRlc3QuaW8iXSwiZXhwIjoxNzYzNzY5NTk5LCJpc3MiOiJ0ZW1wb3JhbC10ZXN0LmlvIiwianRpIjoidWhRVDMwWENtcGdyQXZMcFc4Tkg1RHVKb2xMQ3puTzQiLCJrZXlfaWQiOiJ1aFFUMzBYQ21wZ3JBdkxwVzhOSDVEdUpvbExDem5PNCIsInN1YiI6ImM5OTEzOGQ0NzU4MzRlYjM5YjVmNmI3MjU1OWM2NGM4In0.saBPTMMrD2p3CB4JXanPby3a89wwYgznHFHD7HIfzw4ILjHh7xHML5xaTHUU9dkGCaY6mKmb0yDre6faUnJEfQ"
12+
endpoint = "saas-api.tmprl-test.cloud:443"
13+
}
14+
15+
# Test with PubSub (GCP)
16+
resource "temporalcloud_account_audit_log_sink" "test_pubsub" {
17+
sink_name = "test-pubsub-sink-manual-001e"
18+
enabled = true
19+
20+
kinesis = {
21+
role_name = "TestAuditLogWriter100"
22+
destination_uri = "arn:aws:kinesis:us-west-2:531960641682:stream/saas-audit-logging-test"
23+
region = "us-west-2"
24+
}
25+
}
26+
27+
output "pubsub_sink_id" {
28+
value = temporalcloud_account_audit_log_sink.test_pubsub.id
29+
description = "The ID of the PubSub audit log sink"
30+
}
31+
32+
output "pubsub_sink_name" {
33+
value = temporalcloud_account_audit_log_sink.test_pubsub.sink_name
34+
description = "The name of the PubSub audit log sink"
35+
}
36+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# terraform {
2+
# required_providers {
3+
# temporalcloud = {
4+
# version = "~> 1.0.0"
5+
# source = "temporal.io/provider-temporalcloud/temporalcloud"
6+
# }
7+
# }
8+
# }
9+
#
10+
# provider "temporalcloud" {
11+
# api_key = "eyJhbGciOiJFUzI1NiIsICJraWQiOiJwcGFrSEEifQ.eyJhY2NvdW50X2lkIjoiaWVuZXkiLCAiYXVkIjpbInRlbXBvcmFsLXRlc3QuaW8iXSwgImV4cCI6MTc2NDc3ODg1MCwgImlzcyI6InRlbXBvcmFsLXRlc3QuaW8iLCAianRpIjoiSVlnUnN4Y1JiSDlvb2x4WHdnbThxZGdybjA0UVdsQVQiLCAia2V5X2lkIjoiSVlnUnN4Y1JiSDlvb2x4WHdnbThxZGdybjA0UVdsQVQiLCAic3ViIjoiZDY2YTFiMTM3YmM3NDEwN2IwMTUwNjI1NGNjMzk3MTIifQ.p4wp8Uz4ROtC0XjC9RmIS7nySLHs5eBf2_5RX05oeDImT7vLqjwda05lN_9pnzhCHJzAWlviipxlJjieS7QXow"
12+
# endpoint = "saas-api.tmprl-test.cloud:443"
13+
# }
14+
#
15+
# # Test with Kinesis
16+
# resource "temporalcloud_account_audit_log_sink" "test_kinesis" {
17+
# sink_name = "test-kinesis-sink-manual-001"
18+
# enabled = true
19+
#
20+
# kinesis = {
21+
# role_name = "arn:aws:iam::123456789012:role/TemporalCloudKinesisRole"
22+
# destination_uri = "arn:aws:kinesis:us-east-1:123456789012:stream/my-audit-stream"
23+
# region = "us-east-1"
24+
# }
25+
#
26+
# timeouts = {
27+
# create = "10m"
28+
# delete = "10m"
29+
# }
30+
# }
31+
#
32+
# output "kinesis_sink_id" {
33+
# value = temporalcloud_account_audit_log_sink.test_kinesis.id
34+
# description = "The ID of the Kinesis audit log sink"
35+
# }
36+
#
37+
# output "kinesis_sink_name" {
38+
# value = temporalcloud_account_audit_log_sink.test_kinesis.sink_name
39+
# description = "The name of the Kinesis audit log sink"
40+
# }
41+

0 commit comments

Comments
 (0)