Skip to content

Conversation

@david049
Copy link

@david049 david049 commented Nov 3, 2025

What was changed

Adds terraform for audit log sink crud

Why?

Checklist

  1. Closes

  2. How was this tested:

locally tested
3. Any docs updates needed?


Note

Add Terraform resource temporalcloud_account_audit_log_sink with Kinesis/PubSub support, docs, examples, tests, and provider registration.

  • Resources:
    • Add internal/provider/account_audit_log_sink_resource.go implementing CRUD, import, timeouts, and validation (mutually exclusive kinesis/pubsub).
  • Types:
    • Extend internal/types/sink.go with KinesisSpecModel and PubSubSpecModel attribute types/models.
  • Provider:
    • Register resource in internal/provider/provider.go.
  • Docs & Examples:
    • New resource docs docs/resources/account_audit_log_sink.md and example examples/resources/temporalcloud_account_audit_log_sink/resource.tf (Kinesis and PubSub).
  • Tests:
    • Add schema and acceptance tests for Kinesis and PubSub in internal/provider/account_audit_log_sink_resource_test.go.
  • Dependencies:
    • Update go.mod to replace go.temporal.io/cloud-sdk with github.com/temporalio/cloud-sdk-go and sync go.sum.

Written by Cursor Bugbot for commit 5c06226. This will update automatically on new commits. Configure here.

@david049 david049 requested a review from a team as a code owner November 3, 2025 19:46
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace go.temporal.io/cloud-sdk => github.com/temporalio/cloud-sdk-go v0.6.1-0.20251031194819-5117604c8a4f
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove this after API update

}, nil
}

diags.AddError("Invalid sink configuration", "Either Kinesis or PubSub must be configured")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as it should not be hitting here.

Comment on lines +373 to +377
pubsubSinkSpec := &sinkv1.PubSubSpec{
ServiceAccountId: pubsubSpec.ServiceAccountId.ValueString(),
TopicName: pubsubSpec.TopicName.ValueString(),
GcpProjectId: pubsubSpec.GcpProjectId.ValueString(),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may hit a similar ask that customer wants sa email other than saId and gcp project. I got a customer ask for gcp and I added https://github.com/temporalio/terraform-provider-temporalcloud/pull/305/files#diff-0f9ac5989d3371aad25f7ab3f9c8663c66551ffc889f50f3a3cc96c9385d6456

@anekkanti
Copy link
Member

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants