types

package
v0.8.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAWSCertificateManager = "AWS Certificate Manager"
	ServiceMSK                   = "Amazon Managed Streaming for Apache Kafka"
	ServiceEC2Other              = "EC2 - Other"
	ServiceELB                   = "Amazon Elastic Load Balancing"
	ServiceVPC                   = "Amazon Virtual Private Cloud"
)

AWS service name constants — single source of truth for Cost Explorer service filters. Frontend constants (cmd/ui/frontend/src/constants/index.ts AWS_SERVICES) should mirror these.

View Source
const (
	MigrateTopicsModeMirror = "mirror"
	MigrateTopicsModeNew    = "new"
)

MigrateTopicsMode values for MirrorTopicsRequest.Mode.

Variables

View Source
var AclMap = map[string]ACLMapping{
	"kafka-cluster:AlterCluster": {
		Operation:       "Alter",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:AlterClusterDynamicConfiguration": {
		Operation:       "AlterConfigs",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:AlterGroup": {
		Operation:       "Read",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTopic": {
		Operation:       "Alter",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTopicDynamicConfiguration": {
		Operation:       "AlterConfigs",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:AlterTransactionalId": {
		Operation:       "Write",
		ResourceType:    "TransactionalId",
		RequiresPattern: true,
	},
	"kafka-cluster:CreateTopic": {
		Operation:       "Create",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DeleteGroup": {
		Operation:       "Delete",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:DeleteTopic": {
		Operation:       "Delete",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeCluster": {
		Operation:       "Describe",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:DescribeClusterDynamicConfiguration": {
		Operation:       "DescribeConfigs",
		ResourceType:    "Cluster",
		RequiresPattern: false,
	},
	"kafka-cluster:DescribeGroup": {
		Operation:       "Describe",
		ResourceType:    "Group",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTopic": {
		Operation:       "Describe",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTopicDynamicConfiguration": {
		Operation:       "DescribeConfigs",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:DescribeTransactionalId": {
		Operation:       "Describe",
		ResourceType:    "TransactionalId",
		RequiresPattern: true,
	},
	"kafka-cluster:ReadData": {
		Operation:       "Read",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:WriteData": {
		Operation:       "Write",
		ResourceType:    "Topic",
		RequiresPattern: true,
	},
	"kafka-cluster:WriteDataIdempotently": {
		Operation:       "IdempotentWrite",
		ResourceType:    "Cluster",
		RequiresPattern: true,
	},
}

https://docs.aws.amazon.com/service-authorization/latest/reference/list_apachekafkaapisforamazonmskclusters.html https://docs.confluent.io/cloud/current/security/access-control/acl.html#acl-resources-and-operations-for-ccloud-summary

Functions

func AllAuthTypes

func AllAuthTypes() []string

AllAuthTypes returns all possible AuthType values as strings This can be called statically without needing an AuthType instance

func FormatQueryDuration added in v0.8.0

func FormatQueryDuration(d time.Duration) string

FormatQueryDuration formats a duration for display, using days when >= 24h. Examples: "5m", "2h30m", "7d2h", "30d".

func NormalizeSaslMechanism added in v0.8.0

func NormalizeSaslMechanism(mechanism string) string

NormalizeSaslMechanism converts shorthand mechanism values (e.g. "SHA256") to the Kafka-standard format (e.g. "SCRAM-SHA-256"). Returns empty string for empty input.

Types

type ACLMapping added in v0.2.1

type ACLMapping struct {
	Operation       string
	ResourceType    string
	RequiresPattern bool
}

type AWSClientInformation added in v0.4.0

type AWSClientInformation struct {
	MskClusterConfig     kafkatypes.Cluster                     `json:"msk_cluster_config"`
	ClientVpcConnections []kafkatypes.ClientVpcConnection       `json:"client_vpc_connections"`
	ClusterOperations    []kafkatypes.ClusterOperationV2Summary `json:"cluster_operations"`
	Nodes                []kafkatypes.NodeInfo                  `json:"nodes"`
	ScramSecrets         []string                               `json:"ScramSecrets"`
	BootstrapBrokers     kafka.GetBootstrapBrokersOutput        `json:"bootstrap_brokers"`
	Policy               kafka.GetClusterPolicyOutput           `json:"policy"`
	CompatibleVersions   kafka.GetCompatibleKafkaVersionsOutput `json:"compatible_versions"`
	ClusterNetworking    ClusterNetworking                      `json:"cluster_networking"`
	Connectors           []ConnectorSummary                     `json:"connectors"`
}

func (*AWSClientInformation) GetAllBootstrapBrokersForAuthType added in v0.4.0

func (c *AWSClientInformation) GetAllBootstrapBrokersForAuthType(authType AuthType) ([]string, error)

Returns all bootstrap brokers for a given auth type.

func (*AWSClientInformation) GetBootstrapBrokersForAuthType added in v0.4.0

func (c *AWSClientInformation) GetBootstrapBrokersForAuthType(authType AuthType) ([]string, error)

Returns only one bootstrap broker per authentication type.

type Acls added in v0.2.1

type Acls struct {
	ResourceType        string `json:"ResourceType"`
	ResourceName        string `json:"ResourceName"`
	ResourcePatternType string `json:"ResourcePatternType"`
	Principal           string `json:"Principal"`
	Host                string `json:"Host"`
	Operation           string `json:"Operation"`
	PermissionType      string `json:"PermissionType"`
}

Preferred over sarama.ResourceAcls because it is flattened vs sarama's nested structure.

type AuthDecision added in v0.8.4

type AuthDecision struct {
	ClusterID      string           `json:"cluster_id"`
	SourceAuths    []string         `json:"source_auths_detected"`
	TargetMappings []AuthMappingRow `json:"target_mappings,omitempty"`
	// OverrideRejected is true when the (cluster-scoped or global)
	// `target_auth_method` override was set to a value outside the
	// recognised enum — the row's `effective_target` reflects the per-
	// source default. The renderer surfaces an inline marker in §4 so
	// a reader scanning the table sees why this cluster's target
	// differs from peers without scrolling to the Actions Needed
	// section to read the typo OQ.
	OverrideRejected bool `json:"override_rejected,omitempty"`
	// RejectedOverrideValue is the customer-supplied invalid value;
	// surfaced in the renderer footnote so the reader recognises the
	// typo at a glance.
	RejectedOverrideValue string `json:"rejected_override_value,omitempty"`
}

AuthDecision is the per-cluster source→target auth mapping. SourceAuths holds the methods detected on the source MSK cluster as stable enum tokens ("scram", "iam", "mtls", "unauth"); the plan does NOT pick one when multiple are enabled — it shows all options.

type AuthMappingRow added in v0.8.4

type AuthMappingRow struct {
	SourceAuth        string `json:"source_auth"`
	EffectiveTarget   string `json:"effective_target"`
	GatewayCompatible bool   `json:"gateway_compatible"`
	TransparentSwap   bool   `json:"transparent_swap"`
	Note              string `json:"note,omitempty"`
	// Source + LastVerified carry per-row provenance from the
	// auth_mapping table in plan-config.yaml — surfaced in the
	// rendered Plan as a footnote so the reviewer can audit where the
	// recommendation comes from.
	Source       string `json:"source,omitempty"`
	LastVerified string `json:"last_verified,omitempty"`
}

AuthMappingRow describes one source→target option. TransparentSwap fires when the CC Gateway can swap credentials without a producer restart (e.g. SCRAM → SASL/PLAIN with API key). GatewayCompatible is false for IAM — IAM clients cannot connect to the gateway and must pre-migrate to SCRAM or mTLS first.

type AuthMethodConfig added in v0.2.7

type AuthMethodConfig struct {
	IAM                      *IAMConfig                      `yaml:"iam,omitempty"`
	SASLScram                *SASLScramConfig                `yaml:"sasl_scram,omitempty"`
	SASLPlain                *SASLPlainConfig                `yaml:"sasl_plain,omitempty"`
	TLS                      *TLSConfig                      `yaml:"tls,omitempty"`
	UnauthenticatedTLS       *UnauthenticatedTLSConfig       `yaml:"unauthenticated_tls,omitempty"`
	UnauthenticatedPlaintext *UnauthenticatedPlaintextConfig `yaml:"unauthenticated_plaintext,omitempty"`
}

func (*AuthMethodConfig) MergeWith added in v0.4.0

func (amc *AuthMethodConfig) MergeWith(existing AuthMethodConfig)

MergeWith preserves existing auth configurations only for auth methods that still exist in the new config

type AuthType

type AuthType string

AuthType represents the different authentication types supported by MSK clusters

const (
	AuthTypeSASLSCRAM                AuthType = "SASL/SCRAM"
	AuthTypeIAM                      AuthType = "SASL/IAM"
	AuthTypeTLS                      AuthType = "TLS"
	AuthTypeUnauthenticatedPlaintext AuthType = "Unauthenticated (Plaintext)"
	AuthTypeUnauthenticatedTLS       AuthType = "Unauthenticated (TLS Encryption)"
	AuthTypeSASLPlain                AuthType = "SASL/PLAIN"
)

func (AuthType) IsValid

func (a AuthType) IsValid() bool

func (AuthType) Values

func (a AuthType) Values() []string

Values returns all possible AuthType values as strings

type BastionHostRequest added in v0.8.0

type BastionHostRequest struct {
	Region                     string   `json:"region"`
	VPCId                      string   `json:"vpc_id"`
	PublicSubnetCidr           string   `json:"public_subnet_cidr"`
	HasExistingInternetGateway bool     `json:"has_existing_internet_gateway"`
	SecurityGroupIds           []string `json:"security_group_ids"`
}

type BrokerType added in v0.6.4

type BrokerType string

----- metrics -----

const (
	BrokerTypeExpress  BrokerType = "express"
	BrokerTypeStandard BrokerType = "standard"
)

type CloudWatchTimeWindow added in v0.4.0

type CloudWatchTimeWindow struct {
	StartTime time.Time
	EndTime   time.Time
	Period    int32
}

type ClusterAuth added in v0.4.0

type ClusterAuth struct {
	Name       string           `yaml:"name"`
	Arn        string           `yaml:"arn"`
	AuthMethod AuthMethodConfig `yaml:"auth_method"`
}

func (ClusterAuth) GetAuthMethods added in v0.4.0

func (ce ClusterAuth) GetAuthMethods() []AuthType

Gets a list of the authentication method(s) selected in the `creds.yaml` file generated during discovery.

func (ClusterAuth) GetSelectedAuthType added in v0.4.0

func (ce ClusterAuth) GetSelectedAuthType() (AuthType, error)

type ClusterCutoverOverride added in v0.8.4

type ClusterCutoverOverride struct {
	ClusterID             string            `json:"cluster_id"`
	Style                 CutoverStyle      `json:"style"`
	SubPattern            CutoverSubPattern `json:"sub_pattern,omitempty"`
	GatewayMediated       GatewayMediated   `json:"gateway_mediated"`
	OverrideRejected      bool              `json:"override_rejected,omitempty"`
	RejectedOverrideValue string            `json:"rejected_override_value,omitempty"`
}

ClusterCutoverOverride captures a single cluster that resolves to a different cutover style than the fleet-wide default. Only the fields that can differ from the fleet decision are carried — alternatives and prereqs come from the fleet entry.

OverrideRejected mirrors AuthDecision's same-named field — set when the customer supplied a per-cluster `downtime_tolerance` (or `sub_pattern`) value that wasn't in the recognised enum. JSON consumers can detect rejected per-cluster overrides structurally without scanning OpenQuestion titles.

type ClusterMetrics

type ClusterMetrics struct {
	MetricMetadata MetricMetadata                     `json:"metadata"`
	Results        []cloudwatchtypes.MetricDataResult `json:"results"`
	QueryInfo      []MetricQueryInfo                  `json:"query_info"`
}

type ClusterNetworking added in v0.2.2

type ClusterNetworking struct {
	VpcId          string       `json:"vpc_id"`
	SubnetIds      []string     `json:"subnet_ids"`
	SecurityGroups []string     `json:"security_groups"`
	Subnets        []SubnetInfo `json:"subnets"`
}

type ClusterPlanInputs added in v0.8.1

