convert

package
v3.0.0-...-18a6489 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LanguageTypescript string = "typescript"
	LanguagePulumi     string = "pulumi"
	LanguagePython     string = "python"
	LanguageCSharp     string = "csharp"
	LanguageGo         string = "go"
	LanguageJava       string = "java"
	LanguageYaml       string = "yaml"
)

Variables

Functions

func Eject

func Eject(dir string, loader schema.ReferenceLoader, mapper convert.Mapper) (*workspace.Project, *pcl.Program, error)

Eject converts a Terraform module at the provided location into a Pulumi module.

Types

type Diagnostics

type Diagnostics struct {
	All hcl.Diagnostics
	// contains filtered or unexported fields
}

func Convert

func Convert(opts Options) (map[string][]byte, Diagnostics, error)

Convert converts a Terraform module at the provided location into a Pulumi module, written to stdout.

func (*Diagnostics) NewDiagnosticWriter

func (d *Diagnostics) NewDiagnosticWriter(w io.Writer, width uint, color bool) hcl.DiagnosticWriter

type EjectOptions

type EjectOptions struct {
	// AllowMissingProperties, if true, allows code-gen to continue even if the input configuration does not include.
	// values for required properties.
	AllowMissingProperties bool
	// AllowMissingProviders, if true, allows code-gen to continue even if resource providers are missing.
	AllowMissingProviders bool
	// AllowMissingVariables, if true, allows code-gen to continue even if the input configuration references missing
	// variables.
	AllowMissingVariables bool
	// AllowMissingComments allows binding to succeed even if there are errors extracting comments from the source.
	AllowMissingComments bool
	// AnnotateNodesWithLocations is true if the generated source code should contain comments that annotate top-level
	// nodes with their original source locations.
	AnnotateNodesWithLocations bool
	// FilterResourceNames, if true, removes the property indicated by ResourceNameProperty from all resources in the
	// graph.
	FilterResourceNames bool
	// ResourceNameProperty sets the key of the resource name property that will be removed if FilterResourceNames is
	// true.
	ResourceNameProperty string
	// Root, when set, overrides the default filesystem used to load the source Terraform module.
	Root afero.Fs
	// Optional package cache.
	PackageCache *pcl.PackageCache
	// Optional plugin host.
	PluginHost plugin.Host
	// Optional Loader.
	Loader schema.Loader
	// Optional source for provider schema information.
	ProviderInfoSource il.ProviderInfoSource
	// Optional logger for diagnostic information.
	Logger *log.Logger
	// SkipResourceTypechecking, if true, allows code-gen to continue even if resource inputs fail to typecheck.
	SkipResourceTypechecking bool
	// The target SDK version.
	TargetSDKVersion string
	// The version of Terraform targeteds by the input configuration.
	TerraformVersion string
}

type Options

type Options struct {
	// AllowMissingProperties, if true, allows code-gen to continue even if the input configuration does not include.
	// values for required properties.
	AllowMissingProperties bool
	// AllowMissingProviders, if true, allows code-gen to continue even if resource providers are missing.
	AllowMissingProviders bool
	// AllowMissingVariables, if true, allows code-gen to continue even if the input configuration references missing
	// variables.
	AllowMissingVariables bool
	// AllowMissingComments allows binding to succeed even if there are errors extracting comments from the source.
	AllowMissingComments bool
	// AnnotateNodesWithLocations is true if the generated source code should contain comments that annotate top-level
	// nodes with their original source locations.
	AnnotateNodesWithLocations bool
	// FilterResourceNames, if true, removes the property indicated by ResourceNameProperty from all resources in the
	// graph.
	FilterResourceNames bool
	// ResourceNameProperty sets the key of the resource name property that will be removed if FilterResourceNames is
	// true.
	ResourceNameProperty string
	// Root, when set, overrides the default filesystem used to load the source Terraform module.
	Root afero.Fs
	// Optional package cache.
	PackageCache *pcl.PackageCache
	// Optional plugin host.
	PluginHost plugin.Host
	// Optional Loader.
	Loader schema.Loader
	// Optional source for provider schema information.
	ProviderInfoSource il.ProviderInfoSource
	// Optional logger for diagnostic information.
	Logger *log.Logger
	// SkipResourceTypechecking, if true, allows code-gen to continue even if resource inputs fail to typecheck.
	SkipResourceTypechecking bool
	// The target language.
	TargetLanguage string
	// The target SDK version.
	TargetSDKVersion string
	// The version of Terraform targeteds by the input configuration.
	TerraformVersion string

	// TargetOptions captures any target-specific options.
	TargetOptions interface{}
}

Jump to

Keyboard shortcuts

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