Skip to content
Draft
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
321 changes: 321 additions & 0 deletions datadog/fwprovider/observability_pipeline/websocket_source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,321 @@
package observability_pipeline

import (
"context"

datadogV2 "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/diag"
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
)

// WebsocketSourceTlsValidator enforces mode-specific field rules for the TLS block:
// - mode = "enabled": crt_file, ca_file, key_file, key_pass_key must NOT be set.
// - mode = "with_client_cert": crt_file must be set (non-empty).
type WebsocketSourceTlsValidator struct{}

func (v WebsocketSourceTlsValidator) Description(_ context.Context) string {
return "validates mode-specific TLS field requirements"
}

func (v WebsocketSourceTlsValidator) MarkdownDescription(ctx context.Context) string {
return v.Description(ctx)
}

func (v WebsocketSourceTlsValidator) ValidateObject(_ context.Context, req validator.ObjectRequest, resp *validator.ObjectResponse) {
if req.ConfigValue.IsNull() || req.ConfigValue.IsUnknown() {
return
}

attrs := req.ConfigValue.Attributes()

modeAttr, ok := attrs["mode"]
if !ok || modeAttr.IsNull() || modeAttr.IsUnknown() {
return
}
mode := modeAttr.(types.String).ValueString()

certFields := []string{"crt_file", "ca_file", "key_file", "key_pass_key"}

// isKnownAndSet returns true only when the attribute is known (not null, not unknown)
// and contains a non-empty string value. Unknown values are skipped so that
// plan-time validation does not fail when a field is derived from another resource.
isKnownAndSet := func(name string) bool {
attr, exists := attrs[name]
if !exists || attr.IsNull() || attr.IsUnknown() {
return false
Comment on lines +48 to +49

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow unknown certificate values during validation

When mode = "with_client_cert" and crt_file is derived from another resource output, Terraform can pass it to validators as unknown during planning; treating unknown as unset here makes the later !isSet("crt_file") check fail the plan even though the value may be known by apply. Provider validators should return without diagnostics for unknown values, so this blocks valid configurations that compute the client certificate path dynamically.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed. The validator no longer treats unknown values as unset — it now skips validation for any attribute that is unknown at plan time. with_client_cert only errors on a missing crt_file when it's known-and-empty/null (an unknown crt_file, e.g. from another resource's output, passes plan and is checked at apply); enabled only rejects cert fields that are known-and-non-empty. Mirrors the IsUnknown() skip pattern used by ExactlyOneProcessorValidator.

}
s, ok := attr.(types.String)
return ok && s.ValueString() != ""
}

// isKnownAndMissing returns true only when the attribute is known (not unknown)
// and is either null or an empty string. Unknown values are skipped so that
// plan-time validation does not fail when a field will be set at apply time.
isKnownAndMissing := func(name string) bool {
attr, exists := attrs[name]
if !exists {
return true
}
if attr.IsUnknown() {
return false
}
if attr.IsNull() {
return true
}
s, ok := attr.(types.String)
return !ok || s.ValueString() == ""
}

switch mode {
case "enabled":
for _, field := range certFields {
if isKnownAndSet(field) {
resp.Diagnostics.Append(diag.NewAttributeErrorDiagnostic(
req.Path,
"Invalid TLS Configuration",
"When 'mode' is 'enabled', '"+field+"' must not be set. Certificate fields are only valid with mode 'with_client_cert'.",
))
}
}
case "with_client_cert":
if isKnownAndMissing("crt_file") {
resp.Diagnostics.Append(diag.NewAttributeErrorDiagnostic(
req.Path,
"Missing Required Field",
"'crt_file' is required when 'mode' is 'with_client_cert'.",
))
}
}
}

// WebsocketSourceTlsModel represents the TLS configuration for the websocket source.
// The tls block uses a mode discriminator: "enabled" or "with_client_cert".
// When mode is "with_client_cert", crt_file is required and ca_file/key_file/key_pass_key
// are optional. This mirrors the OpenAPI oneOf shape:
//
// ObservabilityPipelineWebsocketSourceTls:
// oneOf:
// - ObservabilityPipelineWebsocketSourceTlsEnabled (mode: "enabled")
// - ObservabilityPipelineWebsocketSourceTlsWithClientCert (mode: "with_client_cert",
// crt_file required)
type WebsocketSourceTlsModel struct {
Mode types.String `tfsdk:"mode"`
CrtFile types.String `tfsdk:"crt_file"`
CaFile types.String `tfsdk:"ca_file"`
KeyFile types.String `tfsdk:"key_file"`
KeyPassKey types.String `tfsdk:"key_pass_key"`
}