type ClusterPlanInputs struct {
	SLATarget                            *string  `yaml:"sla_target,omitempty"                                 json:"sla_target,omitempty"`
	HeadroomFraction                     *float64 `yaml:"headroom_fraction,omitempty"                          json:"headroom_fraction,omitempty"`
	SpikyWorkloadRatio                   *float64 `yaml:"spiky_workload_ratio,omitempty"                       json:"spiky_workload_ratio,omitempty"`
	EnforceSchemasAtTheBroker            *bool    `yaml:"enforce_schemas_at_the_broker,omitempty"              json:"enforce_schemas_at_the_broker,omitempty"`
	RequiresHighThroughputRESTProduceAPI *bool    `yaml:"requires_high_throughput_rest_produce_api,omitempty"  json:"requires_high_throughput_rest_produce_api,omitempty"`
	Requires9995SLAWithinSingleZone      *bool    `yaml:"requires_99_95_sla_within_a_single_zone,omitempty"    json:"requires_99_95_sla_within_a_single_zone,omitempty"`
	TargetCloud                          *string  `yaml:"target_cloud,omitempty"                               json:"target_cloud,omitempty"`
	ExistingVPCConnectivity              *string  `yaml:"existing_vpc_connectivity,omitempty"                  json:"existing_vpc_connectivity,omitempty"`
	CCEgressRequired                     *bool    `yaml:"cc_egress_required,omitempty"                         json:"cc_egress_required,omitempty"`
	ProjectedPNIGatewayCount             *int     `yaml:"projected_pni_gateway_count,omitempty"                json:"projected_pni_gateway_count,omitempty"`
	// TargetAuthMethod is the per-cluster override for the target
	// auth verdict. Same enum as the global field.
	TargetAuthMethod *string `yaml:"target_auth_method,omitempty" json:"target_auth_method,omitempty"`
	// DowntimeTolerance is the per-cluster override for the cutover
	// style. Same enum as the global field. Use when heterogeneous
	// fleets need different cutover styles per cluster — e.g. a
	// latency-sensitive service on Blue/Green while batch jobs run
	// Stop-Restart-Repeat. Without this, the customer would have to
	// slice the state file and run kcp once per cluster subset.
	DowntimeTolerance *string `yaml:"downtime_tolerance,omitempty" json:"downtime_tolerance,omitempty"`
	// SubPattern is the per-cluster override; only meaningful when the
	// resolved style is Stop-Restart-Repeat. Mirrors the global field.
	SubPattern *string `yaml:"sub_pattern,omitempty" json:"sub_pattern,omitempty"`
}

ClusterPlanInputs is the per-cluster override slice of PlanInputs. All fields are optional pointers so the resolver can detect "not set for this cluster" and fall back to the global default.

**Intentionally global-only** (not in this struct):

  • `sizing_percentile` — the Appendix A1 preamble names a single percentile for the whole plan; mixing P95 + P99 in one run would desync the prose. If a customer genuinely needs different percentiles per cluster, run the plan twice with different inputs and merge — explicit beats invisible.

type ClusterSizing added in v0.8.1

type ClusterSizing struct {
	ClusterID string `json:"cluster_id"`
	// SizedInMBps / SizedOutMBps hold the throughput at the configured
	// `sizing_percentile` (default p95; alternates p99, max). Read
	// `plan.inputs.sizing_percentile` to see which percentile was used.
	SizedInMBps        float64 `json:"sized_in_mbps"`
	SizedOutMBps       float64 `json:"sized_out_mbps"`
	PeakInMBps         float64 `json:"peak_in_mbps"`
	PeakOutMBps        float64 `json:"peak_out_mbps"`
	UserPartitions     int     `json:"user_partitions"`
	InternalPartitions int     `json:"internal_partitions"`
	IngressRatio       float64 `json:"ingress_ratio"`
	EgressRatio        float64 `json:"egress_ratio"`
	PartitionRatio     float64 `json:"partition_ratio"`
	MaxRatio           float64 `json:"max_ratio"`
	// MaxRatioDriver names which of the three dimensions produced MaxRatio:
	// "ingress", "egress", or "partitions". Tracked at compute time so the
	// renderer never has to do a float-equality comparison to recover it.
	MaxRatioDriver      string          `json:"max_ratio_driver,omitempty"`
	SizedECKU           int             `json:"sized_ecku"`
	SLAFloorECKU        int             `json:"sla_floor_ecku"`
	FinalECKU           int             `json:"final_ecku"`
	PeakBurstInRatio    float64         `json:"peak_burst_in_ratio"`
	PeakBurstOutRatio   float64         `json:"peak_burst_out_ratio"`
	PeakBurstECKU       int             `json:"peak_burst_ecku"`
	PeakBurstPctOfPLCap float64         `json:"peak_burst_pct_of_pl_cap"`
	SpikyIngress        bool            `json:"spiky_ingress"`
	SpikyEgress         bool            `json:"spiky_egress"`
	Citations           []FieldCitation `json:"citations"`

	// Degraded is true when throughput metrics were missing from the state
	// file. Numbers fall back to the SLA floor and the renderer surfaces
	// the gap rather than silently asserting a sized eCKU.
	Degraded       bool   `json:"degraded,omitempty"`
	DegradedReason string `json:"degraded_reason,omitempty"`

	// InputsMissing names load-bearing scan signals that weren't
	// available when sizing was computed (e.g. `"topics"`, `"acls"`,
	// `"brokers"`). The verdict from downstream decisions may still be
	// solid if driven by customer-declared flags; the renderer reads
	// this list to mark sizing as provisional rather than blanket-
	// deferring the cluster.
	InputsMissing []string `json:"inputs_missing,omitempty"`
}

type ClusterType added in v0.8.1

type ClusterType string

ClusterType represents the Confluent Cloud cluster verdict. Freight is in the Confluent product but not produced by DecideClusterType today — when a rule that emits Freight lands, add the constant then.

const (
	ClusterTypeEnterprise ClusterType = "Enterprise"
	ClusterTypeDedicated  ClusterType = "Dedicated"
)

func (ClusterType) IsValid added in v0.8.1

func (c ClusterType) IsValid() bool

type ClusterTypeDecision added in v0.8.1

type ClusterTypeDecision struct {
	ClusterID string             `json:"cluster_id"`
	Verdict   ClusterType        `json:"verdict"`
	Triggers  []HardLimitTrigger `json:"triggers,omitempty"`
	// Topology is populated for Dedicated verdicts (MZ default; SZ when the
	// 99.95% single-zone SLA rule fires). Empty for Enterprise.
	Topology Topology `json:"topology,omitempty"`
	// FinalCKU mirrors the sizing's FinalECKU under the Dedicated unit
	// (Confluent Kafka Unit). Set only when Verdict == Dedicated.
	FinalCKU *int `json:"final_cku,omitempty"`
	// InputsMissing names load-bearing scan / plan-input signals that
	// weren't available when this decision was computed (e.g. `"topics"`,
	// `"acls"`). **Observational only** — set post-hoc in
	// `PlanService.Build` after `DecideClusterType` has already run; the
	// Verdict itself was computed against whatever inputs WERE present.
	// Markdown reads this to flag the sizing column as provisional;
	// JSON consumers can branch on the list.
	InputsMissing []string `json:"inputs_missing,omitempty"`
	// EvaluatedRules is the full audit trail for the hard-limit catalog
	// against this cluster — every rule's outcome (fired / not_fired /
	// skipped) with evidence. Read-only audit shape; the renderer
	// surfaces it as a collapsed appendix.
	EvaluatedRules []RuleEvaluation `json:"evaluated_rules,omitempty"`
}

type ConnectorSummary added in v0.4.0

type ConnectorSummary struct {
	ConnectorArn                     string                                                        `json:"connector_arn"`
	ConnectorName                    string                                                        `json:"connector_name"`
	ConnectorState                   string                                                        `json:"connector_state"`
	CreationTime                     string                                                        `json:"creation_time"`
	KafkaCluster                     kafkaconnecttypes.ApacheKafkaClusterDescription               `json:"kafka_cluster"`
	KafkaClusterClientAuthentication kafkaconnecttypes.KafkaClusterClientAuthenticationDescription `json:"kafka_cluster_client_authentication"`
	Capacity                         kafkaconnecttypes.CapacityDescription                         `json:"capacity"`
	Plugins                          []kafkaconnecttypes.PluginDescription                         `json:"plugins"`
	ConnectorConfiguration           map[string]string                                             `json:"connector_configuration"`
}

type CostAggregate added in v0.4.0

type CostAggregate struct {
	Sum     *float64 `json:"sum"`
	Average *float64 `json:"avg"`
	Maximum *float64 `json:"max"`
	Minimum *float64 `json:"min"`
}

type CostInformation added in v0.4.0

type CostInformation struct {
	CostMetadata CostMetadata                     `json:"metadata"`
	CostResults  []costexplorertypes.ResultByTime `json:"results"`
	QueryInfo    CostQueryInfo                    `json:"query_info"`
}

type CostMetadata added in v0.4.0

type CostMetadata struct {
	StartDate   time.Time           `json:"start_date"`
	EndDate     time.Time           `json:"end_date"`
	Granularity string              `json:"granularity"`
	Tags        map[string][]string `json:"tags"`
	Services    []string            `json:"services"`
}

type CostQueryInfo added in v0.6.9

type CostQueryInfo struct {
	TimePeriod      CostQueryTimePeriod `json:"time_period"`
	Granularity     string              `json:"granularity"`
	Services        []string            `json:"services"`
	Regions         []string            `json:"regions"`
	GroupBy         []string            `json:"group_by"`
	Metrics         []string            `json:"metrics"`
	Tags            map[string][]string `json:"tags,omitempty"`
	AWSCLICommand   string              `json:"aws_cli_command"`
	ConsoleURL      string              `json:"console_url"`
	AggregationNote string              `json:"aggregation_note"`
}

type CostQueryTimePeriod added in v0.6.9

type CostQueryTimePeriod struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

----- costs -----

type CostReconciliationSection added in v0.8.4

type CostReconciliationSection struct {
	Candidates []HiddenClusterCandidate `json:"candidates"`
}

CostReconciliationSection lists the candidate hidden MSK clusters per region. Nil when cost data is empty or the diff is clean. When cost data IS empty, the section nils and the detector emits an OQ pointing at `kcp report costs`.

type Credentials added in v0.2.7

type Credentials struct {
	Regions []RegionAuth `yaml:"regions"`
}

func NewCredentialsFrom added in v0.4.0

func NewCredentialsFrom(fromCredentials *Credentials) *Credentials

func NewCredentialsFromFile added in v0.4.0

func NewCredentialsFromFile(credentialsYamlPath string) (*Credentials, []error)

func (*Credentials) FindClusterByArn added in v0.7.0

func (c *Credentials) FindClusterByArn(arn string) (*ClusterAuth, error)

FindClusterByArn searches all regions for a cluster matching the given ARN.

func (*Credentials) ToYaml added in v0.2.7

func (c *Credentials) ToYaml() ([]byte, error)

func (*Credentials) UpsertRegion added in v0.4.0

func (c *Credentials) UpsertRegion(newRegion RegionAuth)

UpsertRegion inserts a new region or updates an existing one by name Automatically preserves existing cluster auth configurations

func (Credentials) Validate added in v0.2.7

func (c Credentials) Validate() (bool, []error)

func (*Credentials) WriteToFile added in v0.2.7

func (c *Credentials) WriteToFile(filePath string) error

type CutoverDecision added in v0.8.4

type CutoverDecision struct {
	Style                CutoverStyle         `json:"style"`
	SubPattern           CutoverSubPattern    `json:"sub_pattern,omitempty"` // only when Style == StopRestartRepeat
	GatewayMediated      GatewayMediated      `json:"gateway_mediated"`
	RecommendationStatus RecommendationStatus `json:"recommendation_status"`
	// AlternativesShown lists the styles the renderer explains for
	// trust but doesn't recommend — gives the reader the full pattern
	// set without forcing a deeper decision tree.
	AlternativesShown []CutoverStyle `json:"alternatives_shown_for_trust,omitempty"`
	Prereqs           []Prereq       `json:"prereqs,omitempty"`
}

CutoverDecision is the fleet-wide cutover plan — applied to every cluster that doesn't carry a per-cluster override.

type CutoverStyle added in v0.8.4

type CutoverStyle string

CutoverStyle is the strategic shape of the cutover. Mapped 1:1 from `downtime_tolerance` in plan-inputs.yaml.

const (
	// String values match the customer-facing tokens (hyphenated).
	// Go identifiers can't contain hyphens; the renderer translates these
	// to display labels via cutoverStyleName.
	CutoverStopRestartRepeat CutoverStyle = "Stop-Restart-Repeat"
	CutoverStopWaitRestart   CutoverStyle = "Stop-Wait-Restart"
	CutoverRestartAllAtOnce  CutoverStyle = "Restart-All-At-Once"
	CutoverBlueGreen         CutoverStyle = "Blue/Green"
)

type CutoverSubPattern added in v0.8.4

type CutoverSubPattern string

CutoverSubPattern is the team-topology choice within Stop-Restart-Repeat. Empty for any other CutoverStyle.

const (
	SubPatternUnset        CutoverSubPattern = ""
	SubPatternAppByApp     CutoverSubPattern = "app-by-app"
	SubPatternTopicByTopic CutoverSubPattern = "topic-by-topic"
)

type DestinationType added in v0.8.4

type DestinationType string

DestinationType identifies which Confluent Cloud variant a migration targets. It gates linking-based create-asset paths that are unavailable on Confluent Cloud for Government (Cluster Linking, Schema Linking).

