lwgenerate

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LaceworkProviderSource  = "lacework/lacework"
	LaceworkProviderVersion = "~> 1.0"

	AwsConfigSource      = "lacework/config/aws"
	AwsConfigVersion     = "~> 0.5"
	AwsCloudTrailSource  = "lacework/cloudtrail/aws"
	AwsCloudTrailVersion = "~> 2.0"
	AwsEksAuditSource    = "lacework/eks-audit-log/aws"
	AwsEksAuditVersion   = "~> 0.4"

	LWAzureConfigSource       = "lacework/config/azure"
	LWAzureConfigVersion      = "~> 2.0"
	LWAzureActivityLogSource  = "lacework/activity-log/azure"
	LWAzureActivityLogVersion = "~> 2.0"
	LWAzureADSource           = "lacework/ad-application/azure"
	LWAzureADVersion          = "~> 1.0"

	GcpConfigSource          = "lacework/config/gcp"
	GcpConfigVersion         = "~> 2.3"
	GcpAuditLogSource        = "lacework/audit-log/gcp"
	GcpAuditLogVersion       = "~> 3.0"
	GcpGKEAuditLogSource     = "lacework/gke-audit-log/gcp"
	GcpGKEAuditLogVersion    = "~> 0.3"
	GcpPubSubAuditLog        = "lacework/pub-sub-audit-log/gcp"
	GcpPubSubAuditLogVersion = "~> 0.2"
)

Variables

This section is empty.

Functions

func CombineHclBlocks

func CombineHclBlocks(results ...interface{}) []*hclwrite.Block

CombineHclBlocks Simple helper to combine multiple blocks (or slices of blocks) into a single slice to be rendered to string

func CreateHclStringOutput

func CreateHclStringOutput(blocks []*hclwrite.Block) string

CreateHclStringOutput Convert blocks to a string

func CreateRequiredProviders

func CreateRequiredProviders(providers ...*HclRequiredProvider) (*hclwrite.Block, error)

CreateRequiredProviders Create required providers block

func CreateSimpleTraversal

func CreateSimpleTraversal(input []string) hcl.Traversal

CreateSimpleTraversal helper to create a hcl.Traversal in the order of supplied []string

e.g. []string{"a", "b", "c"} as input results in traversal having value a.b.c

func HclCreateGenericBlock

func HclCreateGenericBlock(hcltype string, labels []string, attr map[string]interface{}) (*hclwrite.Block, error)

HclCreateGenericBlock Helper to create various types of new hclwrite.Block using generic inputs

Types

type ForEach added in v1.18.0

type ForEach struct {
	// contains filtered or unexported fields
}

type HclModule

type HclModule struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(name string, source string, mods ...HclModuleModifier) *HclModule

NewModule Create a provider statement in the HCL output

func (*HclModule) ToBlock

func (m *HclModule) ToBlock() (*hclwrite.Block, error)

ToBlock Create hclwrite.Block for module

type HclModuleModifier

type HclModuleModifier func(p *HclModule)

func HclModuleWithAttributes

func HclModuleWithAttributes(attrs map[string]interface{}) HclModuleModifier

HclModuleWithAttributes Used to set parameters within the module usage

func HclModuleWithForEach added in v1.18.0

func HclModuleWithForEach(key string, value map[string]string) HclModuleModifier

func HclModuleWithProviderDetails

func HclModuleWithProviderDetails(providerDetails map[string]string) HclModuleModifier

HclModuleWithProviderDetails Used to provide additional provider details to a given module.

Note: The values supplied become traversals

e.g. https://www.terraform.io/docs/language/modules/develop/providers.html#passing-providers-explicitly

func HclModuleWithVersion

func HclModuleWithVersion(version string) HclModuleModifier

HclModuleWithVersion Used to set the version of a module source to use

type HclProvider

type HclProvider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(name string, mods ...HclProviderModifier) *HclProvider

NewProvider Create a new HCL Provider

func (*HclProvider) ToBlock

func (p *HclProvider) ToBlock() (*hclwrite.Block, error)

type HclProviderModifier

type HclProviderModifier func(p *HclProvider)

func HclProviderWithAttributes

func HclProviderWithAttributes(attrs map[string]interface{}) HclProviderModifier

type HclRequiredProvider

type HclRequiredProvider struct {
	// contains filtered or unexported fields
}

func NewRequiredProvider

func NewRequiredProvider(name string, mods ...HclRequiredProviderModifier) *HclRequiredProvider

func (*HclRequiredProvider) Name

func (p *HclRequiredProvider) Name() string

func (*HclRequiredProvider) Source

func (p *HclRequiredProvider) Source() string

func (*HclRequiredProvider) Version

func (p *HclRequiredProvider) Version() string

type HclRequiredProviderModifier

type HclRequiredProviderModifier func(p *HclRequiredProvider)

func HclRequiredProviderWithSource

func HclRequiredProviderWithSource(source string) HclRequiredProviderModifier

func HclRequiredProviderWithVersion

func HclRequiredProviderWithVersion(version string) HclRequiredProviderModifier

type HclResource added in v0.45.0

type HclResource struct {
	// contains filtered or unexported fields
}

func NewResource added in v0.45.0

func NewResource(rType string, name string, mods ...HclResourceModifier) *HclResource

NewResource Create a provider statement in the HCL output

func (*HclResource) ToResourceBlock added in v0.45.0

func (m *HclResource) ToResourceBlock() (*hclwrite.Block, error)

ToResourceBlock Create hclwrite.Block for resource

type HclResourceModifier added in v0.45.0

type HclResourceModifier func(p *HclResource)

func HclResourceWithAttributesAndProviderDetails added in v0.45.0

func HclResourceWithAttributesAndProviderDetails(attrs map[string]interface{},
	providerDetails []string) HclResourceModifier

HclResourceWithAttributesAndProviderDetails Used to set parameters within the resource usage

Directories

Path Synopsis
_examples
aws
gcp
hcl

Jump to

Keyboard shortcuts

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