// WebsocketSourceModel represents the Terraform model for websocket source configuration.
type WebsocketSourceModel struct {
UriKey types.String `tfsdk:"uri_key"`
Decoding types.String `tfsdk:"decoding"`
AuthStrategy types.String `tfsdk:"auth_strategy"`
UsernameKey types.String `tfsdk:"username_key"`
PasswordKey types.String `tfsdk:"password_key"`
TokenKey types.String `tfsdk:"token_key"`
CustomKey types.String `tfsdk:"custom_key"`
Tls []WebsocketSourceTlsModel `tfsdk:"tls"`
}

// ExpandWebsocketSource converts the Terraform model to the Datadog API model.
func ExpandWebsocketSource(src *WebsocketSourceModel, id string) (datadogV2.ObservabilityPipelineConfigSourceItem, diag.Diagnostics) {
var diags diag.Diagnostics

s := datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults()

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Check failure on line 129 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate the API client before using WebSocket types

This new source is wired directly to datadogV2.NewObservabilityPipelineWebsocketSourceWithDefaults() and related ObservabilityPipelineWebsocketSource* symbols, but the pinned github.com/DataDog/datadog-api-client-go/v2 in this repo does not export those symbols (go doc ...ObservabilityPipelineWebsocketSource reports no symbol). As committed, any build or test of the provider fails before users can use existing resources, so the provider needs the regenerated client/go.mod update in the same change or this code must be gated until that dependency lands.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is expected and called out in the PR description. The WebSocket types (ObservabilityPipelineWebsocketSource*) are generated from the API specification, which is a separate change that hasn't been released yet — so the pinned datadog-api-client-go doesn't export them and the build won't pass until the client is regenerated and the go.mod bumped. That's why this PR is in draft: it's staged to go green once the generated client lands. The provider code here is written against the finalized type/field names so it compiles as soon as the client is updated. Not gating/removing in this PR, since the dependency is part of the planned rollout.

s.SetId(id)
s.SetDecoding(datadogV2.ObservabilityPipelineDecoding(src.Decoding.ValueString()))
s.SetAuthStrategy(datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy(src.AuthStrategy.ValueString()))

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

Check failure on line 132 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceAuthStrategy

if !src.UriKey.IsNull() {
s.SetUriKey(src.UriKey.ValueString())
}
if !src.UsernameKey.IsNull() {
s.SetUsernameKey(src.UsernameKey.ValueString())
}
if !src.PasswordKey.IsNull() {
s.SetPasswordKey(src.PasswordKey.ValueString())
}
if !src.TokenKey.IsNull() {
s.SetTokenKey(src.TokenKey.ValueString())
}
if !src.CustomKey.IsNull() {
s.SetCustomKey(src.CustomKey.ValueString())
}

if len(src.Tls) > 0 {
tlsItem := src.Tls[0]
switch tlsItem.Mode.ValueString() {
case "enabled":
s.Tls = &datadogV2.ObservabilityPipelineWebsocketSourceTls{

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 154 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls
ObservabilityPipelineWebsocketSourceTlsEnabled: &datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled{

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled

Check failure on line 155 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsEnabled
Mode: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED,

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED

Check failure on line 156 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSENABLEDMODE_ENABLED
},
}
case "with_client_cert":
withCert := &datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert{

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert

Check failure on line 160 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTlsWithClientCert
Mode: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT,

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT

Check failure on line 161 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.OBSERVABILITYPIPELINEWEBSOCKETSOURCETLSWITHCLIENTCERTMODE_WITH_CLIENT_CERT
CrtFile: tlsItem.CrtFile.ValueString(),
}
if !tlsItem.CaFile.IsNull() {
withCert.SetCaFile(tlsItem.CaFile.ValueString())
}
if !tlsItem.KeyFile.IsNull() {
withCert.SetKeyFile(tlsItem.KeyFile.ValueString())
}
if !tlsItem.KeyPassKey.IsNull() {
withCert.SetKeyPassKey(tlsItem.KeyPassKey.ValueString())
}
s.Tls = &datadogV2.ObservabilityPipelineWebsocketSourceTls{

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls

Check failure on line 173 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSourceTls
ObservabilityPipelineWebsocketSourceTlsWithClientCert: withCert,
}
}
}

return datadogV2.ObservabilityPipelineConfigSourceItem{
ObservabilityPipelineWebsocketSource: s,

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem

Check failure on line 180 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

unknown field ObservabilityPipelineWebsocketSource in struct literal of type datadogV2.ObservabilityPipelineConfigSourceItem
}, diags
}