const (
	// DestinationCC is commercial (Standard) Confluent Cloud.
	DestinationCC DestinationType = "cc"
	// DestinationCCGov is Confluent Cloud for Government.
	DestinationCCGov DestinationType = "cc-gov"
)

func ToDestinationType added in v0.8.4

func ToDestinationType(input string) (DestinationType, error)

ToDestinationType parses a CLI/declaration value into a DestinationType. An empty or unrecognised value returns an error naming the allowed values so callers can surface it directly.

func (DestinationType) IsGov added in v0.8.4

func (d DestinationType) IsGov() bool

IsGov reports whether the destination is Confluent Cloud for Government.

func (DestinationType) IsValid added in v0.8.4

func (d DestinationType) IsValid() bool

type DiscoveredClient added in v0.5.2

type DiscoveredClient struct {
	CompositeKey string    `json:"composite_key"`
	ClientId     string    `json:"client_id"`
	Role         string    `json:"role"`
	Topic        string    `json:"topic"`
	Auth         string    `json:"auth"`
	Principal    string    `json:"principal"`
	Timestamp    time.Time `json:"timestamp"`
}

type DiscoveredCluster added in v0.4.0

type DiscoveredCluster struct {
	Name                        string                      `json:"name"`
	Arn                         string                      `json:"arn"`
	Region                      string                      `json:"region"`
	ClusterMetrics              ClusterMetrics              `json:"metrics"`
	AWSClientInformation        AWSClientInformation        `json:"aws_client_information"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
}

type DiscoveredRegion added in v0.4.0

type DiscoveredRegion struct {
	Name           string                                      `json:"name"`
	Configurations []kafka.DescribeConfigurationRevisionOutput `json:"configurations"`
	Costs          CostInformation                             `json:"costs"`
	Clusters       []DiscoveredCluster                         `json:"clusters"`
	// internal only - exclude from JSON output
	ClusterArns []string `json:"-"`
}

func (*DiscoveredRegion) RefreshClusters added in v0.4.0

func (dr *DiscoveredRegion) RefreshClusters(newClusters []DiscoveredCluster)

RefreshClusters replaces the cluster list but merges KafkaAdminClientInformation from existing clusters New discoveries take precedence over old values (only uses old values when new values are empty/nil)

type EffortSignal added in v0.8.4

type EffortSignal struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	// Count is the integer signal value. `nil` means the signal is
	// structurally unobservable (the upstream scan didn't run);
	// `0` means the scan ran and returned zero hits.
	Count *int   `json:"count"`
	Note  string `json:"note,omitempty"`
}

EffortSignal is one quantitative input the customer's PM consumes to scope migration effort. Count is the raw integer the signal produced (e.g. number of IAM-auth clients). Count is `*int` (nil = unobservable) so a missing client-inventory scan reads as "unknown", not "zero". Note carries any caveat the spec calls out (e.g. MM2 `IdentityReplicationPolicy` undercounts checkpoint topics).

type EffortSignalsSection added in v0.8.4

type EffortSignalsSection struct {
	Signals []EffortSignal `json:"signals"`
}

EffortSignalsSection is the fleet-wide list of effort signals.

type ExtOutboundClusterKafkaBroker added in v0.5.0

type ExtOutboundClusterKafkaBroker struct {
	ID        string                            `json:"broker_id"`
	SubnetID  string                            `json:"subnet_id"`
	Endpoints []ExtOutboundClusterKafkaEndpoint `json:"endpoints"`
}

type ExtOutboundClusterKafkaEndpoint added in v0.5.0

type ExtOutboundClusterKafkaEndpoint struct {
	Host string `json:"host"`
	Port int    `json:"port"`
	IP   string `json:"ip"`
}

type FieldCitation added in v0.8.1

type FieldCitation struct {
	Path  string `json:"path"`
	Value any    `json:"value"`
}

type GatewayMediated added in v0.8.4

type GatewayMediated string

GatewayMediated is tri-state: true / false / not_applicable. The last value fires only on Blue/Green, where the gateway doesn't sit on the cutover step at all.

const (
	GatewayMediatedTrue          GatewayMediated = "true"
	GatewayMediatedFalse         GatewayMediated = "false"
	GatewayMediatedNotApplicable GatewayMediated = "not_applicable"
)

type GlueSchema added in v0.7.2

type GlueSchema struct {
	SchemaName string              `json:"schema_name"`
	SchemaArn  string              `json:"schema_arn"`
	DataFormat string              `json:"data_format"`
	Versions   []GlueSchemaVersion `json:"versions"`
	Latest     *GlueSchemaVersion  `json:"latest_version"`
}

type GlueSchemaRegistryInformation added in v0.7.2

type GlueSchemaRegistryInformation struct {
	RegistryName string       `json:"registry_name"`
	RegistryArn  string       `json:"registry_arn"`
	Region       string       `json:"region"`
	Schemas      []GlueSchema `json:"schemas"`
}

type GlueSchemaRegistryMigrationConfig added in v0.7.2

type GlueSchemaRegistryMigrationConfig struct {
	Migrate      bool         `json:"migrate"`
	RegistryName string       `json:"registry_name"`
	Region       string       `json:"region"`
	Schemas      []GlueSchema `json:"schemas"`
}

type GlueSchemaVersion added in v0.7.2

type GlueSchemaVersion struct {
	SchemaDefinition string    `json:"schema_definition"`
	DataFormat       string    `json:"data_format"`
	VersionNumber    int64     `json:"version_number"`
	Status           string    `json:"status"`
	CreatedDate      time.Time `json:"created_date"`
}

type HardLimitTrigger added in v0.8.1

type HardLimitTrigger struct {
	RowID       string `json:"row_id"`
	Description string `json:"description"`
	Evidence    string `json:"evidence"`
	// CustomerDeclared marks rules whose only signal is a customer-set
	// `plan-inputs.yaml` flag. Renderer surfaces a cost callout on these
	// so a wrong `true` doesn't quietly flip the verdict from Enterprise
	// to Dedicated (Dedicated has a higher monthly cost).
	CustomerDeclared bool `json:"customer_declared,omitempty"`
}

type HiddenClusterCandidate added in v0.8.4

type HiddenClusterCandidate struct {
	Region         string  `json:"region"`
	InstanceType   string  `json:"instance_type"`
	TotalSpend     float64 `json:"total_spend"`
	MonthsObserved int     `json:"months_observed,omitempty"`
	DaysObserved   int     `json:"days_observed,omitempty"`
}

HiddenClusterCandidate is one MSK instance type that shows up in the AWS cost report but was NOT discovered by `kcp discover`. Sorted by TotalSpend desc; the customer (FinOps / cloud lead) decides which candidates are real.

type IAMConfig added in v0.2.7

type IAMConfig struct {
	Use bool `yaml:"use"`
}

type JolokiaAuthConfig added in v0.8.0

type JolokiaAuthConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

JolokiaAuthConfig contains authentication credentials for Jolokia

type JolokiaConfig added in v0.8.0

type JolokiaConfig struct {
	Endpoints []string           `yaml:"endpoints"`
	Auth      *JolokiaAuthConfig `yaml:"auth,omitempty"`
	TLS       *JolokiaTLSConfig  `yaml:"tls,omitempty"`
}

JolokiaConfig contains Jolokia monitoring configuration for a cluster

type JolokiaTLSConfig added in v0.8.0

type JolokiaTLSConfig struct {
	CACert             string `yaml:"ca_cert,omitempty"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify,omitempty"`
}

JolokiaTLSConfig contains TLS configuration for Jolokia connections

type KafkaAdminClientInformation added in v0.4.0

type KafkaAdminClientInformation struct {
	ClusterID             string                 `json:"cluster_id"`
	DiscoveredBrokers     []string               `json:"discovered_brokers,omitempty"`
	SaslMechanism         string                 `json:"sasl_mechanism,omitempty"`
	Topics                *Topics                `json:"topics"`
	Acls                  []Acls                 `json:"acls"`
	SelfManagedConnectors *SelfManagedConnectors `json:"self_managed_connectors"`
}

func (*KafkaAdminClientInformation) CalculateTopicSummary added in v0.4.0

func (c *KafkaAdminClientInformation) CalculateTopicSummary() TopicSummary

func (*KafkaAdminClientInformation) MergeFrom added in v0.6.0

MergeFrom merges values from another KafkaAdminClientInformation New discoveries are added, old data is preserved, duplicates are merged (new takes precedence)

func (*KafkaAdminClientInformation) SetSelfManagedConnectors added in v0.4.2

func (c *KafkaAdminClientInformation) SetSelfManagedConnectors(connectors []SelfManagedConnector)

func (*KafkaAdminClientInformation) SetTopics added in v0.4.0

func (c *KafkaAdminClientInformation) SetTopics(topicDetails []TopicDetails)

type KcpBuildInfo added in v0.3.1

type KcpBuildInfo struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Date    string `json:"date"`
}

type MSKSourcesState added in v0.8.0

type MSKSourcesState struct {
	Regions []DiscoveredRegion `json:"regions"`
}

MSKSourcesState contains all MSK-specific data

type Manifest

type Manifest struct {
	MigrationInfraType MigrationType `json:"migration_infra_type"`
}

type MetricAggregate added in v0.4.0

type MetricAggregate struct {
	Average *float64 `json:"avg"`
	Maximum *float64 `json:"max"`
	Minimum *float64 `json:"min"`
	P95     *float64 `json:"p95"`
	P99     *float64 `json:"p99"`
	// Count is the sample size of the aggregate. With `omitempty`,
	// "unknown" and "exactly 0 samples" both render as absent — treat
	// absence as "no sample data".
	Count int `json:"count,omitempty"`
}

type MetricBackend added in v0.8.0

type MetricBackend string

MetricBackend represents the metrics collection backend

const (
	MetricBackendCloudWatch MetricBackend = "cloudwatch"
	MetricBackendJolokia    MetricBackend = "jolokia"
	MetricBackendPrometheus MetricBackend = "prometheus"
)

type MetricMetadata added in v0.4.0

type MetricMetadata struct {
	ClusterType          string    `json:"cluster_type"`
	NumberOfBrokerNodes  int       `json:"number_of_broker_nodes"`
	KafkaVersion         string    `json:"kafka_version"`
	BrokerAzDistribution string    `json:"broker_az_distribution"`
	EnhancedMonitoring   string    `json:"enhanced_monitoring"`
	StartDate            time.Time `json:"start_date"`
	EndDate              time.Time `json:"end_date"`
	Period               int32     `json:"period"`

	FollowerFetching bool       `json:"follower_fetching"`
	InstanceType     string     `json:"instance_type"`
	TieredStorage    bool       `json:"tiered_storage"`
	BrokerType       BrokerType `json:"broker_type"`
}

type MetricQueryInfo added in v0.6.9

type MetricQueryInfo struct {
	MetricName string        `json:"metric_name"`
	SourceType MetricBackend `json:"source_type,omitempty"`

	// CloudWatch fields
	Namespace         string `json:"namespace,omitempty"`
	Dimensions        string `json:"dimensions,omitempty"`
	Statistic         string `json:"statistic,omitempty"`
	Period            int32  `json:"period,omitempty"`
	SearchExpression  string `json:"search_expression,omitempty"`
	MathExpression    string `json:"math_expression,omitempty"`
	AWSCLICommand     string `json:"aws_cli_command,omitempty"`
	ConsoleSourceJSON string `json:"console_source_json,omitempty"`

	// Jolokia fields
	MBeanPath  string `json:"mbean_path,omitempty"`
	JolokiaURL string `json:"jolokia_url,omitempty"`

	// Prometheus fields
	PromQLQuery          string `json:"promql_query,omitempty"`
	PrometheusURL        string `json:"prometheus_url,omitempty"`
	PrometheusMetricName string `json:"prometheus_metric_name,omitempty"`

	// Shared fields
	CurlCommand     string            `json:"curl_command,omitempty"` // Jolokia curl or Prometheus API curl
	QueryDuration   string            `json:"query_duration,omitempty"`
	AggregationNote string            `json:"aggregation_note"`
	LabelFilter     map[string]string `json:"label_filter,omitempty"`
}

type MigrateAclsRequest added in v0.5.2

type MigrateAclsRequest struct {
	SelectedPrincipals        []string `json:"selected_principals"`
	TargetClusterId           string   `json:"target_cluster_id"`
	TargetClusterRestEndpoint string   `json:"target_cluster_rest_endpoint"`
	PreventDestroy            bool     `json:"prevent_destroy"`

	SourceType string `json:"source_type"`
	ClusterId  string `json:"cluster_id"`

	// This is not sent by the UI payload but instead built by the API service before being passed on to the HCL service.
	AclsByPrincipal map[string][]Acls `json:"-"`
}

type MigrateGlueSchemasRequest added in v0.7.2

