utils

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultClientBrokerEncryptionInTransit = kafkatypes.ClientBrokerTls

DefaultClientBrokerEncryptionInTransit is the fallback encryption type when cluster encryption info is not available

Variables

View Source
var ConnectorMap = map[string]ConnectorMapping{
	"io.confluent.connect.activemq.ActiveMQSourceConnector": {
		PluginName:    "ActiveMQSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.jdbc.JdbcSinkConnector": {
		PluginName:    "AlloyDbSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azure.blob.AzureBlobStorageSinkConnector": {
		PluginName:    "AzureBlobSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azure.blob.storage.AzureBlobStorageSourceConnector": {
		PluginName:    "AzureBlobSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.azure.search.AzureSearchSinkConnector": {
		PluginName:    "AzureCognitiveSearchSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azure.datalake.gen2.AzureDataLakeGen2SinkConnector": {
		PluginName:    "AzureDataLakeGen2Sink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azure.eventhubs.EventHubsSourceConnector": {
		PluginName:    "AzureEventHubsSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.azure.functions.AzureFunctionsSinkConnector": {
		PluginName:    "AzureFunctionsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azureloganalytics.AzureLogAnalyticsSinkConnector": {
		PluginName:    "AzureLogAnalyticsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.azure.servicebus.ServiceBusSourceConnector": {
		PluginName:    "AzureServiceBusSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.azuresqldw.AzureSqlDwSinkConnector": {
		PluginName:    "AzureSqlDwSink",
		ConnectorType: "Sink",
	},
	"com.wepay.kafka.connect.bigquery.BigQuerySinkConnector": {
		PluginName:    "BigQuerySink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.bigquerystorage.BigQueryStorageSinkConnector": {
		PluginName:    "BigQueryStorageSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.gcp.bigtable.BigtableSinkConnector": {
		PluginName:    "BigTableSink",
		ConnectorType: "Sink",
	},
	"com.clickhouse.kafka.connect.ClickHouseSinkConnector": {
		PluginName:    "ClickHouseSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.aws.cloudwatch.AwsCloudWatchSourceConnector": {
		PluginName:    "CloudWatchLogsSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.aws.cloudwatch.metrics.AwsCloudWatchMetricsSinkConnector": {
		PluginName:    "CloudWatchMetricsSink",
		ConnectorType: "Sink",
	},
	"com.azure.cosmos.kafka.connect.sink.CosmosDBSinkConnector": {
		PluginName:    "CosmosDbSink",
		ConnectorType: "Sink",
	},
	"com.azure.cosmos.kafka.connect.CosmosSinkConnector": {
		PluginName:    "CosmosDbSinkV2",
		ConnectorType: "Sink",
	},
	"com.azure.cosmos.kafka.connect.source.CosmosDBSourceConnector": {
		PluginName:    "CosmosDbSource",
		ConnectorType: "Source",
	},
	"com.azure.cosmos.kafka.connect.CosmosSourceConnector": {
		PluginName:    "CosmosDbSourceV2",
		ConnectorType: "Source",
	},
	"com.couchbase.connect.kafka.CouchbaseSinkConnector": {
		PluginName:    "CouchbaseSink",
		ConnectorType: "Sink",
	},
	"com.couchbase.connect.kafka.CouchbaseSourceConnector": {
		PluginName:    "CouchbaseSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.databricks.deltalake.DatabricksDeltaLakeSinkConnector": {
		PluginName:    "DatabricksDeltaLakeSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.datadog.metrics.DatadogMetricsSinkConnector": {
		PluginName:    "DatadogMetricsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.kafka.connect.datagen.DatagenConnector": {
		PluginName:    "DatagenSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.gcp.dataproc.DataprocSinkConnector": {
		PluginName:    "DataprocSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.dynamodb.DynamoDBSourceConnector": {
		PluginName:    "DynamoDbCdcSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.aws.dynamodb.DynamoDbSinkConnector": {
		PluginName:    "DynamoDbSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.elasticsearch.ElasticsearchSinkConnector": {
		PluginName:    "ElasticsearchSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.gcs.GcsSinkConnector": {
		PluginName:    "GcsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.gcs.GcsSourceConnector": {
		PluginName:    "GcsSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.github.GithubSourceConnector": {
		PluginName:    "GithubSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.gcp.functions.GoogleCloudFunctionsSinkConnector": {
		PluginName:    "GoogleCloudFunctionsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.http.HttpSinkConnector": {
		PluginName:    "HttpSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.http.sink.GenericHttpSinkConnector": {
		PluginName:    "HttpSinkV2",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.http.HttpSourceConnector": {
		PluginName:    "HttpSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.http.source.GenericHttpSourceConnector": {
		PluginName:    "HttpSourceV2",
		ConnectorType: "Source",
	},
	"io.confluent.connect.jdbc.JdbcSourceConnector": {
		PluginName:    "IbmDb2Source",
		ConnectorType: "Source",
	},
	"io.confluent.connect.ibm.mq.IbmMQSourceConnector": {
		PluginName:    "IbmMQSource",
		ConnectorType: "Source",
	},
	"io.confluent.influxdb.v2.sink.InfluxDB2SinkConnector": {
		PluginName:    "InfluxDB2Sink",
		ConnectorType: "Sink",
	},
	"io.confluent.influxdb.v2.source.InfluxDB2SourceConnector": {
		PluginName:    "InfluxDB2Source",
		ConnectorType: "Source",
	},
	"io.confluent.connect.jms.JmsSourceConnector": {
		PluginName:    "JMSSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.jira.JiraSourceConnector": {
		PluginName:    "JiraSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.kinesis.KinesisSourceConnector": {
		PluginName:    "KinesisSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.aws.lambda.AwsLambdaSinkConnector": {
		PluginName:    "LambdaSink",
		ConnectorType: "Sink",
	},
	"io.debezium.connector.v2.mariadb.MariaDbConnector": {
		PluginName:    "MariaDbCdcSource",
		ConnectorType: "Source",
	},
	"com.mongodb.kafka.connect.MongoSinkConnector": {
		PluginName:    "MongoDbAtlasSink",
		ConnectorType: "Sink",
	},
	"com.mongodb.kafka.connect.MongoSourceConnector": {
		PluginName:    "MongoDbAtlasSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.mqtt.MqttSinkConnector": {
		PluginName:    "MqttSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.mqtt.MqttSourceConnector": {
		PluginName:    "MqttSource",
		ConnectorType: "Source",
	},
	"io.debezium.connector.mysql.MySqlConnector": {
		PluginName:    "MySqlCdcSource",
		ConnectorType: "Source",
	},
	"io.debezium.connector.v2.mysql.MySqlConnectorV2": {
		PluginName:    "MySqlCdcSourceV2",
		ConnectorType: "Source",
	},
	"io.confluent.connect.newrelic.metrics.NewRelicMetricsSinkConnector": {
		PluginName:    "NewRelicMetricsSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.oracle.cdc.OracleCdcSourceConnector": {
		PluginName:    "OracleCdcSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.oracle.xstream.cdc.OracleXStreamSourceConnector": {
		PluginName:    "OracleXStreamSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.pagerduty.PagerDutySinkConnector": {
		PluginName:    "PagerDutySink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.pinecone.PineconeSinkConnector": {
		PluginName:    "PineconeSink",
		ConnectorType: "Sink",
	},
	"io.debezium.connector.postgresql.PostgresConnector": {
		PluginName:    "PostgresCdcSource",
		ConnectorType: "Source",
	},
	"io.debezium.connector.v2.postgresql.PostgresConnectorV2": {
		PluginName:    "PostgresCdcSourceV2",
		ConnectorType: "Source",
	},
	"io.confluent.connect.gcp.pubsub.PubSubSourceConnector": {
		PluginName:    "PubSubSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.rabbitmq.sink.RabbitMQSinkConnector": {
		PluginName:    "RabbitMQSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.rabbitmq.RabbitMQSourceConnector": {
		PluginName:    "RabbitMQSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.rediskafka.RedisKafkaSinkConnector": {
		PluginName:    "RedisKafkaSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.rediskafka.RedisKafkaSourceConnector": {
		PluginName:    "RedisKafkaSource",
		ConnectorType: "Source",
	},
	"com.github.jcustenborder.kafka.connect.redis.RedisSinkConnector": {
		PluginName:    "RedisSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.aws.redshift.RedshiftSinkConnector": {
		PluginName:    "RedshiftSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.s3.source.S3SourceConnector": {
		PluginName:    "S3Source",
		ConnectorType: "Source",
	},
	"io.confluent.connect.salesforce.SalesforceBulkApiSourceConnector": {
		PluginName:    "SalesforceBulkApiSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.salesforce.SalesforceBulkApiSinkConnector": {
		PluginName:    "SalesforceBulkApiV2Sink",
		ConnectorType: "Sink",
	},
	"io.confluent.salesforce.SalesforceCdcSourceConnector": {
		PluginName:    "SalesforceCdcSource",
		ConnectorType: "Source",
	},
	"io.confluent.salesforce.SalesforcePlatformEventSinkConnector": {
		PluginName:    "SalesforcePlatformEventSink",
		ConnectorType: "Sink",
	},
	"io.confluent.salesforce.SalesforcePlatformEventSourceConnector": {
		PluginName:    "SalesforcePlatformEventSource",
		ConnectorType: "Source",
	},
	"io.confluent.salesforce.SalesforcePushTopicSourceConnector": {
		PluginName:    "SalesforcePushTopicSource",
		ConnectorType: "Source",
	},
	"io.confluent.salesforce.SalesforceSObjectSinkConnector": {
		PluginName:    "SalesforceSObjectSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.servicenow.ServiceNowSinkConnector": {
		PluginName:    "ServiceNowSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.servicenow.ServiceNowSourceConnector": {
		PluginName:    "ServiceNowSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.sftp.SftpSinkConnector": {
		PluginName:    "SftpSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.sftp.SftpGenericSourceConnector": {
		PluginName:    "SftpSource",
		ConnectorType: "Source",
	},
	"com.snowflake.kafka.connector.SnowflakeSinkConnector": {
		PluginName:    "SnowflakeSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.snowflake.jdbc.SnowflakeSourceConnector": {
		PluginName:    "SnowflakeSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.jms.SolaceSinkConnector": {
		PluginName:    "SolaceSink",
		ConnectorType: "Sink",
	},
	"io.confluent.connect.gcp.spanner.SpannerSinkConnector": {
		PluginName:    "SpannerSink",
		ConnectorType: "Sink",
	},
	"com.splunk.kafka.connect.SplunkSinkConnector": {
		PluginName:    "SplunkSink",
		ConnectorType: "Sink",
	},
	"io.debezium.connector.sqlserver.SqlServerConnector": {
		PluginName:    "SqlServerCdcSource",
		ConnectorType: "Source",
	},
	"io.debezium.connector.v2.sqlserver.SqlServerConnectorV2": {
		PluginName:    "SqlServerCdcSourceV2",
		ConnectorType: "Source",
	},
	"io.confluent.connect.sqs.source.SqsSourceConnector": {
		PluginName:    "SqsSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.zendesk.ZendeskSourceConnector": {
		PluginName:    "ZendeskSource",
		ConnectorType: "Source",
	},
	"io.confluent.connect.s3.S3SinkConnector": {
		PluginName:    "S3_SINK",
		ConnectorType: "Sink",
	},
}

https://github.com/confluentinc/connect-migration-utility/tree/master/templates/fm

Functions

func AppendClientCert added in v0.8.12

func AppendClientCert(cfg *tls.Config, certFile, keyFile string) error

AppendClientCert loads a client certificate/key pair and adds it to cfg for mutual TLS. Shared by every mTLS-capable client so cert loading is uniform and fails closed on a bad pair.

func BindEnvToFlags

func BindEnvToFlags(cmd *cobra.Command) error

sets flag values from corresponding environment variables if flags weren't explicitly provided

func CACertPool added in v0.8.12

func CACertPool(path string) (*x509.CertPool, error)

CACertPool reads a PEM CA bundle from path and returns a cert pool trusting it. It fails CLOSED: an unreadable file, or a file containing no valid PEM certificate, returns an error rather than silently falling back to system roots. Call it only when a CA path is configured — an empty path is a caller bug and returns an error.

func CamelToScreamingSnake added in v0.6.9

func CamelToScreamingSnake(s string) string

CamelToScreamingSnake converts camelCase or PascalCase strings to SCREAMING_SNAKE_CASE. e.g. "DescribeConfigs" -> "DESCRIBE_CONFIGS", "Read" -> "READ"

func CleanPrincipalName added in v0.6.9

func CleanPrincipalName(principal string) string

CleanPrincipalName cleans the principal name for use in Terraform resources

func ConvertKafkaVersion added in v0.2.2

func ConvertKafkaVersion(kafkaVersion *string) string

func ConvertToCtyValue added in v0.5.0

func ConvertToCtyValue(v any) cty.Value

func ExtractClusterNameFromArn added in v0.4.2

func ExtractClusterNameFromArn(arn string) string

func ExtractClusterNameFromS3Uri added in v0.5.2

func ExtractClusterNameFromS3Uri(s3Uri string) (string, error)

func ExtractRegionFromArn added in v0.7.0

func ExtractRegionFromArn(arn string) (string, error)

ExtractRegionFromArn extracts the AWS region from a resource ARN. ARN format: arn:aws:kafka:<region>:<account>:cluster/...

func ExtractRegionFromS3Uri added in v0.5.2

func ExtractRegionFromS3Uri(s3Uri string) (string, error)

func FilterByGlob added in v0.8.0

func FilterByGlob(names []string, includes []string, excludes []string) []string

FilterByGlob applies include then exclude glob patterns to a list of names. Patterns use the syntax of path.Match (supports *, ?, [a-z], etc., but not **).

Semantics:

  • An empty include list means "include everything" (default-all).
  • A name is kept if at least one include pattern matches it.
  • A name is dropped if at least one exclude pattern matches it.
  • Exclude wins on overlap.
  • Patterns that error from path.Match are treated as non-matching for that name; callers should validate patterns up front if they want hard errors.

Order is preserved.

func FormatHclResourceName added in v0.5.0

func FormatHclResourceName(resourceName string) string

FormatHclResourceName ensures that resources are all 'snake_case' and only contains alphanumeric characters and underscores.

func GenerateLifecycleBlock added in v0.5.0

func GenerateLifecycleBlock(resourceBlock *hclwrite.Block, lifecycle string, boolean bool) error

GenerateLifecyleBlock creates tokens for a lifecycle block - supports only 'prevent_destroy' and 'create_before_destroy'.

func GetClientBrokerEncryptionInTransit added in v0.4.0

func GetClientBrokerEncryptionInTransit(cluster kafkatypes.Cluster) kafkatypes.ClientBroker

GetClientBrokerEncryptionInTransit determines the client broker encryption in transit value for a cluster with proper fallback logic when encryption info is not available

func GetClusterDisplayName added in v0.8.0

func GetClusterDisplayName(sourceType types.SourceType, clusterArn string, clusterID string) string

GetClusterDisplayName returns a human-readable cluster identifier for logging. For MSK sources, it extracts the cluster name from the ARN. For OSK sources, it returns the cluster ID.

func GetKafkaVersion added in v0.4.0

func GetKafkaVersion(clusterInfo types.AWSClientInformation) string

getKafkaVersion determines the Kafka version based on cluster type

func InferPluginName added in v0.4.2

func InferPluginName(connectorClass string) (string, error)

func NewGroupCmd added in v0.10.0

func NewGroupCmd(cmd *cobra.Command) *cobra.Command

NewGroupCmd makes cmd, a command that only routes to sub-commands, fail on a mistyped one. Cobra answers an unknown argument to a non-runnable command with its help and exit status 0, so `kcp iac acls iamm` would look successful while doing nothing. A bare invocation still prints help and exits 0: Args returns pflag.ErrHelp, which cobra turns into help before the root's PersistentPreRun.

func NewNounCmd added in v0.10.0

func NewNounCmd(use string, verb *cobra.Command) *cobra.Command

NewNounCmd wraps verb in a parent command named use, so that `kcp iac topics generate` has a `topics` level between `iac` and `generate`. Cobra needs a command for every word in the path, but only the verb does any work; the parent just routes to it.

The parent is runnable only so that a missing or mistyped verb fails: cobra answers a non-runnable command with its help and exit status 0, which would leave `kcp iac topics genrate` looking successful while writing nothing. Both failures are raised from Args because cobra validates args before the root's PersistentPreRun, so a usage error prints no banner and writes no kcp.log; RunE is never reached.

The parent copies verb's Short so it still has a description in the grandparent's help, and verb's Hidden because cobra lists a runnable parent even when its only child is hidden.

Unknown flags are tolerated on the parent so that `kcp iac topics --state-file x` (a pre-rename invocation with the verb dropped) reaches the missing-verb hint instead of failing on the flag, which cobra parses before it validates Args.

func OptionalCACertPool added in v0.8.12

func OptionalCACertPool(path string) (*x509.CertPool, error)

OptionalCACertPool is the "optional CA path" adapter for TLS option builders: an empty path yields (nil, nil) — meaning "use the system trust store" — while a non-empty path is loaded fail-closed via CACertPool. It collapses the repeated `if path != "" { pool, err := CACertPool(path); ... }` block at every Jolokia/Prometheus/Kafka TLS call site into one call.

func ParseDurationDays added in v0.8.4

func ParseDurationDays(s string) (time.Duration, error)

ParseDurationDays parses duration strings like "1d", "7d", "30d" into time.Duration.

func ParseTerraformState

func ParseTerraformState(targetEnvFolder string, requiredFields []string) (*hcltypes.TerraformState, error)

func RandomString added in v0.5.0

func RandomString(length int) string

func RegionsFromClusterArns added in v0.8.12

func RegionsFromClusterArns(clusterArns []string) ([]string, error)

RegionsFromClusterArns returns the distinct AWS regions parsed from the given MSK cluster ARNs, preserving first-seen order. Returns an error if any ARN is malformed.

func SanitizeConnectorFilename added in v0.8.6

func SanitizeConnectorFilename(name string) string

SanitizeConnectorFilename derives a filesystem-safe, single path segment from an untrusted connector name so it can be interpolated into an output filename.

Kafka Connect permits connector names containing "/", "\" and ".." (and the MSK Connect / state-file paths carry whatever a compromised endpoint or hostile state file provides). Using such a name directly in filepath.Join would let the generated .tf escape the intended output directory — a path traversal that becomes an arbitrary file write. Every character outside [A-Za-z0-9._-] is replaced with "_", which guarantees the result contains no path separator on any OS and therefore cannot traverse. A name that sanitizes to empty or to only dots (".", "..", …) collapses to "connector" so the caller never builds a hidden, bare-dot, or traversal filename.

func StructToMap added in v0.4.0

func StructToMap(s any) (map[string]any, error)

func TLSClientConfig added in v0.8.12

func TLSClientConfig(caPool *x509.CertPool, insecureSkip bool) *tls.Config

TLSClientConfig assembles a *tls.Config from an already-resolved CA pool (nil → system trust roots) and the insecure-skip flag. It is the single place a client TLS config is built, so CA trust and skip-verify behave identically for every REST, metrics, and broker client. Callers resolve a CA path via OptionalCACertPool first, so a bad/unreadable CA fails closed at the call site (and this stays infallible, usable from functional-option builders that cannot return an error). For mutual TLS, add the client cert with AppendClientCert.

func TokensForBracketedList added in v0.8.0

func TokensForBracketedList(items ...hclwrite.Tokens) hclwrite.Tokens

TokensForBracketedList wraps zero or more pre-built token sequences in [ ... ], comma-separated. Use when list elements are arbitrary expressions (templates, references, function calls) rather than the bare identifiers / quoted strings covered by TokensForList / TokensForStringList.

func TokensForComment added in v0.5.0

func TokensForComment(comment string) hclwrite.Tokens

func TokensForConditional added in v0.5.0

func TokensForConditional(condition, trueValue, falseValue hclwrite.Tokens) hclwrite.Tokens

TokensForConditional creates tokens for a ternary conditional expression condition ? trueValue : falseValue

func TokensForFunctionCall added in v0.5.0

func TokensForFunctionCall(functionName string, args ...hclwrite.Tokens) hclwrite.Tokens

TokensForFunctionCall creates tokens for a function call with a string template argument e.g., base64encode("${var.key}:${var.secret}")

func TokensForList added in v0.5.0

func TokensForList(items []string) hclwrite.Tokens

TokensForList creates tokens for an array literal

func TokensForMap added in v0.5.0

func TokensForMap(entries map[string]hclwrite.Tokens) hclwrite.Tokens

TokensForMap creates tokens for a map/object with string keys and token values e.g., { key1 = value1, key2 = value2 }

func TokensForModuleOutput added in v0.5.0

func TokensForModuleOutput(moduleName, outputName string) hclwrite.Tokens

TokensForModuleOutput creates tokens for a Terraform module output reference (e.g., "module.networking.jump_cluster_broker_subnet_ids")

func TokensForResourceReference added in v0.5.0

func TokensForResourceReference(ref string) hclwrite.Tokens

TokensForReference creates tokens for a resource reference (e.g., "confluent_environment.environment.id")

func TokensForStringList added in v0.5.0

func TokensForStringList(items []string) hclwrite.Tokens

TokensForStringList creates tokens for a list of quoted strings (e.g., ["item1", "item2"])

func TokensForStringTemplate added in v0.5.0

func TokensForStringTemplate(template string) hclwrite.Tokens

TokensForTemplate creates properly formatted tokens for a template string (string with ${} interpolations)

func TokensForVarReference added in v0.5.0

func TokensForVarReference(varName string) hclwrite.Tokens

TokensForVarReference creates tokens for a Terraform variable reference (e.g., "var.my_variable")

func TokensForVarReferenceList added in v0.5.0

func TokensForVarReferenceList(varNames []string) hclwrite.Tokens

TokensForVarReferenceList creates tokens for a list of variable references (e.g., [var.name1, var.name2])

func URLToFolderName added in v0.5.0

func URLToFolderName(urlStr string) string

func ValidateOutputDir added in v0.7.2

func ValidateOutputDir(outputDir string) error

ValidateOutputDir checks if the output directory already exists. If it exists, it returns an error.

func WriteTerraformFiles added in v0.6.9

func WriteTerraformFiles(outputDir string, files hcltypes.TerraformFiles) error

WriteTerraformFiles writes the generated Terraform files to the output directory

Types

type AWSZone

type AWSZone struct {
	CIDR string
	Zone string
}

AWSZone represents an AWS availability zone with its CIDR block

func ValidateAWSZones

func ValidateAWSZones(awsZonesStr string) ([]AWSZone, error)

ValidateAWSZones validates and parses the AWSZones string into a slice of AWSZone structs Expected format: "us-east-1a:10.0.0.0/24,us-east-1b:10.0.1.0/24"

type ConnectorMapping added in v0.4.2

type ConnectorMapping struct {
	PluginName    string
	ConnectorType string
}

type TerraformOutputGetter

type TerraformOutputGetter func(hcltypes.TerraformOutputOld) any

Jump to

Keyboard shortcuts

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