// FlattenWebsocketSource converts the Datadog API model to the Terraform model.
func FlattenWebsocketSource(src *datadogV2.ObservabilityPipelineWebsocketSource) *WebsocketSourceModel {

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / integration-tests

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 1, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 1)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 0)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.11.2, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.1.5, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 0, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 2, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 2)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test-tofu (1.10.5, 3)

undefined: datadogV2.ObservabilityPipelineWebsocketSource

Check failure on line 185 in datadog/fwprovider/observability_pipeline/websocket_source.go

View workflow job for this annotation

GitHub Actions / test (1.13.1, 3, ubuntu-latest)

undefined: datadogV2.ObservabilityPipelineWebsocketSource
if src == nil {
return nil
}

out := &WebsocketSourceModel{
Decoding: types.StringValue(string(src.GetDecoding())),
AuthStrategy: types.StringValue(string(src.GetAuthStrategy())),
}

if v, ok := src.GetUriKeyOk(); ok {
out.UriKey = types.StringValue(*v)
}
if v, ok := src.GetUsernameKeyOk(); ok {
out.UsernameKey = types.StringValue(*v)
}
if v, ok := src.GetPasswordKeyOk(); ok {
out.PasswordKey = types.StringValue(*v)
}
if v, ok := src.GetTokenKeyOk(); ok {
out.TokenKey = types.StringValue(*v)
}
if v, ok := src.GetCustomKeyOk(); ok {
out.CustomKey = types.StringValue(*v)
}

if src.Tls != nil {
tlsModel := WebsocketSourceTlsModel{}
if src.Tls.ObservabilityPipelineWebsocketSourceTlsEnabled != nil {
tlsModel.Mode = types.StringValue("enabled")
tlsModel.CrtFile = types.StringNull()
tlsModel.CaFile = types.StringNull()
tlsModel.KeyFile = types.StringNull()
tlsModel.KeyPassKey = types.StringNull()
} else if src.Tls.ObservabilityPipelineWebsocketSourceTlsWithClientCert != nil {
cert := src.Tls.ObservabilityPipelineWebsocketSourceTlsWithClientCert
tlsModel.Mode = types.StringValue("with_client_cert")
tlsModel.CrtFile = types.StringValue(cert.CrtFile)
tlsModel.CaFile = types.StringPointerValue(cert.CaFile)
tlsModel.KeyFile = types.StringPointerValue(cert.KeyFile)
if v, ok := cert.GetKeyPassKeyOk(); ok {
tlsModel.KeyPassKey = types.StringValue(*v)
} else {
tlsModel.KeyPassKey = types.StringNull()
}
}
out.Tls = []WebsocketSourceTlsModel{tlsModel}
}

return out
}