type MigrateGlueSchemasRequest struct {
	ConfluentCloudSchemaRegistryURL string                              `json:"confluent_cloud_schema_registry_url"`
	GlueRegistries                  []GlueSchemaRegistryMigrationConfig `json:"glue_registries"`
}

type MigrateSchemasRequest added in v0.5.0

type MigrateSchemasRequest struct {
	ConfluentCloudSchemaRegistryURL string                         `json:"confluent_cloud_schema_registry_url"`
	SchemaRegistries                []SchemaRegistryExporterConfig `json:"schema_registries"`
}

type MigrationInfraTerraformModule added in v0.5.0

type MigrationInfraTerraformModule struct {
	Name            string            `json:"name"`
	MainTf          string            `json:"main.tf"`
	VariablesTf     string            `json:"variables.tf"`
	OutputsTf       string            `json:"outputs.tf"`
	VersionsTf      string            `json:"versions.tf"`
	AdditionalFiles map[string]string `json:"additional_files"`
}

MigrationInfraTerraformModule represents a Terraform module within the migration infrastructure configuration. Each module contains its own Terraform files and additional assets.

type MigrationInfraTerraformProject added in v0.5.0

type MigrationInfraTerraformProject struct {
	MainTf           string                          `json:"main.tf"`
	ProvidersTf      string                          `json:"providers.tf"`
	VariablesTf      string                          `json:"variables.tf"`
	OutputsTf        string                          `json:"outputs.tf"`
	ReadmeMd         string                          `json:"README.md"`
	InputsAutoTfvars string                          `json:"inputs.auto.tfvars"`
	Modules          []MigrationInfraTerraformModule `json:"modules"`
}

MigrationInfraTerraformProject represents the complete Terraform configuration for migration infrastructure. "project" = root config + modules

type MigrationScriptsTerraformFolder added in v0.5.0

type MigrationScriptsTerraformFolder struct {
	Name             string            `json:"name"`
	MainTf           string            `json:"main.tf"`
	ProvidersTf      string            `json:"providers.tf"`
	VariablesTf      string            `json:"variables.tf"`
	InputsAutoTfvars string            `json:"inputs.auto.tfvars"`
	AdditionalFiles  map[string]string `json:"additional_files,omitempty"`
}

MigrationScriptsTerraformFolder represents a Terraform folder within the migration scripts

type MigrationScriptsTerraformProject added in v0.5.0

type MigrationScriptsTerraformProject struct {
	// not really a module, but its the same structure
	Folders []MigrationScriptsTerraformFolder `json:"modules"`
}

MigrationScriptsTerraformProject represents the complete Terraform configuration for migration scripts

type MigrationType added in v0.5.0

type MigrationType int
const (
	PublicMskEndpoints                   MigrationType = 1
	ExternalOutboundClusterLink          MigrationType = 2
	ExternalOutboundClusterLinkPlaintext MigrationType = 3
	JumpClusterSaslScram                 MigrationType = 4
	JumpClusterIam                       MigrationType = 5
)

func ToMigrationType added in v0.5.0

func ToMigrationType(input string) (MigrationType, error)

func (MigrationType) IsValid added in v0.5.0

func (m MigrationType) IsValid() bool

func (MigrationType) RequiresSaslScram added in v0.8.0

func (m MigrationType) RequiresSaslScram() bool

type MigrationWizardRequest added in v0.5.0

type MigrationWizardRequest struct {
	HasPublicEndpoints bool `json:"has_public_brokers"`

	VpcId string `json:"vpc_id"`

	UseJumpClusters            bool                            `json:"use_jump_clusters"`
	ExtOutboundSecurityGroupId string                          `json:"ext_outbound_security_group_id"`
	ExtOutboundSubnetId        string                          `json:"ext_outbound_subnet_id"`
	ExtOutboundBrokers         []ExtOutboundClusterKafkaBroker `json:"source_kafka_brokers"`

	ExistingPrivateLinkVpceId string `json:"existing_private_link_vpce_id"`

	HasExistingInternetGateway bool `json:"has_existing_internet_gateway"`

	JumpClusterInstanceType        string   `json:"jump_cluster_instance_type"`
	JumpClusterBrokerStorage       int      `json:"jump_cluster_broker_storage"`
	JumpClusterBrokerSubnetCidr    []string `json:"jump_cluster_broker_subnet_cidr"`
	JumpClusterSetupHostSubnetCidr string   `json:"jump_cluster_setup_host_subnet_cidr"`

	JumpClusterAuthType             string `json:"jump_cluster_auth_type"`
	SourceClusterId                 string `json:"source_cluster_id"`
	JumpClusterIamAuthRoleName      string `json:"jump_cluster_iam_auth_role_name"`
	SourceSaslScramBootstrapServers string `json:"source_sasl_scram_bootstrap_servers"`
	SourceSaslScramMechanism        string `json:"source_sasl_scram_mechanism"`
	SourcePlaintextBootstrapServers string `json:"source_plaintext_bootstrap_servers"`
	SourceSaslIamBootstrapServers   string `json:"source_sasl_iam_bootstrap_servers"`
	SourceRegion                    string `json:"source_region"`
	TargetEnvironmentId             string `json:"target_environment_id"`
	TargetClusterId                 string `json:"target_cluster_id"`
	TargetRestEndpoint              string `json:"target_rest_endpoint"`
	TargetBootstrapEndpoint         string `json:"target_bootstrap_endpoint"`
	ClusterLinkName                 string `json:"cluster_link_name"`
	TargetClusterType               string `json:"target_cluster_type"`
}

type MirrorTopicsRequest added in v0.5.0

type MirrorTopicsRequest struct {
	// SelectedTopics is the legacy name-only list sent by the UI wizard. The CLI
	// populates Topics instead; the HCL service falls back to SelectedTopics when
	// Topics is empty (mirror-mode UI path only — new mode requires Topics).
	SelectedTopics []string `json:"selected_topics"`
	// Topics carries the full topic details (partitions, configs) needed by new mode.
	// Not part of the JSON wire format — the CLI populates this from state directly.
	Topics                    []TopicDetails `json:"-"`
	ClusterLinkName           string         `json:"cluster_link_name"`
	TargetClusterId           string         `json:"target_cluster_id"`
	TargetClusterRestEndpoint string         `json:"target_cluster_rest_endpoint"`
	// Mode selects the generator: "mirror" emits confluent_kafka_mirror_topic
	// resources; "new" emits confluent_kafka_topic resources with no data forward.
	Mode            string   `json:"mode"`
	IncludePatterns []string `json:"topics_include"`
	ExcludePatterns []string `json:"topics_exclude"`

	// SourceType and ClusterId identify the source cluster in the loaded state
	// file. The UI wizard sends these as hidden fields so the API handler can
	// hydrate Topics from state for --mode new. The CLI populates Topics
	// directly and leaves these empty.
	SourceType string `json:"source_type"`
	ClusterId  string `json:"cluster_id"`
}

MirrorTopicsRequest carries the inputs for `kcp create-asset migrate-topics` in both --mode mirror and --mode new. The name is kept for backward compatibility with the UI wire format; consider renaming to MigrateTopicsRequest in a future change.

type Networking added in v0.8.1

type Networking string

Networking represents the per-cluster networking verdict.

const (
	NetworkingPrivateLink    Networking = "PrivateLink"
	NetworkingPNI            Networking = "PNI"
	NetworkingTransitGateway Networking = "TransitGateway"
	NetworkingVPCPeering     Networking = "VPCPeering"
)

func (Networking) IsValid added in v0.8.1

func (n Networking) IsValid() bool

type NetworkingDecision added in v0.8.1

type NetworkingDecision struct {
	ClusterID       string     `json:"cluster_id"`
	Verdict         Networking `json:"verdict"`
	PeakBurstECKU   int        `json:"peak_burst_ecku"`
	PercentageOfCap float64    `json:"percentage_of_cap"`
	Reason          string     `json:"reason"`
	// InputsMissing — see ClusterTypeDecision.InputsMissing. Populated
	// in lockstep so JSON consumers see the same gating signal on both
	// decisions for an affected cluster. **JSON-consumer-only**: the
	// markdown renderer reads the sister field on `ClusterTypeDecision`
	// (and the same list on `ClusterSizing`) — this copy is here so
	// downstream JSON branching doesn't need a cross-reference lookup.
	InputsMissing []string `json:"inputs_missing,omitempty"`
}

type OSKClusterAuth added in v0.8.0

type OSKClusterAuth struct {
	ID                    string                `yaml:"id"`
	BootstrapServers      []string              `yaml:"bootstrap_servers"`
	AuthMethod            AuthMethodConfig      `yaml:"auth_method"`
	InsecureSkipTLSVerify bool                  `yaml:"insecure_skip_tls_verify,omitempty"` // Only set true for test environments with self-signed certs
	Metadata              OSKCredentialMetadata `yaml:"metadata,omitempty"`
	Jolokia               *JolokiaConfig        `yaml:"jolokia,omitempty"`
	Prometheus            *PrometheusConfig     `yaml:"prometheus,omitempty"`
}

OSKClusterAuth contains authentication details for a single OSK cluster

func (OSKClusterAuth) GetAuthMethods added in v0.8.0

func (c OSKClusterAuth) GetAuthMethods() []AuthType

GetAuthMethods returns the enabled authentication methods for this cluster

func (OSKClusterAuth) GetSelectedAuthType added in v0.8.0

func (c OSKClusterAuth) GetSelectedAuthType() (AuthType, error)

GetSelectedAuthType returns the selected auth type for the cluster

func (OSKClusterAuth) HasJolokiaConfig added in v0.8.0

func (c OSKClusterAuth) HasJolokiaConfig() bool

HasJolokiaConfig returns true if the cluster has Jolokia configuration

func (OSKClusterAuth) HasPrometheusConfig added in v0.8.0

func (c OSKClusterAuth) HasPrometheusConfig() bool

HasPrometheusConfig returns true if the cluster has Prometheus configuration

type OSKClusterMetadata added in v0.8.0

type OSKClusterMetadata struct {
	Environment  string            `json:"environment,omitempty"`
	Location     string            `json:"location,omitempty"`
	KafkaVersion string            `json:"kafka_version,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	LastScanned  time.Time         `json:"last_scanned"`
}

OSKClusterMetadata contains optional metadata about OSK clusters

type OSKCredentialMetadata added in v0.8.0

type OSKCredentialMetadata struct {
	Environment string            `yaml:"environment,omitempty"`
	Location    string            `yaml:"location,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
}

OSKCredentialMetadata allows users to add optional organizational metadata

type OSKCredentials added in v0.8.0

type OSKCredentials struct {
	Clusters []OSKClusterAuth `yaml:"clusters"`
}

OSKCredentials represents the apache-kafka-credentials.yaml file

func NewOSKCredentialsFromFile added in v0.8.0

func NewOSKCredentialsFromFile(credentialsYamlPath string) (*OSKCredentials, []error)

NewOSKCredentialsFromFile loads OSK credentials from a YAML file

func (OSKCredentials) Validate added in v0.8.0

func (c OSKCredentials) Validate() (bool, []error)

Validate checks that the credentials file is valid

func (*OSKCredentials) WriteToFile added in v0.8.0

func (c *OSKCredentials) WriteToFile(filePath string) error

WriteToFile writes the credentials to a YAML file

type OSKDiscoveredCluster added in v0.8.0

type OSKDiscoveredCluster struct {
	ID                          string                      `json:"id"`
	BootstrapServers            []string                    `json:"bootstrap_servers"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	ClusterMetrics              *ProcessedClusterMetrics    `json:"metrics,omitempty"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
	Metadata                    OSKClusterMetadata          `json:"metadata"`
}

OSKDiscoveredCluster represents a discovered OSK cluster

type OSKSourcesState added in v0.8.0

type OSKSourcesState struct {
	Clusters []OSKDiscoveredCluster `json:"clusters"`
}

OSKSourcesState contains all OSK-specific data

type OpenQuestion added in v0.8.1

type OpenQuestion struct {
	ID         string `json:"id"`
	ClusterID  string `json:"cluster_id,omitempty"`
	Title      string `json:"title"`
	Body       string `json:"body"`
	HowToClose string `json:"how_to_close"`
}

OpenQuestion is a per-cluster (or plan-level) gap the customer needs to close before the Plan recommendation is fully reliable. State-file gaps (missing metrics, missing ACLs) resolve by re-running a `kcp scan` command; inferred-signal questions (spiky workload) resolve by acknowledging or overriding the input.

type Plan added in v0.8.1

