terraform

package
v1.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseExistingResources added in v1.3.0

func ParseExistingResources(dir string) (map[string]bool, error)

ParseExistingResources reads all .tf files in dir and returns a set of "type.name" strings for every resource block found.

func PrintImportCommands added in v1.3.0

func PrintImportCommands(w io.Writer, cmds []ImportCommand) error

PrintImportCommands writes terraform import commands to w.

func WriteAll

func WriteAll(resources *gitlab.Resources, dir string, mainGroup string, skipSet skip.Set) error

func WriteGroupHooks added in v1.7.0

func WriteGroupHooks(g *gl.Group, hooks []*gl.GroupHook, w io.Writer) error

func WriteGroupLabelResource added in v1.5.0

func WriteGroupLabelResource(group *gl.Group, w io.Writer) error

func WriteGroupLabelVariable added in v1.5.0

func WriteGroupLabelVariable(groups []*gl.Group, groupLabels gitlab.GroupLabels, w io.Writer) error

func WriteGroupMembershipResource added in v1.1.0

func WriteGroupMembershipResource(group *gl.Group, w io.Writer) error

func WriteGroupMembershipVariable added in v1.1.0

func WriteGroupMembershipVariable(groups []*gl.Group, groupMembers gitlab.GroupMembers, w io.Writer) error

func WriteGroupVariables added in v1.8.0

func WriteGroupVariables(g *gl.Group, vars []*gl.GroupVariable, w io.Writer) error

func WriteGroups

func WriteGroups(groups []*gl.Group, w io.Writer, groupRefs groupRefMap) error

WriteGroups writes GitLab groups as Terraform HCL resources.

func WritePipelineSchedules added in v1.6.0

func WritePipelineSchedules(p *gl.Project, schedules []*gl.PipelineSchedule, w io.Writer) error

func WriteProjectHooks added in v1.7.0

func WriteProjectHooks(p *gl.Project, hooks []*gl.ProjectHook, w io.Writer) error

func WriteProjectLabelResource added in v1.5.0

func WriteProjectLabelResource(project *gl.Project, w io.Writer) error

func WriteProjectLabelVariable added in v1.5.0

func WriteProjectLabelVariable(projects []*gl.Project, projectLabels gitlab.ProjectLabels, w io.Writer) error

func WriteProjectMembershipHelpers added in v1.1.0

func WriteProjectMembershipHelpers(w io.Writer) error

func WriteProjectMembershipVariable added in v1.1.0

func WriteProjectMembershipVariable(projects []*gl.Project, w io.Writer) error

func WriteProjectShareGroupResource added in v1.1.0

func WriteProjectShareGroupResource(project *gl.Project, w io.Writer) error

func WriteProjectVariables added in v1.8.0

func WriteProjectVariables(p *gl.Project, vars []*gl.ProjectVariable, w io.Writer) error

func WriteProjects

func WriteProjects(projects []*gl.Project, w io.Writer, groupRefs groupRefMap) error

WriteProjects writes GitLab projects as Terraform HCL resources.

func WriteUserDataSource added in v1.2.0

func WriteUserDataSource(w io.Writer) error

Types

type ImportCommand added in v1.3.0

type ImportCommand struct {
	Address string
	ID      string
}

ImportCommand represents a single terraform import command.

func GenerateImportCommands added in v1.3.0

func GenerateImportCommands(resources *gitlab.Resources, existingResources map[string]bool, mainGroup string, skipSet skip.Set) []ImportCommand

GenerateImportCommands returns import commands for resources that exist in the API response but not in the existing terraform files.

Jump to

Keyboard shortcuts

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