// WebsocketSourceSchema returns the schema for the websocket source block.
func WebsocketSourceSchema() schema.ListNestedBlock {
return schema.ListNestedBlock{
Description: "The `websocket` source establishes a persistent WebSocket connection to a remote endpoint and ingests log events as they are pushed by the server.",
NestedObject: schema.NestedBlockObject{
Attributes: map[string]schema.Attribute{
"uri_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds the WebSocket URI to connect to.",
},
"decoding": schema.StringAttribute{
Required: true,
Description: "The decoding format used to interpret incoming log events.",
Validators: []validator.String{
stringvalidator.OneOf("bytes", "gelf", "json", "syslog"),
},
},
"auth_strategy": schema.StringAttribute{
Required: true,
Description: "The authentication strategy used when connecting to the WebSocket server.",
Validators: []validator.String{
stringvalidator.OneOf("none", "basic", "bearer", "custom"),
},
},
"username_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`.",
},
"password_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`.",
},
"token_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`.",
},
"custom_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds a custom header value. Used when `auth_strategy` is `custom`.",
},
},
Blocks: map[string]schema.Block{
"tls": schema.ListNestedBlock{
Description: "TLS configuration for the WebSocket connection. Set `mode` to `enabled` for server-certificate validation only, or `with_client_cert` to additionally present a client certificate.",
NestedObject: schema.NestedBlockObject{
Attributes: map[string]schema.Attribute{
"mode": schema.StringAttribute{
Required: true,
Description: "The TLS mode. Use `enabled` for server-only TLS, or `with_client_cert` for mutual TLS with a client certificate.",
Validators: []validator.String{
stringvalidator.OneOf("enabled", "with_client_cert"),
},
},
"crt_file": schema.StringAttribute{
Optional: true,
Description: "Path to the client certificate file. Required when `mode` is `with_client_cert`.",
Comment on lines +290 to +292

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce TLS mode-specific fields

When users set tls.mode = "enabled" together with any certificate field, Terraform accepts the config but ExpandWebsocketSource serializes only the mode in that branch, so the API read drops those fields and subsequent plans keep trying to apply them. Conversely, with_client_cert is documented as requiring crt_file but the schema permits omitting it, allowing an invalid empty certificate path to reach the API. Please validate the TLS oneOf shape, or split the modes into mutually exclusive blocks, instead of accepting the same optional fields for both modes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in the latest commit. Added WebsocketSourceTlsValidator (a validator.Object on the tls nested block, mirroring the existing SocketFramingValidator pattern):

  • mode = enabled: rejects crt_file/ca_file/key_file/key_pass_key if set, so no fields are silently dropped at expand time and there's no perma-diff.
  • mode = with_client_cert: requires a non-empty crt_file, matching the oneOf shape.

Enforced at plan time, so Expand never sees an invalid combination.

},
"ca_file": schema.StringAttribute{
Optional: true,
Description: "Path to the Certificate Authority (CA) file used to validate the server's TLS certificate.",
},
"key_file": schema.StringAttribute{
Optional: true,
Description: "Path to the private key file associated with the client certificate.",
},
"key_pass_key": schema.StringAttribute{
Optional: true,
Description: "Name of the environment variable or secret that holds the passphrase for the private key file.",
},
},
Validators: []validator.Object{
WebsocketSourceTlsValidator{},
},
},
Validators: []validator.List{
listvalidator.SizeAtMost(1),
},
},
},
},
Validators: []validator.List{
listvalidator.SizeAtMost(1),
},
}
}
14 changes: 14 additions & 0 deletions datadog/fwprovider/resource_datadog_observability_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type sourceModel struct {
LogstashSource []*logstashSourceModel `tfsdk:"logstash"`
SocketSource []*observability_pipeline.SocketSourceModel `tfsdk:"socket"`
OpentelemetrySource []*observability_pipeline.OpentelemetrySourceModel `tfsdk:"opentelemetry"`
WebsocketSource []*observability_pipeline.WebsocketSourceModel `tfsdk:"websocket"`
}

type logstashSourceModel struct {
Expand Down Expand Up @@ -1229,6 +1230,7 @@ func (r *observabilityPipelineResource) Schema(_ context.Context, _ resource.Sch
},
"socket": observability_pipeline.SocketSourceSchema(),
"opentelemetry": observability_pipeline.OpentelemetrySourceSchema(),
"websocket": observability_pipeline.WebsocketSourceSchema(),
},
},
},
Expand Down Expand Up @@ -3073,6 +3075,14 @@ func expandPipeline(ctx context.Context, state *observabilityPipelineModel) (*da
for _, o := range sourceBlock.OpentelemetrySource {
config.Sources = append(config.Sources, observability_pipeline.ExpandOpentelemetrySource(o, sourceId))
}
for _, w := range sourceBlock.WebsocketSource {
item, wsDiags := observability_pipeline.ExpandWebsocketSource(w, sourceId)
diags.Append(wsDiags...)
if wsDiags.HasError() {
return nil, diags
}
config.Sources = append(config.Sources, item)
}
}

// Processors - iterate through processor groups
Expand Down Expand Up @@ -3268,6 +3278,10 @@ func flattenPipeline(ctx context.Context, state *observabilityPipelineModel, res
sourceBlock.Id = types.StringValue(src.ObservabilityPipelineOpentelemetrySource.GetId())
sourceBlock.OpentelemetrySource = append(sourceBlock.OpentelemetrySource, o)
outCfg.Sources = append(outCfg.Sources, sourceBlock)
} else if w := observability_pipeline.FlattenWebsocketSource(src.ObservabilityPipelineWebsocketSource); w != nil {
sourceBlock.Id = types.StringValue(src.ObservabilityPipelineWebsocketSource.GetId())
sourceBlock.WebsocketSource = append(sourceBlock.WebsocketSource, w)
outCfg.Sources = append(outCfg.Sources, sourceBlock)
}
}

Expand Down
Loading
Loading