type Plan struct {
	Header              PlanHeader            `json:"header"`
	Inputs              PlanInputsResolved    `json:"inputs"`
	SourceEnvironment   SourceEnvironment     `json:"source_environment"`
	Sizing              []ClusterSizing       `json:"sizing"`
	ClusterTypeDecision []ClusterTypeDecision `json:"cluster_type_decision"`
	NetworkingDecision  []NetworkingDecision  `json:"networking_decision"`
	// Cutover is the fleet-wide cutover decision — the default style
	// applied to every cluster that doesn't carry a per-cluster
	// override in CutoverOverrides. Nil when no clusters were found in
	// the state file.
	Cutover *CutoverDecision `json:"cutover,omitempty"`
	// CutoverOverrides carries clusters whose resolved
	// `downtime_tolerance` (or `sub_pattern`) differs from the fleet
	// — only the clusters that diverge appear here, so an
	// all-homogeneous fleet keeps this slice empty. Heterogeneous
	// fleets previously had to slice the state file and run kcp once
	// per subset; per-cluster overrides remove that workaround.
	CutoverOverrides []ClusterCutoverOverride `json:"cutover_overrides,omitempty"`
	// Auth is per-cluster — source auth methods differ across MSK clusters
	// in the same fleet, so each gets its own source→target mapping.
	Auth []AuthDecision `json:"auth,omitempty"`
	// Schema is fleet-wide (the schema registry is one shared system,
	// not per-cluster). Nil when the section is omitted — currently the
	// `schemaless` path (`sr_detected == none` AND
	// `schema_strategy == no_schemas`).
	Schema *SchemaDecision `json:"schema,omitempty"`
	// RedFlags surfaces the boolean trigger rows over the Plan + state
	// file. Triggered rows are items to discuss with the SE; each row
	// carries its own evidence (field path + value) so the discussion
	// is grounded in the scan, not on inference.
	RedFlags *RedFlagsSection `json:"red_flags,omitempty"`
	// EffortSignals is the list of quantitative signals the customer's
	// PM consumes to scope migration effort. Counts only, no
	// day-estimate.
	EffortSignals *EffortSignalsSection `json:"effort_signals,omitempty"`
	// TieredStorage is a per-cluster section describing the
	// three-dimension trade-off (mechanism / duration / cost direction)
	// for clusters with MSK tiered storage enabled. Nil when no source
	// cluster has TIERED storage.
	TieredStorage *TieredStorageSection `json:"tiered_storage,omitempty"`
	// CostReconciliation lists MSK clusters that show up in the AWS
	// cost report but were NOT discovered by `kcp discover`. Sorted by
	// TotalSpend desc. Nil when cost data is empty or the diff is
	// clean.
	CostReconciliation *CostReconciliationSection `json:"cost_reconciliation,omitempty"`
	SizingAppendix     []SizingMathDetail         `json:"sizing_appendix"`
	OpenQuestions      []OpenQuestion             `json:"open_questions,omitempty"`
}

Plan is the deterministic Migration Plan emitted by `kcp report plan`. Scope: source-environment summary, sizing, cluster-type, networking, cutover, auth (per-cluster), schema migration, red flags, effort signals, tiered storage, and cost-vs-inventory reconciliation. Each section is optional in the JSON and the renderer skips empty ones.

Empty-section conventions across the struct:

  • Always-present per-cluster slices — `Sizing`, `ClusterTypeDecision`, `NetworkingDecision`, `SizingAppendix`. No `omitempty`. JSON renders `[]` when the fleet is empty so a consumer can tell "fleet had no clusters" from "the key is missing because the field was renamed".

  • Conditionally-present per-cluster slices — `Auth`, `CutoverOverrides`, `OpenQuestions`. Tagged `omitempty`, so an empty slice (or nil) drops the key from the JSON entirely. Used when the section either runs for every cluster but may be empty (no clusters found in the state file) or runs only when there's something to say (no overrides → no key; no OQs → no key).

  • Fleet-wide pointer sections — `Cutover`, `Schema`, `RedFlags`, `EffortSignals`, `TieredStorage`, `CostReconciliation`. Tagged `omitempty`. Nil means "section omitted entirely" (no source data, or the path is intentionally skipped, e.g. schemaless).

In all three cases the renderer hides the corresponding §section when the JSON value is empty / nil.

type PlanHeader added in v0.8.1

type PlanHeader struct {
	Source        string    `json:"source"`
	StateFilePath string    `json:"state_file_path"`
	KCPVersion    string    `json:"kcp_version"`
	GeneratedAt   time.Time `json:"generated_at"`
	// StateGeneratedAt is the timestamp the source state file was
	// produced (state.Timestamp). Surfaced in the rendered Plan so a
	// reviewer can see how fresh the underlying scan is — important
	// for negative-evidence claims like "0 ACLs" in Appendix A2.
	StateGeneratedAt time.Time `json:"state_generated_at,omitempty"`

	// PlanSchemaVersion identifies the JSON shape of the Plan. Stable
	// at "1" now that the full deterministic decision set ships
	// (sizing / cluster type / networking / cutover / auth / schema /
	// red flags / effort signals / tiered storage / cost
	// reconciliation). Additive top-level keys at this version are
	// allowed; renames or removals require a version bump.
	PlanSchemaVersion string `json:"plan_schema_version"`
}

type PlanInputs added in v0.8.1

type PlanInputs struct {
	// Sizing overrides (defaults live in plan-config.yaml).
	SLATarget          *string  `yaml:"sla_target,omitempty"          json:"sla_target,omitempty"`
	SizingPercentile   *string  `yaml:"sizing_percentile,omitempty"   json:"sizing_percentile,omitempty"`
	HeadroomFraction   *float64 `yaml:"headroom_fraction,omitempty"   json:"headroom_fraction,omitempty"`
	SpikyWorkloadRatio *float64 `yaml:"spiky_workload_ratio,omitempty" json:"spiky_workload_ratio,omitempty"`

	// Customer-declared hard requirements that force Dedicated.
	// Default `false`; only the customer (or an SE on their behalf) sets these.
	EnforceSchemasAtTheBroker            *bool `yaml:"enforce_schemas_at_the_broker,omitempty"            json:"enforce_schemas_at_the_broker,omitempty"`
	RequiresHighThroughputRESTProduceAPI *bool `yaml:"requires_high_throughput_rest_produce_api,omitempty" json:"requires_high_throughput_rest_produce_api,omitempty"`
	Requires9995SLAWithinSingleZone      *bool `yaml:"requires_99_95_sla_within_a_single_zone,omitempty"  json:"requires_99_95_sla_within_a_single_zone,omitempty"`

	// When source auth includes mTLS AND target_cloud is not `aws`,
	// Dedicated is required because only Dedicated supports mTLS on
	// Azure / GCP. MSK is AWS-only so this defaults to `aws`.
	TargetCloud *string `yaml:"target_cloud,omitempty" json:"target_cloud,omitempty"`

	// Existing VPC connectivity to MSK. When set to `transit_gateway`
	// or `vpc_peering` and the cluster is Dedicated, the same pattern
	// is recommended for Confluent Cloud. `privatelink_or_pni` (default)
	// keeps the AWS-to-AWS Enterprise default (PNI) unless one of the
	// PrivateLink triggers fires (see CCEgressRequired,
	// ProjectedPNIGatewayCount, non-AWS target_cloud).
	ExistingVPCConnectivity *string `yaml:"existing_vpc_connectivity,omitempty" json:"existing_vpc_connectivity,omitempty"`

	// CCEgressRequired = "Do CC-side workloads need to push traffic
	// back into your customer VPC?" PNI does not natively support
	// egress from CC into customer infrastructure; when true the
	// networking default flips from PNI to PrivateLink.
	CCEgressRequired *bool `yaml:"cc_egress_required,omitempty" json:"cc_egress_required,omitempty"`

	// ProjectedPNIGatewayCount — projected PNI gateway count for the
	// deployment. When ≥ 2, the recommendation flips from PNI to
	// PrivateLink. Default 1 (single gateway).
	ProjectedPNIGatewayCount *int `yaml:"projected_pni_gateway_count,omitempty" json:"projected_pni_gateway_count,omitempty"`

	// DowntimeTolerance maps 1:1 to a cutover style. Enum values:
	//   zero                          → Blue/Green
	//   seconds_per_service           → Stop-Restart-Repeat (gateway REQUIRED)
	//   minutes_per_service           → Stop-Restart-Repeat (gateway optional)
	//   scheduled_window_sequential   → Stop-Wait-Restart
	//   scheduled_window_all_at_once  → Restart-All-At-Once
	//   let_confluent_choose          → Stop-Restart-Repeat (Confluent default)
	DowntimeTolerance *string `yaml:"downtime_tolerance,omitempty" json:"downtime_tolerance,omitempty"`

	// SubPattern is only consulted when the resolved style is
	// Stop-Restart-Repeat. Values: `app-by-app` (default) | `topic-by-topic`.
	SubPattern *string `yaml:"sub_pattern,omitempty" json:"sub_pattern,omitempty"`

	// PreferGateway lets the customer opt out of the gateway-mediated
	// recommendation even when they're eligible. Default true mirrors
	// Confluent's canonical recommendation; set false for plain Cluster
	// Linking.
	PreferGateway *bool `yaml:"prefer_gateway,omitempty" json:"prefer_gateway,omitempty"`

	// Gateway prereq statuses. Each is one of `not_started` |
	// `in_progress` | `complete`. Eligibility for the canonical
	// recommendation requires all three to be at `in_progress` or
	// `complete` (with the IAM prereq only relevant when IAM is
	// detected on any source cluster).
	ConfluentForKubernetesStatus *string `yaml:"confluent_for_kubernetes_status,omitempty" json:"confluent_for_kubernetes_status,omitempty"`
	CCGatewayLicenseStatus       *string `yaml:"cc_gateway_license_status,omitempty"       json:"cc_gateway_license_status,omitempty"`
	IAMPreMigrationStatus        *string `yaml:"iam_pre_migration_status,omitempty"        json:"iam_pre_migration_status,omitempty"`

	// TargetAuthMethod overrides the default target auth (looked up
	// per source auth in `auth_mapping`). Enum:
	// `confluent_cloud_api_keys` (default) | `mtls` | `oauth`.
	// Per-cluster override available via `clusters[name].target_auth_method`.
	TargetAuthMethod *string `yaml:"target_auth_method,omitempty" json:"target_auth_method,omitempty"`

	// SchemaStrategy declares the customer's intent for schemas. Enum:
	//   unknown                          → emit OQ (default; first-run safety)
	//   no_schemas                       → schemaless path (omit §Schema)
	//   adopt_schemas_during_migration   → start with no source SR, adopt CC SR
	//   migrate_existing_schema_registry → run the SR-detected path
	SchemaStrategy *string `yaml:"schema_strategy,omitempty" json:"schema_strategy,omitempty"`

	// SourceSROutboundReachableToCC is the customer's network-reachability
	// declaration: can the source Confluent SR reach the CC SR endpoint
	// outbound? Schema Linking's Schema Exporter is one-directional from
	// source SR → CC SR, so without this the gateway-eligible verdict
	// can't hold. Default nil = unknown.
	SourceSROutboundReachableToCC *bool `yaml:"source_sr_outbound_reachable_to_cc,omitempty" json:"source_sr_outbound_reachable_to_cc,omitempty"`

	// ConfluentSRCPVersion is the customer-declared Confluent Platform
	// version of the source Schema Registry. Schema Linking requires
	// CP 7.0 or later. Default nil = unknown — the scanner does not
	// populate this today, so the customer declares it via plan-inputs.
	// Accepted shape: "7.5.1" / "7.0" / "6.2" — string compare against
	// the configured floor.
	ConfluentSRCPVersion *string `yaml:"confluent_sr_cp_version,omitempty" json:"confluent_sr_cp_version,omitempty"`

	// ConfluentSRCPEdition is the customer-declared Confluent Platform
	// edition. Schema Linking requires `enterprise` (CP 7.0 Community
	// does not include it). Enum: `enterprise` | `community`.
	ConfluentSRCPEdition *string `yaml:"confluent_sr_cp_edition,omitempty" json:"confluent_sr_cp_edition,omitempty"`

	// ExactlyOnceTransactionsInUse declares whether the source has
	// EOS / Kafka transactions enabled. There is no detectable state
	// signal for this; customer-only. Default nil = unknown — the
	// Red Flag row surfaces as "not scanned" rather than firing false.
	ExactlyOnceTransactionsInUse *bool `yaml:"exactly_once_transactions_in_use,omitempty" json:"exactly_once_transactions_in_use,omitempty"`

	// KafkaStreamsInUse declares whether Kafka Streams apps consume
	// from the source. The Red Flag detector also runs a
	// topic-pattern scan (`-changelog` / `-repartition`); this flag
	// lets the customer affirm even when topic patterns miss.
	KafkaStreamsInUse *bool `yaml:"kafka_streams_in_use,omitempty" json:"kafka_streams_in_use,omitempty"`

	// ConsumerHistoryRequirement declares whether downstream consumers
	// actually need to replay historical (tiered) data. Enum:
	//   required (default)  → backfill is required; weigh the 3
	//                         dimensions (mechanism / duration / cost)
	//   not_required        → real-time-only consumers; defer to the
	//                         account team for the cascade of
	//                         per-topic + consumer-offset decisions
	//   unknown             → customer hasn't decided yet
	ConsumerHistoryRequirement *string `yaml:"consumer_history_requirement,omitempty" json:"consumer_history_requirement,omitempty"`

	// HistoricalDataStrategy is the customer's preferred path when
	// tiered-storage backfill IS required. Enum:
	//   keep_msk_running_until_data_expires
	//   bulk_load_historical_via_external_tool
	//   defer_to_account_team   (default for the not_required cascade)
	HistoricalDataStrategy *string `yaml:"historical_data_strategy,omitempty" json:"historical_data_strategy,omitempty"`

	// Clusters — per-cluster overrides keyed by source cluster name.
	// Heterogeneous fleets (mixed-SLA, mixed-tier) need finer-grained
	// inputs than the global flags above; without this, flipping a
	// single global flag like `requires_99_95_sla_within_a_single_zone:
	// true` would force Dedicated SZ on every cluster including
	// idle / Zookeeper / Serverless ones. Resolution: per-cluster
	// override wins; fall back to global default. Only the subset of
	// fields that makes sense per-cluster lives here.
	Clusters map[string]ClusterPlanInputs `yaml:"clusters,omitempty" json:"clusters,omitempty"`
}

