hcl

package
v0.8.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CCSupportedTopicConfigsDocsURL = "https://docs.confluent.io/cloud/current/topics/manage.html#ak-topic-configurations-for-all-ccloud-cluster-types"

CCSupportedTopicConfigsDocsURL is the canonical reference for the CC-supported topic-config allow-list used by --mode new. Surfaced to the user in both the per-topic file header and the CLI note so the choice of dropped configs is auditable from either artifact.

Variables

This section is empty.

Functions

func GenerateInputsAutoTfvars added in v0.7.2

func GenerateInputsAutoTfvars(values map[string]any) string

GenerateInputsAutoTfvars generates an inputs.auto.tfvars file from a map of variable names to values. Supports string, []string, bool, int, and []ExtOutboundClusterKafkaBroker value types.

func GenerateOutputsTf added in v0.7.2

func GenerateOutputsTf(tfOutputs []types.TerraformOutput) string

GenerateOutputsTf generates an outputs.tf file from a list of output definitions.

func GenerateVariablesTf added in v0.7.2

func GenerateVariablesTf(tfVariables []types.TerraformVariable) string

GenerateVariablesTf generates a variables.tf file from a list of variable definitions. Duplicate variable names are deduplicated (first occurrence wins).

func GenerateVersionsTf added in v0.7.2

func GenerateVersionsTf(providers ...func(*hclwrite.Body)) string

GenerateVersionsTf generates a versions.tf file with the given required providers. Each provider function receives the required_providers block body to add its provider.

func SetModuleRef added in v0.7.2

func SetModuleRef(body *hclwrite.Body, attrName, moduleName, outputName string)

SetModuleRef sets an attribute to reference a module output: module.<moduleName>.<outputName>

func SetResourceRef added in v0.7.2

func SetResourceRef(body *hclwrite.Body, attrName, ref string)

SetResourceRef sets an attribute to a resource reference expression (unquoted).

func SetStringTemplate added in v0.7.2

func SetStringTemplate(body *hclwrite.Body, attrName, template string)

SetStringTemplate sets an attribute to a quoted string template.

func SetVarRef added in v0.7.2

func SetVarRef(body *hclwrite.Body, attrName, varName string)

SetVarRef sets an attribute to reference a Terraform variable: var.<varName>

func WriteMigrateConnectorsInfraFiles added in v0.8.2

func WriteMigrateConnectorsInfraFiles(outputDir string) error

WriteMigrateConnectorsInfraFiles writes the shared Terraform infrastructure files (providers.tf, variables.tf) needed by migrate-connectors output.

func WriteModuleInputs added in v0.7.2

func WriteModuleInputs[R any](body *hclwrite.Body, vars []modules.ModuleVariable[R], request R)

WriteModuleInputs writes module input attributes for a list of module variables. For each variable: if it comes from a module output, writes a module reference; otherwise, writes a variable reference.

func WriteTerraformProject added in v0.7.2

func WriteTerraformProject(outputDir string, project types.MigrationInfraTerraformProject) error

WriteTerraformProject writes a MigrationInfraTerraformProject to disk at the given output directory.

Types

type BastionHostHCLService added in v0.8.0

type BastionHostHCLService struct {
	// DeploymentID overrides the random deployment identifier in AWS provider tags.
	// When empty, a random 8-character string is generated.
	DeploymentID string

	// Now overrides the current time used to stamp the bastion host instance
	// Name tag. When nil, time.Now is used.
	Now func() time.Time
}

func NewBastionHostHCLService added in v0.8.0

func NewBastionHostHCLService() *BastionHostHCLService

func (*BastionHostHCLService) GenerateBastionHostFiles added in v0.8.0

func (s *BastionHostHCLService) GenerateBastionHostFiles(request types.BastionHostRequest) (types.TerraformFiles, error)

func (*BastionHostHCLService) GenerateBastionHostUserDataTemplate added in v0.8.0

func (s *BastionHostHCLService) GenerateBastionHostUserDataTemplate() string

type MigrationInfraGenerator added in v0.7.2

type MigrationInfraGenerator interface {
	GenerateTerraformModules(request types.MigrationWizardRequest) types.MigrationInfraTerraformProject
}

MigrationInfraGenerator generates Terraform modules for MSK-to-CC migration infrastructure.

type MigrationInfraHCLService

type MigrationInfraHCLService struct {
	// SSHKeySuffix overrides the random suffix used in SSH key pair names.
	// When empty, a random 5-character string is generated.
	SSHKeySuffix string
	// DeploymentID overrides the random deployment identifier in AWS provider tags.
	// When empty, a random 8-character string is generated.
	DeploymentID string
}

func NewMigrationInfraHCLService

func NewMigrationInfraHCLService() *MigrationInfraHCLService

func (*MigrationInfraHCLService) GenerateTerraformModules

type MigrationScriptsGenerator added in v0.7.2

type MigrationScriptsGenerator interface {
	GenerateMirrorTopicsFiles(request types.MirrorTopicsRequest) (types.MigrationScriptsTerraformProject, error)
	GenerateMigrateAclsFiles(request types.MigrateAclsRequest) (types.TerraformFiles, error)
	GenerateMigrateSchemasFiles(request types.MigrateSchemasRequest) (types.MigrationScriptsTerraformProject, error)
	GenerateMigrateGlueSchemasFiles(request types.MigrateGlueSchemasRequest) (types.MigrationScriptsTerraformProject, error)
}

