types

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INGRESS = "ingress"
	EGRESS  = "egress"
	BOTH    = "both"
	ALLOW   = "allow"
	DENY    = "deny"
)
View Source
const (
	INTERNET       = "Internet"
	VIRTUALNETWORK = "VirtualNetwork"
)
View Source
const (
	READ  = "read"
	WRITE = "write"
	OWNER = "owner"
)
View Source
const SasExpirationDuration = time.Hour * 24 * 365

Variables

View Source
var SUPPORTED_CONTENT_TYPES = []string{"text/html", "application/zip"}

Functions

This section is empty.

Types

type AclRules

type AclRules struct{}

type AwsCallerIdentityData

type AwsCallerIdentityData struct {
	*output.TerraformDataSource `hcl:",squash" default:"name=aws_caller_identity"`
}

type AwsRegionData

type AwsRegionData struct {
	*output.TerraformDataSource `hcl:",squash" default:"name=aws_region"`
}

type AzureClientConfig

type AzureClientConfig struct {
	*output.TerraformDataSource `hcl:",squash" default:"name=azurerm_client_config"`
}

type Database

type Database struct {
	*resources.CommonResourceParams
	Name          string    `hcl:"name"`
	Engine        string    `hcl:"engine"`
	EngineVersion string    `hcl:"engine_version"`
	Storage       int       `hcl:"storage"`
	Size          string    `hcl:"size"`
	DbUsername    string    `hcl:"db_username"`
	DbPassword    string    `hcl:"db_password"`
	SubnetIds     []*Subnet `mhcl:"ref=subnet_ids"`
}

func (*Database) GetMainResourceName

func (db *Database) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*Database) GetOutputValues

func (db *Database) GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

func (*Database) Translate

func (db *Database) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*Database) Validate

func (db *Database) Validate(ctx resources.MultyContext, cloud common.CloudProvider) (errs []validate.ValidationError)

type KubernetesService

type KubernetesService struct {
	*resources.CommonResourceParams
	Name      string    `hcl:"name"`
	SubnetIds []*Subnet `mhcl:"ref=subnet_ids"`
}

func (*KubernetesService) GetMainResourceName

func (r *KubernetesService) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*KubernetesService) GetOutputValues

func (r *KubernetesService) GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

func (*KubernetesService) Translate

func (*KubernetesService) Validate

type KubernetesServiceNodePool

type KubernetesServiceNodePool struct {
	*resources.CommonResourceParams
	Name              string             `hcl:"name"`
	ClusterId         *KubernetesService `mhcl:"ref=cluster_id"`
	IsDefaultPool     bool               `hcl:"is_default_pool,optional"`
	SubnetIds         []*Subnet          `mhcl:"ref=subnet_ids"` // azure??
	StartingNodeCount *int               `hcl:"starting_node_count,optional"`
	MaxNodeCount      int                `hcl:"max_node_count"`
	MinNodeCount      int                `hcl:"min_node_count"`
	Labels            map[string]string  `hcl:"labels,optional"`
	VmSize            string             `hcl:"vm_size"`
	DiskSizeGiB       int                `hcl:"disk_size_gib,optional"`
}

func (*KubernetesServiceNodePool) GetLocation added in v0.1.13

func (*KubernetesServiceNodePool) GetMainResourceName

func (r *KubernetesServiceNodePool) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*KubernetesServiceNodePool) Translate

func (*KubernetesServiceNodePool) Validate

type Lambda

type Lambda struct {
	*resources.CommonResourceParams
	FunctionName string `hcl:"function_name"`
	// This is only used for AWS since azure has a .json file within the source code folder.
	Runtime          string               `hcl:"runtime"`
	SourceCodeDir    string               `hcl:"source_code_dir,optional"`
	SourceCodeObject *ObjectStorageObject `mhcl:"ref=source_code_object,optional"`
}

func (*Lambda) GetMainResourceName

func (r *Lambda) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*Lambda) GetOutputValues

func (r *Lambda) GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

func (*Lambda) Translate

func (r *Lambda) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*Lambda) Validate

func (r *Lambda) Validate(ctx resources.MultyContext, cloud common.CloudProvider) (errs []validate.ValidationError)

type NetworkInterface

type NetworkInterface struct {
	*resources.CommonResourceParams
	Name     string  `hcl:"name"`
	SubnetId *Subnet `mhcl:"ref=subnet_id"`
}

func (*NetworkInterface) GetId

func (r *NetworkInterface) GetId(cloud common.CloudProvider) string

func (*NetworkInterface) GetMainResourceName

func (r *NetworkInterface) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*NetworkInterface) Translate

func (*NetworkInterface) Validate

type NetworkSecurityGroup

type NetworkSecurityGroup struct {
	*resources.CommonResourceParams
	Name           string          `hcl:"name"`
	VirtualNetwork *VirtualNetwork `mhcl:"ref=virtual_network"`
	Rules          []RuleType      `hcl:"rules,optional"`
}

func (*NetworkSecurityGroup) GetMainResourceName

func (r *NetworkSecurityGroup) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*NetworkSecurityGroup) Translate