PlanInputs is the parsed plan-inputs.yaml. Pointers distinguish "unset" from the zero value so the loader can echo only the fields the customer explicitly set.

Customer-declared flags that flip the cluster-type verdict (`EnforceSchemasAtTheBroker`, `RequiresHighThroughputRESTProduceAPI`, `Requires9995SLAWithinSingleZone`) are wrong-click sensitive — a misfired `true` quietly raises the monthly cost. The renderer surfaces a ⚠ cost callout on the Dedicated verdict when any of them is the reason.

type PlanInputsResolved added in v0.8.1

type PlanInputsResolved struct {
	// Raw preserves the original customer-supplied `PlanInputs`. **Note:**
	// the flat fields below carry the *global* resolved view; per-cluster
	// overrides (`Raw.Clusters[<name>]`) are layered on top per cluster
	// inside `PlanService.Build` via `ResolvePlanInputsForCluster` — they
	// are NOT applied to the values stored here. JSON consumers wanting
	// the per-cluster view should re-run the resolver against `Raw`.
	Raw *PlanInputs `json:"raw,omitempty"`

	SLATarget          string  `json:"sla_target"`
	SizingPercentile   string  `json:"sizing_percentile"`
	HeadroomFraction   float64 `json:"headroom_fraction"`
	SpikyWorkloadRatio float64 `json:"spiky_workload_ratio"`

	// Customer-declared hard requirements. Booleans (not *bool) — defaults
	// resolve to false, which is the safe verdict (no escalation to Dedicated).
	EnforceSchemasAtTheBroker            bool `json:"enforce_schemas_at_the_broker"`
	RequiresHighThroughputRESTProduceAPI bool `json:"requires_high_throughput_rest_produce_api"`
	Requires9995SLAWithinSingleZone      bool `json:"requires_99_95_sla_within_a_single_zone"`

	// Target cloud + existing VPC connectivity (Dedicated-path networking).
	TargetCloud             string `json:"target_cloud"`
	ExistingVPCConnectivity string `json:"existing_vpc_connectivity"`

	// Networking triggers that flip the AWS-Enterprise default from PNI
	// to PrivateLink. CCEgressRequired and ProjectedPNIGatewayCount are
	// workload properties, not state-derived.
	CCEgressRequired         bool `json:"cc_egress_required"`
	ProjectedPNIGatewayCount int  `json:"projected_pni_gateway_count"`

	// Cutover — `downtime_tolerance` drives the style; the others
	// govern gateway eligibility + opt-out.
	DowntimeTolerance            string `json:"downtime_tolerance"`
	SubPattern                   string `json:"sub_pattern"`
	PreferGateway                bool   `json:"prefer_gateway"`
	ConfluentForKubernetesStatus string `json:"confluent_for_kubernetes_status"`
	CCGatewayLicenseStatus       string `json:"cc_gateway_license_status"`
	IAMPreMigrationStatus        string `json:"iam_pre_migration_status"`

	// Auth — target verdict; cluster-level override flows through
	// `applyClusterOverride` per the heterogeneous-fleet rule.
	TargetAuthMethod string `json:"target_auth_method"`

	// Schema migration. Strings/bools resolved from the customer
	// input with `unknown` / nil-tri-state semantics: SchemaStrategy
	// defaults to `unknown` so first-run plans don't fire spurious
	// schemaless verdicts. The CP version + edition + outbound
	// reachability stay nil-tri-state because "false" and "unknown"
	// produce different OQs.
	SchemaStrategy                string `json:"schema_strategy"`
	SourceSROutboundReachableToCC *bool  `json:"source_sr_outbound_reachable_to_cc,omitempty"`
	ConfluentSRCPVersion          string `json:"confluent_sr_cp_version,omitempty"`
	ConfluentSRCPEdition          string `json:"confluent_sr_cp_edition,omitempty"`

	// Red Flags customer flags — nil tri-state.
	ExactlyOnceTransactionsInUse *bool `json:"exactly_once_transactions_in_use,omitempty"`
	KafkaStreamsInUse            *bool `json:"kafka_streams_in_use,omitempty"`

	// Tiered Storage knobs. Strings normalized to lowercase tokens by
	// the resolver. `ConsumerHistoryRequirement` empty means "not
	// declared" and is defaulted to `required` by the detector (so the
	// section surfaces the trade-off rather than the unknown-OQ
	// branch). `HistoricalDataStrategy` empty is "not declared" and
	// stays empty unless `ConsumerHistoryRequirement == not_required`,
	// in which case it cascades to `defer_to_account_team`.
	ConsumerHistoryRequirement string `json:"consumer_history_requirement,omitempty"`
	HistoricalDataStrategy     string `json:"historical_data_strategy,omitempty"`
}

PlanInputsResolved is the customer's PlanInputs merged with pinned defaults from plan-config.yaml. Raw preserves the original customer input (nil pointers for fields they didn't set); the flat fields below are the merged values PlanService computes against.

type Prereq added in v0.8.4

type Prereq struct {
	Description string       `json:"description"`
	Status      PrereqStatus `json:"status"`
}

Prereq is one item in the rendered Prerequisites table on the cutover section. Description is the human-readable label; the renderer doesn't transform it.

type PrereqStatus added in v0.8.4

type PrereqStatus string

PrereqStatus mirrors the customer-facing plan-inputs status values (`not_started` → blocked, `in_progress` → in-progress, `complete` → met) plus an `unconfirmed` fallback for prereqs whose source data isn't pinned (e.g. Express tier compatibility per release).

const (
	PrereqMet         PrereqStatus = "met"
	PrereqInProgress  PrereqStatus = "in_progress"
	PrereqBlocked     PrereqStatus = "blocked"
	PrereqUnconfirmed PrereqStatus = "unconfirmed"
)

type ProcessedAggregates added in v0.4.0

type ProcessedAggregates struct {
	AWSCertificateManager                ServiceCostAggregates `json:"AWS Certificate Manager"`
	AmazonManagedStreamingForApacheKafka ServiceCostAggregates `json:"Amazon Managed Streaming for Apache Kafka"`
	EC2Other                             ServiceCostAggregates `json:"EC2 - Other"`
	ElasticLoadBalancing                 ServiceCostAggregates `json:"Amazon Elastic Load Balancing"`
	AmazonVPC                            ServiceCostAggregates `json:"Amazon Virtual Private Cloud"`
}

ProcessedAggregates represents the specific services we query

func NewProcessedAggregates added in v0.4.0

func NewProcessedAggregates() ProcessedAggregates

NewProcessedAggregates creates a new ProcessedAggregates with all maps initialized

func (*ProcessedAggregates) ForService added in v0.6.10

func (a *ProcessedAggregates) ForService(name string) *ServiceCostAggregates

ForService returns a pointer to the ServiceCostAggregates for the given service name, or nil if the service is not recognized.

type ProcessedCluster added in v0.4.0

type ProcessedCluster struct {
	Name                        string                      `json:"name"`
	Arn                         string                      `json:"arn"`
	Region                      string                      `json:"region"`
	ClusterMetrics              ProcessedClusterMetrics     `json:"metrics"` // Flattened from raw CloudWatch metrics
	AWSClientInformation        AWSClientInformation        `json:"aws_client_information"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
}

ProcessedCluster contains the complete cluster data with flattened metrics This is the full cluster information with processed metrics, unlike the simplified version in types.go

type ProcessedClusterMetrics added in v0.4.0

type ProcessedClusterMetrics struct {
	Region     string                     `json:"region"`
	ClusterArn string                     `json:"cluster_arn"`
	Metadata   MetricMetadata             `json:"metadata"`
	Metrics    []ProcessedMetric          `json:"results"`
	Aggregates map[string]MetricAggregate `json:"aggregates"`
	QueryInfo  []MetricQueryInfo          `json:"query_info"`
	// OSK-specific fields (optional, omitempty for MSK clusters)
	Environment string `json:"environment,omitempty"`
	Location    string `json:"location,omitempty"`
}

type ProcessedCost added in v0.4.0

type ProcessedCost struct {
	Start     string                 `json:"start"`
	End       string                 `json:"end"`
	Service   string                 `json:"service"`
	UsageType string                 `json:"usage_type"`
	Values    ProcessedCostBreakdown `json:"values"`
}

type ProcessedCostBreakdown added in v0.4.0

type ProcessedCostBreakdown struct {
	UnblendedCost    float64 `json:"unblended_cost"`
	BlendedCost      float64 `json:"blended_cost"`
	AmortizedCost    float64 `json:"amortized_cost"`
	NetAmortizedCost float64 `json:"net_amortized_cost"`
	NetUnblendedCost float64 `json:"net_unblended_cost"`
}

type ProcessedMSKSource added in v0.8.0

type ProcessedMSKSource struct {
	Regions []ProcessedRegion `json:"regions"`
}

ProcessedMSKSource contains processed MSK data (regions)

type ProcessedMetric added in v0.4.0

type ProcessedMetric struct {
	Start string   `json:"start"`
	End   string   `json:"end"`
	Label string   `json:"label"`
	Value *float64 `json:"value"`
}

type ProcessedOSKCluster added in v0.8.0

type ProcessedOSKCluster struct {
	ID                          string                      `json:"id"`
	BootstrapServers            []string                    `json:"bootstrap_servers"`
	KafkaAdminClientInformation KafkaAdminClientInformation `json:"kafka_admin_client_information"`
	ClusterMetrics              *ProcessedClusterMetrics    `json:"metrics,omitempty"`
	DiscoveredClients           []DiscoveredClient          `json:"discovered_clients"`
	Metadata                    OSKClusterMetadata          `json:"metadata"`
}

ProcessedOSKCluster represents an OSK cluster in the API response

type ProcessedOSKSource added in v0.8.0

type ProcessedOSKSource struct {
	Clusters []ProcessedOSKCluster `json:"clusters"`
}

ProcessedOSKSource contains processed OSK data (flat cluster array)

type ProcessedRegion added in v0.4.0

type ProcessedRegion struct {
	Name           string                                      `json:"name"`
	Configurations []kafka.DescribeConfigurationRevisionOutput `json:"configurations"`
	Costs          ProcessedRegionCosts                        `json:"costs"`    // Flattened from raw AWS Cost Explorer data
	Clusters       []ProcessedCluster                          `json:"clusters"` // Simplified from full DiscoveredCluster data
}

ProcessedRegion mirrors DiscoveredRegion but with flattened costs and simplified clusters

type ProcessedRegionCosts added in v0.4.0

type ProcessedRegionCosts struct {
	Region     string              `json:"region"`
	Metadata   CostMetadata        `json:"metadata"`
	Results    []ProcessedCost     `json:"results"`
	Aggregates ProcessedAggregates `json:"aggregates"`
	QueryInfo  CostQueryInfo       `json:"query_info"`
}

type ProcessedSource added in v0.8.0

type ProcessedSource struct {
	Type    SourceType          `json:"type"`
	MSKData *ProcessedMSKSource `json:"msk_data,omitempty"`
	OSKData *ProcessedOSKSource `json:"osk_data,omitempty"`
}

ProcessedSource represents a unified source (MSK or OSK) with discriminated union

type ProcessedState added in v0.4.0

type ProcessedState struct {
	Sources          []ProcessedSource      `json:"sources"`
	SchemaRegistries *SchemaRegistriesState `json:"schema_registries,omitempty"`
	KcpBuildInfo     interface{}            `json:"kcp_build_info,omitempty"`
	Timestamp        time.Time              `json:"timestamp"`
}

ProcessedState represents the transformed output data structure This is what comes OUT of the frontend/API after processing the raw State data Same structure as State but with costs and metrics flattened for easier frontend consumption

type PrometheusAuthConfig added in v0.8.0

type PrometheusAuthConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

PrometheusAuthConfig holds HTTP basic auth credentials for Prometheus

type PrometheusConfig added in v0.8.0

type PrometheusConfig struct {
	URL    string                  `yaml:"url"`
	Auth   *PrometheusAuthConfig   `yaml:"auth,omitempty"`
	TLS    *PrometheusTLSConfig    `yaml:"tls,omitempty"`
	Filter *PrometheusFilterConfig `yaml:"filter,omitempty"`
}

PrometheusConfig holds Prometheus connection details for metrics queries

type PrometheusFilterConfig added in v0.8.4

type PrometheusFilterConfig struct {
	Labels map[string]string `yaml:"labels,omitempty"`
}

PrometheusFilterConfig holds label selectors to scope Prometheus queries to a specific target. When set, label selectors are appended to all PromQL queries (e.g. {job="confluent/connect-jmx-exporter"}).

type PrometheusTLSConfig added in v0.8.0

type PrometheusTLSConfig struct {
	CACert             string `yaml:"ca_cert,omitempty"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify,omitempty"`
}