MigrationScriptsGenerator generates Terraform files for migration scripts (mirror topics, ACLs, schemas).

type MigrationScriptsHCLService

type MigrationScriptsHCLService struct {
	// SchemaRegistryClusterID overrides the random placeholder ID in schema exporter resources.
	// When empty, a random 8-character string is generated.
	SchemaRegistryClusterID string
}

func NewMigrationScriptsHCLService

func NewMigrationScriptsHCLService() *MigrationScriptsHCLService

func (*MigrationScriptsHCLService) GenerateMigrateAclsFiles

func (s *MigrationScriptsHCLService) GenerateMigrateAclsFiles(request types.MigrateAclsRequest) (types.TerraformFiles, error)

func (*MigrationScriptsHCLService) GenerateMigrateConnectorsVariablesTf added in v0.8.2

func (s *MigrationScriptsHCLService) GenerateMigrateConnectorsVariablesTf() string

GenerateMigrateConnectorsVariablesTf returns the variables.tf content for the migrate-connectors output. It declares the Confluent Cloud API key/secret variables required by the provider block in providers.tf.

func (*MigrationScriptsHCLService) GenerateMigrateGlueSchemasFiles added in v0.7.2

func (*MigrationScriptsHCLService) GenerateMigrateSchemasFiles

func (*MigrationScriptsHCLService) GenerateMirrorTopicsFiles

GenerateMirrorTopicsFiles emits the migrate-topics Terraform layout: one .tf file per topic plus shared providers.tf and variables.tf. Both --mode mirror and --mode new use this layout. The legacy name is preserved for wire-format compatibility; consider renaming to GenerateMigrateTopicsFiles.

Filename collisions across sanitized topic names are surfaced as a hard error — auto-disambiguating would hide a real surprise from the user.

func (*MigrationScriptsHCLService) GenerateProvidersTf added in v0.8.2

func (s *MigrationScriptsHCLService) GenerateProvidersTf() string

GenerateProvidersTf returns the providers.tf content declaring the Confluent Terraform provider. Exported so that commands that bypass the full HCL project pipeline (e.g. migrate-connectors) can still emit a valid provider block.

type ReverseProxyHCLService

type ReverseProxyHCLService struct {
	// DeploymentID overrides the random deployment identifier in AWS provider tags.
	// When empty, a random 8-character string is generated.
	DeploymentID string
}

func NewReverseProxyHCLService

func NewReverseProxyHCLService() *ReverseProxyHCLService

func (*ReverseProxyHCLService) GenerateReverseProxyFiles

func (s *ReverseProxyHCLService) GenerateReverseProxyFiles(request types.ReverseProxyRequest) (types.TerraformFiles, error)

func (*ReverseProxyHCLService) GenerateReverseProxyShellScript

func (s *ReverseProxyHCLService) GenerateReverseProxyShellScript() string

func (*ReverseProxyHCLService) GenerateReverseProxyUserDataTemplate

func (s *ReverseProxyHCLService) GenerateReverseProxyUserDataTemplate() string

type TargetInfraGenerator added in v0.7.2

type TargetInfraGenerator interface {
	GenerateTerraformFiles(request types.TargetClusterWizardRequest) types.MigrationInfraTerraformProject
}

TargetInfraGenerator generates Terraform files for Confluent Cloud target infrastructure.

type TargetInfraHCLService

type TargetInfraHCLService struct {
	ResourceNames TerraformResourceNames
	// DeploymentID overrides the random deployment identifier in AWS provider tags.
	// When empty, a random 8-character string is generated.
	DeploymentID string
}

func NewTargetInfraHCLService

func NewTargetInfraHCLService() *TargetInfraHCLService

func (*TargetInfraHCLService) GenerateTerraformFiles

type TerraformResourceNames

type TerraformResourceNames struct {
	Environment                     string
	Cluster                         string
	Network                         string
	SchemaRegistry                  string
	ServiceAccount                  string
	SchemaRegistryAPIKey            string
	KafkaAPIKey                     string
	PrivateLinkAttachment           string
	PrivateLinkAttachmentConnection string
	PrivateLinkAccess               string
	IngressGateway                  string
	AccessPoint                     string
	SubjectResourceOwnerRoleBinding string
	KafkaClusterAdminRoleBinding    string
	DataStewardRoleBinding          string

	AvailabilityZones string
	CallerIdentity    string
	VpcEndpoint       string
	Route53Zone       string
	Route53Record     string
	SecurityGroup     string
	SubnetName        string
}

func NewTerraformResourceNames

func NewTerraformResourceNames() TerraformResourceNames

Directories

Path Synopsis
Package confluent: topic.go generates Terraform for plain Confluent Cloud topics (used by `kcp create-asset migrate-topics --mode new`).
Package confluent: topic.go generates Terraform for plain Confluent Cloud topics (used by `kcp create-asset migrate-topics --mode new`).

Jump to

Keyboard shortcuts

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