func (*NetworkSecurityGroup) Validate

type ObjectStorage

type ObjectStorage struct {
	*resources.CommonResourceParams
	Name       string     `hcl:"name"`
	Acl        []AclRules `hcl:"acl,optional"`
	Versioning bool       `hcl:"versioning,optional"`
}

func (*ObjectStorage) GetAssociatedPrivateContainerResourceName

func (r *ObjectStorage) GetAssociatedPrivateContainerResourceName(cloud common.CloudProvider) string

func (*ObjectStorage) GetAssociatedPublicContainerResourceName

func (r *ObjectStorage) GetAssociatedPublicContainerResourceName(cloud common.CloudProvider) string

func (*ObjectStorage) GetMainResourceName

func (r *ObjectStorage) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*ObjectStorage) GetResourceName

func (r *ObjectStorage) GetResourceName(cloud common.CloudProvider) string

func (*ObjectStorage) Translate

func (*ObjectStorage) Validate

type ObjectStorageObject

type ObjectStorageObject struct {
	*resources.CommonResourceParams
	Name          string         `hcl:"name"`
	Content       string         `hcl:"content,optional"`
	ObjectStorage *ObjectStorage `mhcl:"ref=object_storage"`
	ContentType   string         `hcl:"content_type,optional"`
	Acl           string         `hcl:"acl,optional"`
	Source        string         `hcl:"source,optional"`
}

func (*ObjectStorageObject) GetAzureBlobName

func (r *ObjectStorageObject) GetAzureBlobName() string

func (*ObjectStorageObject) GetAzureBlobUrl

func (r *ObjectStorageObject) GetAzureBlobUrl() string

func (*ObjectStorageObject) GetLocation added in v0.1.13

func (*ObjectStorageObject) GetMainResourceName

func (r *ObjectStorageObject) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*ObjectStorageObject) GetS3Key

func (r *ObjectStorageObject) GetS3Key() string

func (*ObjectStorageObject) IsPrivate

func (r *ObjectStorageObject) IsPrivate() bool

func (*ObjectStorageObject) Translate

func (*ObjectStorageObject) Validate

type Provider

type Provider struct {
	Cloud             common.CloudProvider
	Location          string
	IsDefaultProvider bool
	NumResources      int
	Credentials       *creds.CloudCredentials
}

func (*Provider) GetId

func (p *Provider) GetId() string

func (*Provider) GetResourceId

func (p *Provider) GetResourceId() string

func (*Provider) Translate

func (p *Provider) Translate() []any

type PublicIp

type PublicIp struct {
	*resources.CommonResourceParams
	Name               string            `hcl:"name"`
	NetworkInterfaceId *NetworkInterface `mhcl:"ref=network_interface_id,optional"`
}

func (*PublicIp) GetId

func (r *PublicIp) GetId(cloud common.CloudProvider) string

func (*PublicIp) GetMainResourceName

func (r *PublicIp) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*PublicIp) Translate

func (r *PublicIp) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*PublicIp) Validate

func (r *PublicIp) Validate(ctx resources.MultyContext, cloud common.CloudProvider) (errs []validate.ValidationError)

type RouteTable

type RouteTable struct {
	*resources.CommonResourceParams
	Name           string            `hcl:"name"`
	VirtualNetwork *VirtualNetwork   `mhcl:"ref=virtual_network,optional"`
	Routes         []RouteTableRoute `hcl:"routes,optional"`
}

func (*RouteTable) GetId

func (r *RouteTable) GetId(cloud common.CloudProvider) string

func (*RouteTable) GetMainResourceName

func (r *RouteTable) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*RouteTable) Translate

func (r *RouteTable) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*RouteTable) Validate

type RouteTableAssociation

type RouteTableAssociation struct {
	*resources.CommonResourceParams
	SubnetId     *Subnet     `mhcl:"ref=subnet_id"`
	RouteTableId *RouteTable `mhcl:"ref=route_table_id"`
}

route_table_association

func (*RouteTableAssociation) GetLocation added in v0.1.13

func (*RouteTableAssociation) GetMainResourceName

func (r *RouteTableAssociation) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*RouteTableAssociation) Translate

func (*RouteTableAssociation) Validate

type RouteTableRoute

type RouteTableRoute struct {
	CidrBlock   string `cty:"cidr_block"`
	Destination string `cty:"destination"` // allowed: Internet
}

type RuleType

type RuleType struct {
	Protocol  string `cty:"protocol"`
	Priority  int    `cty:"priority"`
	FromPort  string `cty:"from_port"`
	ToPort    string `cty:"to_port"`
	CidrBlock string `cty:"cidr_block"`
	Direction string `cty:"direction"`
}

type Subnet

type Subnet struct {
	*resources.CommonResourceParams
	Name             string          `hcl:"name"`
	CidrBlock        string          `hcl:"cidr_block"`
	VirtualNetwork   *VirtualNetwork `mhcl:"ref=virtual_network"`
	AvailabilityZone int             `hcl:"availability_zone,optional"`
}

func (*Subnet) GetId

func (s *Subnet) GetId(cloud common.CloudProvider) string

func (*Subnet) GetLocation added in v0.1.13

func (s *Subnet) GetLocation(cloud common.CloudProvider, ctx resources.MultyContext) string

func (*Subnet) GetMainResourceName

func (s *Subnet) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*Subnet) Translate

func (s *Subnet) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*Subnet) Validate

func (s *Subnet) Validate(ctx resources.MultyContext, cloud common.CloudProvider) (errs []validate.ValidationError)

type Vault

type Vault struct {
	*resources.CommonResourceParams
	Name string `hcl:"name"`
}

func (*Vault) GetMainResourceName

func (r *Vault) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*Vault) GetVaultId

func (r *Vault) GetVaultId(cloud common.CloudProvider) (string, error)

func (*Vault) Translate

func (r *Vault) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*Vault) Validate

func (r *Vault) Validate(ctx resources.MultyContext, cloud common.CloudProvider) (errs []validate.ValidationError)

type VaultAccessPolicy

type VaultAccessPolicy struct {
	*resources.CommonResourceParams
	Vault    *Vault `mhcl:"ref=vault"`
	Identity string `hcl:"identity"`
	Access   string `hcl:"access"`
}

func (*VaultAccessPolicy) GetAccessPolicyRules

func (r *VaultAccessPolicy) GetAccessPolicyRules(cloud common.CloudProvider) *vault.AzureKeyVaultPermissions

fix return

func (*VaultAccessPolicy) GetLocation added in v0.1.13

func (*VaultAccessPolicy) GetMainResourceName

func (r *VaultAccessPolicy) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*VaultAccessPolicy) Translate

func (*VaultAccessPolicy) Validate

type VaultSecret

type VaultSecret struct {
	*resources.CommonResourceParams
	Name  string `hcl:"name"`
	Value string `hcl:"value"`
	Vault *Vault `mhcl:"ref=vault"`
}

func (*VaultSecret) GetLocation added in v0.1.13

func (r *VaultSecret) GetLocation(cloud common.CloudProvider, ctx resources.MultyContext) string

func (*VaultSecret) GetMainResourceName

func (r *VaultSecret) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*VaultSecret) Translate

func (r *VaultSecret) Translate(cloud common.CloudProvider, ctx resources.MultyContext) ([]output.TfBlock, error)

func (*VaultSecret) Validate

type VirtualMachine

type VirtualMachine struct {
	*resources.CommonResourceParams
	Name                    string                  `hcl:"name"`
	OperatingSystem         string                  `hcl:"os"`
	NetworkInterfaceIds     []*NetworkInterface     `mhcl:"ref=network_interface_ids,optional"`
	NetworkSecurityGroupIds []*NetworkSecurityGroup `mhcl:"ref=network_security_group_ids,optional"`
	Size                    string                  `hcl:"size"`
	UserData                string                  `hcl:"user_data,optional"`
	SubnetId                *Subnet                 `mhcl:"ref=subnet_id"`
	SshKeyFileName          string                  `hcl:"ssh_key_file_path,optional"`
	SshKey                  string                  `hcl:"ssh_key,optional"`
	PublicIpId              *PublicIp               `mhcl:"ref=public_ip_id,optional"`
	// PublicIp auto-generate public IP
	PublicIp bool `hcl:"public_ip,optional"`
}

func (*VirtualMachine) GetAssociatedKeyPairName

func (vm *VirtualMachine) GetAssociatedKeyPairName(cloud common.CloudProvider) (string, error)

func (*VirtualMachine) GetMainResourceName

func (vm *VirtualMachine) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*VirtualMachine) GetOutputValues

func (vm *VirtualMachine) GetOutputValues(cloud common.CloudProvider) map[string]cty.Value

func (*VirtualMachine) Translate

func (*VirtualMachine) Validate

type VirtualNetwork

type VirtualNetwork struct {
	*resources.CommonResourceParams `hcl:",block"`
	Name                            string `hcl:"name"`
	CidrBlock                       string `hcl:"cidr_block"`
}

func (*VirtualNetwork) GetAssociatedInternetGateway

func (vn *VirtualNetwork) GetAssociatedInternetGateway(cloud common.CloudProvider) (string, error)

func (*VirtualNetwork) GetAssociatedRouteTableId

func (vn *VirtualNetwork) GetAssociatedRouteTableId(cloud common.CloudProvider) (string, error)

func (*VirtualNetwork) GetMainResourceName

func (vn *VirtualNetwork) GetMainResourceName(cloud common.CloudProvider) (string, error)

func (*VirtualNetwork) GetVirtualNetworkId

func (vn *VirtualNetwork) GetVirtualNetworkId(cloud common.CloudProvider) string

func (*VirtualNetwork) GetVirtualNetworkName

func (vn *VirtualNetwork) GetVirtualNetworkName(cloud common.CloudProvider) string

func (*VirtualNetwork) Translate

func (*VirtualNetwork) Validate

TODO validate commonparams

Jump to

Keyboard shortcuts

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