PrometheusTLSConfig holds TLS settings for Prometheus HTTPS connections

type RecommendationStatus added in v0.8.4

type RecommendationStatus string

RecommendationStatus signals how confident the plan is in the recommendation, and what (if anything) the customer should resolve to move it forward.

const (
	// RecommendationCanonical: customer is gateway-eligible and the
	// Stop-Restart-Repeat + Gateway pairing is being recommended.
	RecommendationCanonical RecommendationStatus = "canonical"
	// RecommendationCustomerChoice: customer either opted out of the
	// gateway (prefer_gateway: false) or picked Blue/Green.
	RecommendationCustomerChoice RecommendationStatus = "customer_choice"
	// RecommendationDegradedAwaitingOQ: prefer_gateway is still default
	// and all three gateway prereqs are not_started — customer hasn't
	// engaged with the gateway question. Plan falls back to plain CL.
	RecommendationDegradedAwaitingOQ RecommendationStatus = "degraded_awaiting_oq"
	// RecommendationDegradedPrereqsPending: prefer_gateway is true but
	// at least one prereq is still at not_started. Some engagement,
	// not finished.
	RecommendationDegradedPrereqsPending RecommendationStatus = "degraded_prereqs_pending"
)

type RedFlag added in v0.8.4

type RedFlag struct {
	ID     string        `json:"id"`
	Title  string        `json:"title"`
	Status RedFlagStatus `json:"status"`
	// Evidence is the human-readable prose surfaced in the rendered
	// Plan. Keep it under control of the row's evaluator so a reader
	// can tell at a glance WHY the row fired.
	Evidence string `json:"evidence,omitempty"`
	// EvidenceFields carries the structured signals the evaluator
	// computed: scalar counts, cluster lists, version strings, etc.
	// Downstream JSON consumers branch on these instead of parsing
	// `Evidence`. Stable shape (additive only) at
	// `plan_schema_version: "1"`.
	EvidenceFields map[string]any `json:"evidence_fields,omitempty"`
	ClusterID      string         `json:"cluster_id,omitempty"`
}

RedFlag is one row in §Red Flags. Title is the customer-facing label; Evidence is the field path + value that drove the verdict so the SE-customer discussion can ground in scan facts. ClusterID is populated only for per-cluster rows; fleet-level rows leave it empty.

type RedFlagStatus added in v0.8.4

type RedFlagStatus string

RedFlagStatus is the tri-state verdict for one Red Flag row:

  • `triggered` — the boolean predicate over the state file is true.
  • `not_triggered` — the predicate is false and we have enough scan data to say so with confidence.
  • `unknown` — the underlying signal isn't available (scan didn't run, customer-declared flag wasn't set, etc.). The rendered Plan surfaces it as "not scanned" rather than silently defaulting to `not_triggered`.
const (
	RedFlagTriggered    RedFlagStatus = "triggered"
	RedFlagNotTriggered RedFlagStatus = "not_triggered"
	RedFlagUnknown      RedFlagStatus = "unknown"
)

type RedFlagsSection added in v0.8.4

type RedFlagsSection struct {
	Rows []RedFlag `json:"rows"`
}

RedFlagsSection is the fleet-wide Red Flags decision output. Rows is the full set evaluated in row order; the renderer leads with triggered rows and collapses not-triggered/unknown into a tail summary.

type RegionAuth added in v0.4.0

type RegionAuth struct {
	Name     string        `yaml:"name"`
	Clusters []ClusterAuth `yaml:"clusters"`
}

func (*RegionAuth) MergeClusterConfigs added in v0.4.0

func (ra *RegionAuth) MergeClusterConfigs(existingRegion RegionAuth)

MergeClusterConfigs preserves existing cluster auth configurations from the existing region

type ReverseProxyRequest added in v0.5.0

type ReverseProxyRequest struct {
	Region                                 string `json:"region"`
	VPCId                                  string `json:"vpc_id"`
	PublicSubnetCidr                       string `json:"public_subnet_cidr"`
	ConfluentCloudClusterBootstrapEndpoint string `json:"confluent_cloud_cluster_bootstrap_endpoint"`
}

type RuleEvaluation added in v0.8.1

type RuleEvaluation struct {
	RowID       string      `json:"row_id"`
	Description string      `json:"description"`
	Outcome     RuleOutcome `json:"outcome"`
	Evidence    string      `json:"evidence,omitempty"`
	SkipReason  string      `json:"skip_reason,omitempty"`
}

RuleEvaluation is one row of the per-cluster hard-limit audit trail. Triggers (above) carries only the fired rules — this carries every evaluation including not-fired and skipped, so the rendered appendix can show negative evidence ("ACL cap not exceeded: 47 < 4000") and skip rationales ("AclsScanned == false; rule inconclusive").

type RuleOutcome added in v0.8.1

type RuleOutcome string

RuleOutcome enumerates the possible outcomes of evaluating one hard-limit rule against a cluster. Persisted in the audit trail so a reviewer can replay "what would the rules engine have said given this state" without re-running the tool.

The string values below ("fired" / "not_fired" / "skipped") are **stable** and intended for downstream consumers to match on by equality. Don't rename without a coordinated migration of consumers + a plan_schema_version bump.

const (
	RuleFired    RuleOutcome = "fired"     // rule fired — its evidence is recorded
	RuleNotFired RuleOutcome = "not_fired" // rule evaluated and explicitly didn't fire
	RuleSkipped  RuleOutcome = "skipped"   // rule was not evaluated (missing inputs)
)

type SASLPlainConfig added in v0.7.2

type SASLPlainConfig struct {
	Use      bool   `yaml:"use"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type SASLScramConfig added in v0.2.7

type SASLScramConfig struct {
	Use       bool   `yaml:"use"`
	Username  string `yaml:"username"`
	Password  string `yaml:"password"`
	Mechanism string `yaml:"mechanism,omitempty"` // "SHA256" or "SHA512". MSK requires "SHA512", Apache Kafka commonly uses "SHA256"
}

type SchemaDecision added in v0.8.4

type SchemaDecision struct {
	Source SchemaSource `json:"source"`
	// Paths lists every recommended verdict that applies, in
	// rendering order. Single-source cases have len(Paths)==1; the
	// dual-source `confluent_and_glue` case has 2 entries (Glue
	// first — it's the automatable path; Confluent path second).
	//
	// **JSON-consumer note for dual-source.** When Source is
	// `confluent_and_glue` and len(Paths)==1 (only the Glue arm
	// landed), the Confluent arm is in one of two states:
	//   (a) eligibility flags undeclared — pending. Disambiguate by
	//       reading the OpenQuestions for `schema_linking_eligibility_unknown`.
	//   (b) all three eligibility flags resolved AND at least one is
	//       false — verified ineligible. The OQ
	//       `schema_linking_ineligible` will be present.
	// Reading `MeetsCPVersionFloor` / `MeetsCPEditionRequirement` /
	// `SourceSROutboundReachable` tri-states gives the same signal.
	Paths []SchemaPath `json:"paths"`
	// Schema-Linking eligibility constraints — all three must hold for
	// SchemaPathSchemaLinking. Populated only when Source includes
	// `confluent`; the renderer prints a 3-row eligibility table from
	// these flags. *KnownAsTrue distinguishes "verified true" from
	// "verified false" vs "unknown" — when any one is unknown the
	// resulting Paths include `unknown` and the OQ asks the customer
	// to confirm rather than guessing.
	MeetsCPVersionFloor       *bool `json:"meets_cp_version_floor,omitempty"`
	MeetsCPEditionRequirement *bool `json:"meets_cp_edition_requirement,omitempty"`
	SourceSROutboundReachable *bool `json:"source_sr_outbound_reachable,omitempty"`
	// GlueRegistries lists the Glue registry names detected on the
	// source side — surfaced in the Terraform command the renderer
	// emits for SchemaPathMigrateGlue (one apply per registry).
	GlueRegistries []string `json:"glue_registries,omitempty"`
	// ConfluentSRURLs lists the Confluent SR URLs detected. Surfaced
	// in the eligibility table header so a reader knows which SR the
	// verdict applies to.
	ConfluentSRURLs []string `json:"confluent_sr_urls,omitempty"`
}

SchemaDecision is the fleet-wide Schema Migration recommendation. Source describes what was scanned; Paths describes every verdict that applies — usually a single-element slice (one source → one path), but the dual `confluent_and_glue` case carries two so JSON consumers branching on a single path-slot don't miss the second arm.

The eligibility flags are populated only when Source includes `confluent` so the renderer can show why Schema Linking was or wasn't chosen.

type SchemaPath added in v0.8.4

type SchemaPath string

SchemaPath is the recommended migration path:

  • `schema_linking` — Schema Linking from source Confluent SR → CC SR (zero-data-loss mirror; all three eligibility constraints hold).
  • `kcp_migrate_schemas_glue` — `kcp create-asset migrate-schemas --glue-registry` generates Terraform that imports every Glue schema into CC SR in one apply.
  • `defer_to_account_team` — Confluent SR detected but Schema-Linking eligibility fails (CP < 7.0, Community edition, or no outbound reachability). REST API export/import is technically possible but not deterministically described by kcp.
  • `schemaless` — no source SR + customer declared `no_schemas`.
  • `unknown` — fallback when an Open Question must close before the path is decidable (typically `schema_strategy: unknown`).
const (
	SchemaPathSchemaLinking  SchemaPath = "schema_linking"
	SchemaPathMigrateGlue    SchemaPath = "kcp_migrate_schemas_glue"
	SchemaPathDeferToAccount SchemaPath = "defer_to_account_team"
	SchemaPathSchemaless     SchemaPath = "schemaless"
	SchemaPathUnknown        SchemaPath = "unknown"
)

type SchemaRegistriesState added in v0.7.2

type SchemaRegistriesState struct {
	ConfluentSchemaRegistry []SchemaRegistryInformation     `json:"confluent_schema_registry,omitempty"`
	AWSGlue                 []GlueSchemaRegistryInformation `json:"aws_glue,omitempty"`
}

SchemaRegistriesState holds schema registries organized by type

func (*SchemaRegistriesState) UpsertConfluentSchemaRegistry added in v0.7.2

func (s *SchemaRegistriesState) UpsertConfluentSchemaRegistry(sr SchemaRegistryInformation)

UpsertConfluentSchemaRegistry inserts or updates a Confluent SR entry, matched by URL

func (*SchemaRegistriesState) UpsertGlueSchemaRegistry added in v0.7.2

func (s *SchemaRegistriesState) UpsertGlueSchemaRegistry(gr GlueSchemaRegistryInformation)

UpsertGlueSchemaRegistry inserts or updates a Glue SR entry, matched by RegistryName+Region

type SchemaRegistryAuthType added in v0.4.2

type SchemaRegistryAuthType string

SchemaRegistryAuthType represents the different authentication types supported by Schema Registry

const (
	SchemaRegistryAuthTypeUnauthenticated SchemaRegistryAuthType = "Unauthenticated"
	SchemaRegistryAuthTypeBasicAuth       SchemaRegistryAuthType = "BasicAuth"
)

type SchemaRegistryExporterConfig added in v0.5.0

type SchemaRegistryExporterConfig struct {
	Migrate   bool     `json:"migrate"`
	Subjects  []string `json:"subjects"`
	SourceURL string   `json:"source_url"`
}

type SchemaRegistryInformation added in v0.4.2

type SchemaRegistryInformation struct {
	Type                 string                       `json:"type"`
	URL                  string                       `json:"url"`
	DefaultCompatibility schemaregistry.Compatibility `json:"default_compatibility"`
	Contexts             []string                     `json:"contexts"`
	Subjects             []Subject                    `json:"subjects"`
}

type SchemaSource added in v0.8.4

type SchemaSource string

SchemaSource is the detected source-side schema registry, derived from the scanner's `state.schema_registries`. `none` means the scanner ran but found neither a Confluent SR nor a Glue registry. `confluent_and_glue` covers the rare both-registries deployment — the decision applies each path independently.

const (
	SchemaSourceNone             SchemaSource = "none"
	SchemaSourceConfluent        SchemaSource = "confluent"
	SchemaSourceGlue             SchemaSource = "glue"
	SchemaSourceConfluentAndGlue SchemaSource = "confluent_and_glue"
)

type SelfManagedConnector added in v0.4.2

type SelfManagedConnector struct {
	Name        string         `json:"name"`
	Config      map[string]any `json:"config"`
	State       string         `json:"state,omitempty"`
	ConnectHost string         `json:"connect_host,omitempty"`
}

type SelfManagedConnectors added in v0.4.2

type SelfManagedConnectors struct {
	Connectors []SelfManagedConnector   `json:"connectors"`
	Metrics    *ProcessedClusterMetrics `json:"metrics,omitempty"`
}

type ServiceCostAggregates added in v0.4.0

type ServiceCostAggregates struct {
	UnblendedCost    map[string]any `json:"unblended_cost"`
	BlendedCost      map[string]any `json:"blended_cost"`
	AmortizedCost    map[string]any `json:"amortized_cost"`
	NetAmortizedCost map[string]any `json:"net_amortized_cost"`
	NetUnblendedCost map[string]any `json:"net_unblended_cost"`
}

ServiceCostAggregates represents cost aggregates for a single service Uses explicit fields for each metric type instead of a map

type SizingMathDetail added in v0.8.1

type SizingMathDetail struct {
	ClusterID         string          `json:"cluster_id"`
	Formula           string          `json:"formula"`
	IntermediateSteps []string        `json:"intermediate_steps"`
	Citations         []FieldCitation `json:"citations,omitempty"`
}

type SourceClusterSummary added in v0.8.1

type SourceClusterSummary struct {
	ClusterID    string `json:"cluster_id"`
	Region       string `json:"region"`
	BrokerCount  int    `json:"broker_count"`
	TopicCount   int    `json:"topic_count"`
	KafkaVersion string `json:"kafka_version,omitempty"`
	// IsServerless flags MSK Serverless source clusters. Set to true
	// when MskClusterConfig.ClusterType == "SERVERLESS"; the renderer
	// uses it to suppress Provisioned-only framing (broker counts,
	// "incomplete scan" guidance) that doesn't apply to Serverless.
	IsServerless bool `json:"is_serverless,omitempty"`
	// SourceAuths lists the auth methods enabled on the source cluster
	// (stable enum tokens: scram, iam, mtls, unauth). Drawn from the
	// same MSK ClientAuthentication signals AuthDecision reads — surfaced here in
	// §1 so a reader scanning the Source Environment table sees the
	// auth posture alongside brokers / topics before the §4 mapping.
	SourceAuths []string `json:"source_auths,omitempty"`
}

type SourceEnvironment added in v0.8.1

type SourceEnvironment struct {
	Clusters     []SourceClusterSummary `json:"clusters"`
	TotalRegions int                    `json:"total_regions"`
}

type SourceType added in v0.8.0

type SourceType string

SourceType represents the type of Kafka source

const (
	SourceTypeMSK SourceType = "msk"
	SourceTypeOSK SourceType = "osk"
)

func ParseSourceTypeFlag added in v0.8.4

func ParseSourceTypeFlag(flag string) (SourceType, error)

ParseSourceTypeFlag maps a user-facing --source-type flag value to the internal SourceType token. The Apache Kafka source is "apache-kafka" to users but is represented internally as "osk".

type State added in v0.4.0

type State struct {
	MSKSources       *MSKSourcesState       `json:"msk_sources,omitempty"`
	OSKSources       *OSKSourcesState       `json:"osk_sources,omitempty"`
	SchemaRegistries *SchemaRegistriesState `json:"schema_registries,omitempty"`
	KcpBuildInfo     KcpBuildInfo           `json:"kcp_build_info"`
	Timestamp        time.Time              `json:"timestamp"`
}

State represents the unified state file (kcp-state.json)

func NewStateFrom added in v0.4.0

func NewStateFrom(fromState *State) *State

func NewStateFromBytes added in v0.8.0

func NewStateFromBytes(data []byte) (*State, error)

func NewStateFromFile added in v0.4.0

func NewStateFromFile(stateFile string) (*State, error)

func (*State) GetClusterByArn added in v0.5.2

func (s *State) GetClusterByArn(clusterArn string) (*DiscoveredCluster, error)

func (*State) GetOSKClusterByID added in v0.8.0

func (s *State) GetOSKClusterByID(id string) (*OSKDiscoveredCluster, error)

GetOSKClusterByID looks up an OSK cluster by the user-provided ID from credentials

func (*State) PersistStateFile added in v0.4.0

func (s *State) PersistStateFile(stateFile string) error

func (*State) UpsertDiscoveredClients added in v0.5.2

func (s *State) UpsertDiscoveredClients(regionName string, clusterName string, discoveredClients []DiscoveredClient) error

func (*State) UpsertRegion added in v0.4.0

func (s *State) UpsertRegion(newRegion DiscoveredRegion)

func (*State) WriteReportCommands added in v0.4.5

func (s *State) WriteReportCommands(filePath string, stateFilePath string) error

func (*State) WriteToFile added in v0.4.0

func (s *State) WriteToFile(filePath string) error

type Subject added in v0.4.2

type Subject struct {
	Name          string                          `json:"name"`
	SchemaType    string                          `json:"schema_type"`
	Compatibility string                          `json:"compatibility,omitempty"`
	Versions      []schemaregistry.SchemaMetadata `json:"versions"`
	Latest        schemaregistry.SchemaMetadata   `json:"latest_schema"`
}

type SubnetInfo added in v0.2.2

type SubnetInfo struct {
	SubnetMskBrokerId int    `json:"subnet_msk_broker_id"`
	SubnetId          string `json:"subnet_id"`
	AvailabilityZone  string `json:"availability_zone"`
	PrivateIpAddress  string `json:"private_ip_address"`
	CidrBlock         string `json:"cidr_block"`
}

type TLSConfig added in v0.2.7

type TLSConfig struct {
	Use        bool   `yaml:"use"`
	CACert     string `yaml:"ca_cert"`
	ClientCert string `yaml:"client_cert"`
	ClientKey  string `yaml:"client_key"`
}

type TargetClusterWizardRequest added in v0.5.0

type TargetClusterWizardRequest struct {
	AwsRegion              string   `json:"aws_region"`
	NeedsEnvironment       bool     `json:"needs_environment"`
	EnvironmentName        string   `json:"environment_name"`
	EnvironmentId          string   `json:"environment_id"`
	NeedsCluster           bool     `json:"needs_cluster"`
	ClusterName            string   `json:"cluster_name"`
	ClusterType            string   `json:"cluster_type"`
	ClusterAvailability    string   `json:"cluster_availability"` // "SINGLE_ZONE" or "MULTI_ZONE"
	ClusterCku             int      `json:"cluster_cku"`          // Number of CKUs (1+, MULTI_ZONE requires >= 2)
	NeedsPrivateLink       bool     `json:"needs_private_link"`
	UseExistingRoute53Zone bool     `json:"use_existing_route53_zone"`
	PreventDestroy         bool     `json:"prevent_destroy"`
	VpcId                  string   `json:"vpc_id"`
	SubnetCidrRanges       []string `json:"subnet_cidr_ranges"`
}

type TerraformFiles added in v0.5.0

type TerraformFiles struct {
	MainTf           string            `json:"main.tf"`
	ProvidersTf      string            `json:"providers.tf"`
	VariablesTf      string            `json:"variables.tf"`
	InputsAutoTfvars string            `json:"inputs.auto.tfvars"`
	OutputsTf        string            `json:"outputs.tf"`
	PerPrincipalTf   map[string]string `json:"per_principal_tf,omitempty"`
}

type TerraformOutput

type TerraformOutput struct {
	Name        string
	Description string
	Sensitive   bool
	Value       string
}

type TerraformOutputOld added in v0.5.0

type TerraformOutputOld struct {
	ConfluentCloudClusterApiKey                TerraformOutputValue `json:"confluent_cloud_cluster_api_key"`
	ConfluentCloudClusterApiKeySecret          TerraformOutputValue `json:"confluent_cloud_cluster_api_key_secret"`
	ConfluentCloudClusterId                    TerraformOutputValue `json:"confluent_cloud_cluster_id"`
	ConfluentCloudClusterRestEndpoint          TerraformOutputValue `json:"confluent_cloud_cluster_rest_endpoint"`
	ConfluentCloudClusterBootstrapEndpoint     TerraformOutputValue `json:"confluent_cloud_cluster_bootstrap_endpoint"`
	ConfluentPlatformControllerBootstrapServer TerraformOutputValue `json:"confluent_platform_controller_bootstrap_server"`
}

a type for the output.json file in the target_env folder NOTE: This will be deprecated once we are completely on the HCL-servrice based approach.

type TerraformOutputValue

type TerraformOutputValue struct {
	Sensitive bool   `json:"sensitive"`
	Type      string `json:"type"`
	Value     any    `json:"value"`
}

type TerraformState

type TerraformState struct {
	Outputs TerraformOutputOld `json:"outputs"`
}

type TerraformVariable added in v0.5.0

type TerraformVariable struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Sensitive   bool   `json:"sensitive"`
	Type        string `json:"type"`
}

type TieredStorageCluster added in v0.8.4

type TieredStorageCluster struct {
	ClusterID   string `json:"cluster_id"`
	StorageMode string `json:"storage_mode"`
	// RemoteLogSizeBytes is the peak observed footprint (CloudWatch
	// Maximum aggregate) — appropriate for a monotonically-
	// accumulating gauge. Falls back to Average when Max isn't
	// populated. Zero when the metric wasn't collected or the
	// cluster doesn't have tiered data yet.
	RemoteLogSizeBytes float64 `json:"remote_log_size_bytes,omitempty"`
}

TieredStorageCluster is the per-cluster tiered-storage view: which cluster has TIERED storage, the peak GB volume from CloudWatch (`RemoteLogSizeBytes` Maximum — informational, not the basis for a dollar estimate), and whether the customer's `consumer_history_requirement` indicates the data must be carried forward.

type TieredStorageSection added in v0.8.4

type TieredStorageSection struct {
	Clusters                   []TieredStorageCluster `json:"clusters"`
	ConsumerHistoryRequirement string                 `json:"consumer_history_requirement"`
	HistoricalDataStrategy     string                 `json:"historical_data_strategy"`
}

TieredStorageSection surfaces the three-dimension trade-off (mechanism / duration / cost direction) for fleets with at least one TIERED-storage cluster. Customer-decision shaped: kcp does not pick a path, it makes the trade-off legible.

type TopicDetails added in v0.3.4

type TopicDetails struct {
	Name              string             `json:"name"`
	Partitions        int                `json:"partitions"`
	ReplicationFactor int                `json:"replication_factor"`
	Configurations    map[string]*string `json:"configurations"`
}

type TopicSummary added in v0.3.4

type TopicSummary struct {
	Topics                    int `json:"topics"`
	InternalTopics            int `json:"internal_topics"`
	TotalPartitions           int `json:"total_partitions"`
	TotalInternalPartitions   int `json:"total_internal_partitions"`
	CompactTopics             int `json:"compact_topics"`
	CompactInternalTopics     int `json:"compact_internal_topics"`
	CompactPartitions         int `json:"compact_partitions"`
	CompactInternalPartitions int `json:"compact_internal_partitions"`
	RemoteStorageTopics       int `json:"remote_storage_topics"`
}

func CalculateTopicSummaryFromDetails added in v0.3.4

func CalculateTopicSummaryFromDetails(topicDetails []TopicDetails) TopicSummary

type Topics added in v0.3.3

type Topics struct {
	Summary TopicSummary   `json:"summary"`
	Details []TopicDetails `json:"details"`
}

type Topology added in v0.8.1

type Topology string

Topology distinguishes Multi-Zone (MZ) from Single-Zone (SZ) Dedicated clusters. Only meaningful when Verdict == Dedicated; Enterprise clusters have no topology dimension at this layer.

const (
	TopologyNotApplicable Topology = ""
	TopologyMultiZone     Topology = "MultiZone"
	TopologySingleZone    Topology = "SingleZone"
)

type UnauthenticatedPlaintextConfig added in v0.4.0

type UnauthenticatedPlaintextConfig struct {
	Use bool `yaml:"use"`
}

type UnauthenticatedTLSConfig added in v0.4.0

type UnauthenticatedTLSConfig struct {
	Use bool `yaml:"use"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL