exec

package
v1.6.6-prerelease.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

README

Terraform Exec package

HCL handling

This package is using the hcl package to handle the storage of variable's values used.

See also https://hclguide.readthedocs.io/en/latest/go_decoding_gohcl.html

How to write mapping from tfvars file to Golang struct

  • High-level fields should be annotated with hcl:"<tf_field_name>"
  • Nested structure should be annotated with cty:"field_name"

For more information, there is a good explanation on StackOverflow why nested structure should be annotated with cty

State and Vars handling

For each apply, if no error occured, the tfvars file will be written so that we can easily retrieve the args which were used.

That will also help to modify easily the configuration of the different resources.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTFvarsFile added in v1.6.3

func DeleteTFvarsFile(tfVarsFile string) error

func ReadTerraformVarsFile added in v1.6.3

func ReadTerraformVarsFile(filePath string, obj interface{}) error

func WriteTFvarsFile added in v1.6.3

func WriteTFvarsFile(obj interface{}, tfvarsFilePath string) error

Types

type AccountRoleService

type AccountRoleService interface {
	Init() error
	Plan(args *AccountRolesArgs) (string, error)
	Apply(args *AccountRolesArgs) (string, error)
	Output() (*AccountRolesOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*AccountRolesArgs, error)
	DeleteTFVars() error
}

func NewAccountRoleService

func NewAccountRoleService(tfWorkspace string, clusterType constants.ClusterType) (AccountRoleService, error)

type AccountRolesArgs

type AccountRolesArgs struct {
	AccountRolePrefix   *string            `hcl:"account_role_prefix"`
	OpenshiftVersion    *string            `hcl:"openshift_version"`
	UnifiedAccRolesPath *string            `hcl:"path"`
	SharedVpcRoleArn    *string            `hcl:"shared_vpc_role_arn"`
	PermissionsBoundary *string            `hcl:"permissions_boundary"`
	Tags                *map[string]string `hcl:"tags"`
}

type AccountRolesOutput added in v1.4.0

type AccountRolesOutput struct {
	AccountRolePrefix string `json:"account_role_prefix,omitempty"`
	InstallerRoleArn  string `json:"installer_role_arn,omitempty"`
	AWSAccountId      string `json:"aws_account_id,omitempty"`
}

type AllowedRegistryForImport added in v1.6.5

type AllowedRegistryForImport struct {
	DomainName *string `cty:"domain_name"`
	Insecure   *bool   `cty:"insecure"`
}

func GetAllowedRegistryForImport added in v1.6.5

func GetAllowedRegistryForImport(domainName string, insecure bool) AllowedRegistryForImport

type Autoscaling added in v1.6.3

type Autoscaling struct {
	AutoscalingEnabled *bool `cty:"autoscaling_enabled"`
	MinReplicas        *int  `cty:"min_replicas"`
	MaxReplicas        *int  `cty:"max_replicas"`
}

type ClusterArgs added in v1.6.3

type ClusterArgs struct {
	AccountRolePrefix                    *string            `hcl:"account_role_prefix"`
	ClusterName                          *string            `hcl:"cluster_name"`
	OperatorRolePrefix                   *string            `hcl:"operator_role_prefix"`
	OpenshiftVersion                     *string            `hcl:"openshift_version"`
	AWSRegion                            *string            `hcl:"aws_region"`
	AWSAvailabilityZones                 *[]string          `hcl:"aws_availability_zones"`
	Replicas                             *int               `hcl:"replicas"`
	ChannelGroup                         *string            `hcl:"channel_group"`
	Ec2MetadataHttpTokens                *string            `hcl:"ec2_metadata_http_tokens"`
	PrivateLink                          *bool              `hcl:"private_link"`
	Private                              *bool              `hcl:"private"`
	Fips                                 *bool              `hcl:"fips"`
	Tags                                 *map[string]string `hcl:"tags"`
	AuditLogForward                      *bool              `hcl:"audit_log_forward"`
	Autoscaling                          *Autoscaling       `hcl:"autoscaling"`
	Etcd                                 *bool              `hcl:"etcd_encryption"`
	EtcdKmsKeyARN                        *string            `hcl:"etcd_kms_key_arn"`
	KmsKeyARN                            *string            `hcl:"kms_key_arn"`
	AWSSubnetIDs                         *[]string          `hcl:"aws_subnet_ids"`
	ComputeMachineType                   *string            `hcl:"compute_machine_type"`
	DefaultMPLabels                      *map[string]string `hcl:"default_mp_labels"`
	DisableSCPChecks                     *bool              `hcl:"disable_scp_checks"`
	MultiAZ                              *bool              `hcl:"multi_az"`
	CustomProperties                     *map[string]string `hcl:"custom_properties"`
	WorkerDiskSize                       *int               `hcl:"worker_disk_size"`
	AdditionalComputeSecurityGroups      *[]string          `hcl:"additional_compute_security_groups"`
	AdditionalInfraSecurityGroups        *[]string          `hcl:"additional_infra_security_groups"`
	AdditionalControlPlaneSecurityGroups *[]string          `hcl:"additional_control_plane_security_groups"`
	MachineCIDR                          *string            `hcl:"machine_cidr"`
	OIDCConfigID                         *string            `hcl:"oidc_config_id"`
	AdminCredentials                     *map[string]string `hcl:"admin_credentials"`
	DisableUWM                           *bool              `hcl:"disable_workload_monitoring"`
	Proxy                                *Proxy             `hcl:"proxy"`
	UnifiedAccRolesPath                  *string            `hcl:"path"`
	UpgradeAcknowledgementsFor           *string            `hcl:"upgrade_acknowledgements_for"`
	BaseDnsDomain                        *string            `hcl:"base_dns_domain"`
	PrivateHostedZone                    *PrivateHostedZone `hcl:"private_hosted_zone"`
	WaitForCluster                       *bool              `hcl:"wait_for_cluster"`
	DisableClusterWaiter                 *bool              `hcl:"disable_cluster_waiter"`
	DisableWaitingInDestroy              *bool              `hcl:"disable_waiting_in_destroy"`
	DomainPrefix                         *string            `hcl:"domain_prefix"`
	AWSAccountID                         *string            `hcl:"aws_account_id"`
	AWSBillingAccountID                  *string            `hcl:"aws_billing_account_id"`
	HostPrefix                           *int               `hcl:"host_prefix"`
	ServiceCIDR                          *string            `hcl:"service_cidr"`
	PodCIDR                              *string            `hcl:"pod_cidr"`
	StsInstallerRole                     *string            `hcl:"installer_role"`
	StsSupportRole                       *string            `hcl:"support_role"`
	StsWorkerRole                        *string            `hcl:"worker_role"`
	RegistryConfig                       *RegistryConfig    `hcl:"registry_config"`

	IncludeCreatorProperty *bool `hcl:"include_creator_property"`

	FullResources *bool `hcl:"full_resources"`
}

type ClusterAutoscalerArgs added in v1.6.3

type ClusterAutoscalerArgs struct {
	Cluster                     *string         `hcl:"cluster_id"`
	BalanceSimilarNodeGroups    *bool           `hcl:"balance_similar_node_groups"`
	SkipNodesWithLocalStorage   *bool           `hcl:"skip_nodes_with_local_storage"`
	LogVerbosity                *int            `hcl:"log_verbosity"`
	MaxPodGracePeriod           *int            `hcl:"max_pod_grace_period"`
	PodPriorityThreshold        *int            `hcl:"pod_priority_threshold"`
	IgnoreDaemonsetsUtilization *bool           `hcl:"ignore_daemonsets_utilization"`
	MaxNodeProvisionTime        *string         `hcl:"max_node_provision_time"`
	BalancingIgnoredLabels      *[]string       `hcl:"balancing_ignored_labels"`
	ResourceLimits              *ResourceLimits `hcl:"resource_limits"`
	ScaleDown                   *ScaleDown      `hcl:"scale_down"`
}

type ClusterAutoscalerOutput added in v1.6.3

type ClusterAutoscalerOutput struct {
	Cluster                     string   `json:"cluster_id,omitempty"`
	BalanceSimilarNodeGroups    bool     `json:"balance_similar_node_groups,omitempty"`
	SkipNodesWithLocalStorage   bool     `json:"skip_nodes_with_local_storage,omitempty"`
	LogVerbosity                int      `json:"log_verbosity,omitempty"`
	MaxPodGracePeriod           int      `json:"max_pod_grace_period,omitempty"`
	PodPriorityThreshold        int      `json:"pod_priority_threshold,omitempty"`
	IgnoreDaemonsetsUtilization bool     `json:"ignore_daemonsets_utilization,omitempty"`
	MaxNodeProvisionTime        string   `json:"max_node_provision_time,omitempty"`
	BalancingIgnoredLabels      []string `json:"balancing_ignored_labels,omitempty"`
	MaxNodesTotal               int      `json:"max_nodes_total,omitempty"`
	MinCores                    int      `json:"min_cores,omitempty"`
	MaxCores                    int      `json:"max_cores,omitempty"`
	MinMemory                   int      `json:"min_memory,omitempty"`
	MaxMemory                   int      `json:"max_memory,omitempty"`
	DelayAfterAdd               string   `json:"delay_after_add,omitempty"`
	DelayAfterDelete            string   `json:"delay_after_delete,omitempty"`
	DelayAfterFailure           string   `json:"delay_after_failure,omitempty"`
	UnneededTime                string   `json:"unneeded_time,omitempty"`
	UtilizationThreshold        string   `json:"utilization_threshold,omitempty"`
	Enabled                     bool     `json:"enabled,omitempty"`
}

type ClusterAutoscalerService added in v1.6.3

type ClusterAutoscalerService interface {
	Init() error
	Plan(args *ClusterAutoscalerArgs) (string, error)
	Apply(args *ClusterAutoscalerArgs) (string, error)
	Output() (*ClusterAutoscalerOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*ClusterAutoscalerArgs, error)
	DeleteTFVars() error
}

func NewClusterAutoscalerService added in v1.6.3

func NewClusterAutoscalerService(tfWorkspace string, clusterType constants.ClusterType) (ClusterAutoscalerService, error)

type ClusterOutput added in v1.5.0

type ClusterOutput struct {
	ClusterID                            string            `json:"cluster_id,omitempty"`
	ClusterName                          string            `json:"cluster_name,omitempty"`
	ClusterVersion                       string            `json:"cluster_version,omitempty"`
	AdditionalComputeSecurityGroups      []string          `json:"additional_compute_security_groups,omitempty"`
	AdditionalInfraSecurityGroups        []string          `json:"additional_infra_security_groups,omitempty"`
	AdditionalControlPlaneSecurityGroups []string          `json:"additional_control_plane_security_groups,omitempty"`
	Properties                           map[string]string `json:"properties,omitempty"`
	UserTags                             map[string]string `json:"tags,omitempty"`
}

Just a placeholder, not research what to output yet.

type ClusterService

type ClusterService interface {
	Init() error
	Plan(args *ClusterArgs) (string, error)
	Apply(args *ClusterArgs) (string, error)
	Output() (*ClusterOutput, error)
	Destroy() (string, error)

	GetStateResource(resourceType string, resoureName string) (interface{}, error)

	ReadTFVars() (*ClusterArgs, error)
	WriteTFVars(args *ClusterArgs) error
	DeleteTFVars() error
}

func NewClusterService

func NewClusterService(tfWorkspace string, clusterType constants.ClusterType) (ClusterService, error)

type ClusterWaiterArgs added in v1.6.3

type ClusterWaiterArgs struct {
	Cluster      *string `hcl:"cluster_id"`
	TimeoutInMin *int    `hcl:"timeout_in_min"`
}

type ClusterWaiterOutput added in v1.6.3

type ClusterWaiterOutput struct {
	Cluster      string `json:"cluster_id,omitempty"`
	TimeoutInMin int    `json:"timeout_in_min,omitempty"`
}

type ClusterWaiterService added in v1.6.3

type ClusterWaiterService interface {
	Init() error
	Plan(args *ClusterWaiterArgs) (string, error)
	Apply(args *ClusterWaiterArgs) (string, error)
	Output() (*ClusterWaiterOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*ClusterWaiterArgs, error)
	DeleteTFVars() error
}

func NewClusterWaiterService added in v1.6.3

func NewClusterWaiterService(tfWorkspace string, clusterType constants.ClusterType) (ClusterWaiterService, error)

type DnsDomainArgs added in v1.5.0

type DnsDomainArgs struct {
	ID *string `hcl:"id"`
}

type DnsDomainOutput added in v1.6.0

type DnsDomainOutput struct {
	DnsDomainId string `json:"dns_domain_id,omitempty"`
}

type DnsDomainService added in v1.6.3

type DnsDomainService interface {
	Init() error
	Plan(args *DnsDomainArgs) (string, error)
	Apply(args *DnsDomainArgs) (string, error)
	Output() (*DnsDomainOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*DnsDomainArgs, error)
	DeleteTFVars() error
}

func NewDnsDomainService added in v1.5.0

func NewDnsDomainService(tfWorkspace string, clusterType constants.ClusterType) (DnsDomainService, error)

type HTPasswordUser added in v1.6.3

type HTPasswordUser struct {
	Username *string `cty:"username"`
	Password *string `cty:"password"`
}

type IDPArgs added in v1.4.0

type IDPArgs struct {
	ClusterID      *string           `hcl:"cluster_id"`
	Name           *string           `hcl:"name"`
	ID             *string           `hcl:"id"`
	CA             *string           `hcl:"ca"`
	LDAPAttributes *LDAPAttributes   `hcl:"attributes"`
	ClientID       *string           `hcl:"client_id"`
	ClientSecret   *string           `hcl:"client_secret"`
	Organizations  *[]string         `hcl:"organizations"`
	HostedDomain   *string           `hcl:"hosted_domain"`
	Insecure       *bool             `hcl:"insecure"`
	MappingMethod  *string           `hcl:"mapping_method"`
	HtpasswdUsers  *[]HTPasswordUser `hcl:"htpasswd_users"`
	URL            *string           `hcl:"idp_url"`
}

type IDPOutput added in v1.4.0

type IDPOutput struct {
	ID       string `json:"idp_id,omitempty"`
	GoogleID string `json:"idp_google_id,omitempty"`
	LDAPID   string `json:"idp_ldap_id,omitempty"`
}

for now holds only ID, additional vars might be needed in the future

type IDPService added in v1.4.0

type IDPService interface {
	Init() error
	Plan(args *IDPArgs) (string, error)
	Apply(args *IDPArgs) (string, error)
	Output() (*IDPOutput, error)
	Destroy() (string, error)

	GetStateResource(resourceType string, resoureName string) (interface{}, error)

	ReadTFVars() (*IDPArgs, error)
	DeleteTFVars() error
}

func NewIDPService added in v1.4.0

func NewIDPService(tfWorkspace string, clusterType constants.ClusterType, idpType constants.IDPType) (IDPService, error)

type ImportArgs added in v1.5.0

type ImportArgs struct {
	ClusterID  string
	Resource   string
	ObjectName string
}

type ImportService added in v1.5.0

type ImportService interface {
	Init() error
	Import(importArgs *ImportArgs) (string, error)
	ListStates() (*StatesOutput, error)
	ShowState(resource string) (string, error)
	RemoveState(resource string) (string, error)
	Destroy() (string, error)
}

func NewImportService added in v1.5.0

func NewImportService(tfWorkspace string, clusterType constants.ClusterType) (ImportService, error)

type IngressArgs added in v1.6.3

type IngressArgs struct {
	Cluster *string `hcl:"cluster"`

	// Classic
	ID                            *string                            `hcl:"id"`
	RouteNamespaceOwnershipPolicy *string                            `hcl:"route_namespace_ownership_policy"`
	RouteWildcardPolicy           *string                            `hcl:"route_wildcard_policy"`
	ClusterRoutesHostename        *string                            `hcl:"cluster_routes_hostname"`
	ClusterRoutestlsSecretRef     *string                            `hcl:"cluster_routes_tls_secret_ref"`
	LoadBalancerType              *string                            `hcl:"load_balancer_type"`
	ExcludedNamespaces            *[]string                          `hcl:"excluded_namespaces"`
	RouteSelectors                *map[string]string                 `hcl:"route_selectors"`
	ComponentRoutes               *map[string]*IngressComponentRoute `hcl:"component_routes"`

	// HCP
	ListeningMethod *string `hcl:"listening_method"`
}

type IngressComponentRoute added in v1.6.3

type IngressComponentRoute struct {
	Hostname     *string `cty:"hostname"`
	TlsSecretRef *string `cty:"tls_secret_ref"`
}

func NewIngressComponentRoute added in v1.6.3

func NewIngressComponentRoute(hostname, tlsSecretRef *string) *IngressComponentRoute

type IngressOutput added in v1.6.3

type IngressOutput struct {
	ID string `json:"id,omitempty"`
}

type IngressService added in v1.6.3

type IngressService interface {
	Init() error
	Plan(args *IngressArgs) (string, error)
	Apply(args *IngressArgs) (string, error)
	Output() (*IngressOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*IngressArgs, error)
	DeleteTFVars() error
}

func NewIngressService added in v1.6.3

func NewIngressService(tfWorkspace string, clusterType constants.ClusterType) (IngressService, error)

type KMSArgs added in v1.5.1

type KMSArgs struct {
	KMSName           *string `hcl:"kms_name"`
	AWSRegion         *string `hcl:"aws_region"`
	AccountRolePrefix *string `hcl:"account_role_prefix"`
	AccountRolePath   *string `hcl:"path"`
	TagKey            *string `hcl:"tag_key"`
	TagValue          *string `hcl:"tag_value"`
	TagDescription    *string `hcl:"tag_description"`
	HCP               *bool   `hcl:"hcp"`
}

type KMSOutput added in v1.5.1

type KMSOutput struct {
	KeyARN string `json:"arn,omitempty"`
}

type KMSService added in v1.5.1

type KMSService interface {
	Init() error
	Plan(args *KMSArgs) (string, error)
	Apply(args *KMSArgs) (string, error)
	Output() (*KMSOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*KMSArgs, error)
	DeleteTFVars() error
}

func NewKMSService added in v1.5.1

func NewKMSService(tfWorkspace string, clusterType constants.ClusterType) (KMSService, error)

type KubeletConfig added in v1.6.3

type KubeletConfig struct {
	Cluster      string `json:"cluster,omitempty"`
	PodPidsLimit int    `json:"pod_pids_limit,omitempty"`
	ID           string `json:"id,omitempty"`
	Name         string `json:"name,omitempty"`
}

type KubeletConfigArgs added in v1.5.1

type KubeletConfigArgs struct {
	Cluster             *string `hcl:"cluster"`
	PodPidsLimit        *int    `hcl:"pod_pids_limit"`
	KubeletConfigNumber *int    `hcl:"kubelet_config_number"`
	NamePrefix          *string `hcl:"name_prefix"`
}

type KubeletConfigService added in v1.5.1

type KubeletConfigService interface {
	Init() error
	Plan(args *KubeletConfigArgs) (string, error)
	Apply(args *KubeletConfigArgs) (string, error)
	Output() ([]*KubeletConfig, error)
	Destroy() (string, error)

	ReadTFVars() (*KubeletConfigArgs, error)
	WriteTFVars(args *KubeletConfigArgs) error
	DeleteTFVars() error
}

func NewKubeletConfigService added in v1.5.1

func NewKubeletConfigService(tfWorkspace string, clusterType constants.ClusterType) (KubeletConfigService, error)

type KubeletConfigs added in v1.6.3

type KubeletConfigs struct {
	KubeConfigs []*KubeletConfig `json:"kubelet_configs,omitempty"`
}

type LDAPAttributes added in v1.6.3

type LDAPAttributes struct {
	Emails             *[]string `cty:"email"`
	IDs                *[]string `cty:"id"`
	Names              *[]string `cty:"name"`
	PreferredUsernames *[]string `cty:"preferred_username"`
}

type MachinePoolArgs

type MachinePoolArgs struct {
	Count                    *int                 `hcl:"mp_count"`
	Cluster                  *string              `hcl:"cluster"`
	Name                     *string              `hcl:"name"`
	MachineType              *string              `hcl:"machine_type"`
	Ec2MetadataHttpTokens    *string              `hcl:"ec2_metadata_http_tokens"`
	Replicas                 *int                 `hcl:"replicas"`
	AutoscalingEnabled       *bool                `hcl:"autoscaling_enabled"`
	UseSpotInstances         *bool                `hcl:"use_spot_instances"`
	MaxReplicas              *int                 `hcl:"max_replicas"`
	MinReplicas              *int                 `hcl:"min_replicas"`
	MaxSpotPrice             *float64             `hcl:"max_spot_price"`
	Labels                   *map[string]string   `hcl:"labels"`
	Taints                   *[]map[string]string `hcl:"taints"`
	ID                       *string              `hcl:"id"`
	AvailabilityZone         *string              `hcl:"availability_zone"`
	SubnetID                 *string              `hcl:"subnet_id"`
	MultiAZ                  *bool                `hcl:"multi_availability_zone"`
	DiskSize                 *int                 `hcl:"disk_size"`
	AdditionalSecurityGroups *[]string            `hcl:"additional_security_groups"`
	Tags                     *map[string]string   `hcl:"tags"`

	// HCP supported
	TuningConfigs              *[]string `hcl:"tuning_configs"`
	UpgradeAcknowledgementsFor *string   `hcl:"upgrade_acknowledgements_for"`
	OpenshiftVersion           *string   `hcl:"openshift_version"`
	AutoRepair                 *bool     `hcl:"auto_repair"`
	KubeletConfigs             *string   `hcl:"kubelet_configs"`
}

func BuildDefaultMachinePoolArgsFromClusterState added in v1.5.0

func BuildDefaultMachinePoolArgsFromClusterState(clusterResource interface{}) (MachinePoolArgs, error)

func BuildDefaultMachinePoolArgsFromDefaultMachinePoolState added in v1.5.0

func BuildDefaultMachinePoolArgsFromDefaultMachinePoolState(defaultMachinePoolResource interface{}) (MachinePoolArgs, error)

func BuildMachinePoolArgsFromCSResponse added in v1.5.1

func BuildMachinePoolArgsFromCSResponse(clusterID string, machinePool *cmv1.MachinePool) *MachinePoolArgs
    This func will return MachinePoolArgs with mapping the values from the backend
	    Name    done
		MachineType      				done
		Replicas         				done
		AutoscalingEnabled  			done
		UseSpotInstances     			done
		MaxReplicas       				done
		MinReplicas      				done
		MaxSpotPrice           			done
		Labels                			done
		Taints                			done
		ID                  		It's same with machinepool name and not required.
		AvailabilityZone     	    Todo
		SubnetID                	Todo
		MultiAZ                     not a part of CMS machinepool endpoint reponse till now
		DiskSize                 	done
		AdditionalSecurityGroups *[]string           done

type MachinePoolOutput

type MachinePoolOutput struct {
	ID                    string             `json:"machine_pool_id,omitempty"`
	Name                  string             `json:"name,omitempty"`
	ClusterID             string             `json:"cluster_id,omitempty"`
	Replicas              int                `json:"replicas,omitempty"`
	Ec2MetadataHttpTokens string             `json:"ec2_metadata_http_tokens"`
	MachineType           string             `json:"machine_type,omitempty"`
	AutoscalingEnabled    bool               `json:"autoscaling_enabled,omitempty"`
	Labels                map[string]string  `json:"labels,omitempty"`
	Taints                []MachinePoolTaint `json:"taints,omitempty"`
	TuningConfigs         []string           `json:"tuning_configs,omitempty"`
	KubeletConfigs        string             `json:"kubelet_configs"`
	Tags                  map[string]string  `json:"tags,omitempty"`
}

type MachinePoolService

type MachinePoolService interface {
	Init() error
	Plan(args *MachinePoolArgs) (string, error)
	Apply(args *MachinePoolArgs) (string, error)
	Output() (*MachinePoolsOutput, error)
	Destroy() (string, error)
	ShowState(resource string) (string, error)
	RemoveState(resource string) (string, error)
	ReadTFVars() (*MachinePoolArgs, error)
	DeleteTFVars() error
}

func NewMachinePoolService

func NewMachinePoolService(tfWorkspace string, clusterType constants.ClusterType) (MachinePoolService, error)

type MachinePoolTaint added in v1.6.3

type MachinePoolTaint struct {
	Key          string `json:"key,omitempty"`
	Value        string `json:"value,omitempty"`
	ScheduleType string `json:"schedule_type,omitempty"`
}

type MachinePoolsOutput added in v1.6.3

type MachinePoolsOutput struct {
	MachinePools []MachinePoolOutput `json:"machine_pools,omitempty"`
}

type OIDCProviderOperatorRolesArgs added in v1.4.0

type OIDCProviderOperatorRolesArgs struct {
	AccountRolePrefix   *string            `hcl:"account_role_prefix"`
	OperatorRolePrefix  *string            `hcl:"operator_role_prefix"`
	OIDCConfig          *string            `hcl:"oidc_config"`
	UnifiedAccRolesPath *string            `hcl:"path"`
	Tags                *map[string]string `hcl:"tags"`
}

type OIDCProviderOperatorRolesOutput added in v1.4.0

type OIDCProviderOperatorRolesOutput struct {
	OIDCConfigID           string `json:"oidc_config_id,omitempty"`
	AccountRolePrefix      string `json:"account_role_prefix,omitempty"`
	OperatorRolePrefix     string `json:"operator_role_prefix,omitempty"`
	IngressOperatorRoleArn string `json:"ingress_operator_role_arn,omitempty"`
}

type OIDCProviderOperatorRolesService added in v1.4.0

type OIDCProviderOperatorRolesService interface {
	Init() error
	Plan(args *OIDCProviderOperatorRolesArgs) (string, error)
	Apply(args *OIDCProviderOperatorRolesArgs) (string, error)
	Output() (*OIDCProviderOperatorRolesOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*OIDCProviderOperatorRolesArgs, error)
	DeleteTFVars() error
}

func NewOIDCProviderOperatorRolesService added in v1.4.0

func NewOIDCProviderOperatorRolesService(tfWorkspace string, clusterType constants.ClusterType) (OIDCProviderOperatorRolesService, error)

type PrivateHostedZone added in v1.6.0

type PrivateHostedZone struct {
	ID      string `cty:"id"`
	RoleArn string `cty:"role_arn"`
}

type ProxiesOutput added in v1.6.3

type ProxiesOutput struct {
	Proxies []*ProxyOutput
}

type Proxy added in v1.5.0

type Proxy struct {
	HTTPProxy             *string `cty:"http_proxy"`
	HTTPSProxy            *string `cty:"https_proxy"`
	AdditionalTrustBundle *string `cty:"additional_trust_bundle"`
	NoProxy               *string `cty:"no_proxy"`
}

type ProxyArgs added in v1.5.1

type ProxyArgs struct {
	ProxyCount          *int    `hcl:"proxy_count"`
	Region              *string `hcl:"aws_region"`
	VPCID               *string `hcl:"vpc_id"`
	PublicSubnetID      *string `hcl:"subnet_public_id"`
	TrustBundleFilePath *string `hcl:"trust_bundle_path"`
	KeyPairID           *string `hcl:"key_pair_id"`
}

type ProxyOutput added in v1.5.1

type ProxyOutput struct {
	HttpProxy             string
	HttpsProxy            string
	NoProxy               string
	AdditionalTrustBundle string
}

type ProxyService added in v1.5.1

type ProxyService interface {
	Init() error
	Plan(args *ProxyArgs) (string, error)
	Apply(args *ProxyArgs) (string, error)
	Output() (*ProxiesOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*ProxyArgs, error)
	DeleteTFVars() error
}

func NewProxyService added in v1.5.1

func NewProxyService(tfWorkspace string, clusterType constants.ClusterType) (ProxyService, error)

type ProxyServiceOutput added in v1.6.3

type ProxyServiceOutput struct {
	HttpProxies            []string `json:"http_proxies,omitempty"`
	HttpsProxies           []string `json:"https_proxies,omitempty"`
	NoProxies              []string `json:"no_proxies,omitempty"`
	AdditionalTrustBundles []string `json:"additional_trust_bundles,omitempty"`
}

for now holds only ID, additional vars might be needed in the future

type RegistryConfig added in v1.6.5

type RegistryConfig struct {
	AdditionalTrustedCA        *map[string]string          `cty:"additional_trusted_ca"`
	AllowedRegistriesForImport *[]AllowedRegistryForImport `cty:"allowed_registries_for_import"`
	PlatformAllowlistID        *string                     `cty:"platform_allowlist_id"`
	RegistrySources            *RegistrySources            `cty:"registry_sources"`
}

func GetDefaultRegistryConfig added in v1.6.5

func GetDefaultRegistryConfig() *RegistryConfig

type RegistrySources added in v1.6.5

type RegistrySources struct {
	AllowedRegistries  *[]string `cty:"allowed_registries"`
	BlockedRegistries  *[]string `cty:"blocked_registries"`
	InsecureRegistries *[]string `cty:"insecure_registries"`
}

type ResourceLimits added in v1.6.3

type ResourceLimits struct {
	Cores         *ResourceRange `cty:"cores"`
	MaxNodesTotal *int           `cty:"max_nodes_total"`
	Memory        *ResourceRange `cty:"memory"`
}

type ResourceRange added in v1.6.3

type ResourceRange struct {
	Max *int `cty:"max"`
	Min *int `cty:"min"`
}

type RhcsInfoArgs added in v1.5.0

type RhcsInfoArgs struct {
}

type RhcsInfoOutput added in v1.6.3

type RhcsInfoOutput struct{}

type RhcsInfoService added in v1.5.0

type RhcsInfoService interface {
	Init() error
	Apply(args *RhcsInfoArgs) (string, error)
	ShowState(resource string) (string, error)
}

func NewRhcsInfoService added in v1.5.0

func NewRhcsInfoService(tfWorkspace string, clusterType constants.ClusterType) (RhcsInfoService, error)

type ScaleDown added in v1.6.3

type ScaleDown struct {
	DelayAfterAdd        *string `cty:"delay_after_add"`
	DelayAfterDelete     *string `cty:"delay_after_delete"`
	DelayAfterFailure    *string `cty:"delay_after_failure"`
	UnneededTime         *string `cty:"unneeded_time"`
	UtilizationThreshold *string `cty:"utilization_threshold"`
	Enabled              *bool   `cty:"enabled"`
}

type SecurityGroupArgs added in v1.5.0

type SecurityGroupArgs struct {
	NamePrefix  *string `hcl:"name_prefix"`
	SGNumber    *int    `hcl:"sg_number"`
	VPCID       *string `hcl:"vpc_id"`
	Description *string `hcl:"description"`
	AWSRegion   *string `hcl:"aws_region"`
}

type SecurityGroupService added in v1.5.0

type SecurityGroupService interface {
	Init() error
	Plan(args *SecurityGroupArgs) (string, error)
	Apply(args *SecurityGroupArgs) (string, error)
	Output() (*SecurityGroupsOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*SecurityGroupArgs, error)
	DeleteTFVars() error
}

func NewSecurityGroupService added in v1.5.0

func NewSecurityGroupService(tfWorkspace string, clusterType constants.ClusterType) (SecurityGroupService, error)

type SecurityGroupsOutput added in v1.5.0

type SecurityGroupsOutput struct {
	SGIDs []string `json:"sg_ids,omitempty"`
}

type SharedVpcPolicyAndHostedZoneArgs added in v1.6.0

type SharedVpcPolicyAndHostedZoneArgs struct {
	SharedVpcAWSSharedCredentialsFiles *[]string `hcl:"shared_vpc_aws_shared_credentials_files"`
	Region                             *string   `hcl:"region"`
	ClusterName                        *string   `hcl:"cluster_name"`
	DomainPrefix                       *string   `hcl:"domain_prefix"`
	DnsDomainId                        *string   `hcl:"dns_domain_id"`
	IngressOperatorRoleArn             *string   `hcl:"ingress_operator_role_arn"`
	InstallerRoleArn                   *string   `hcl:"installer_role_arn"`
	ClusterAWSAccount                  *string   `hcl:"cluster_aws_account"`
	VpcId                              *string   `hcl:"vpc_id"`
	Subnets                            *[]string `hcl:"subnets"`
}

type SharedVpcPolicyAndHostedZoneOutput added in v1.6.0

type SharedVpcPolicyAndHostedZoneOutput struct {
	SharedRole        string   `json:"shared_role,omitempty"`
	HostedZoneId      string   `json:"hosted_zone_id,omitempty"`
	SharedSubnets     []string `json:"shared_subnets,omitempty"`
	AvailabilityZones []string `json:"azs,omitempty"`
}

type SharedVpcPolicyAndHostedZoneService added in v1.6.0

type SharedVpcPolicyAndHostedZoneService interface {
	Init() error
	Plan(args *SharedVpcPolicyAndHostedZoneArgs) (string, error)
	Apply(args *SharedVpcPolicyAndHostedZoneArgs) (string, error)
	Output() (*SharedVpcPolicyAndHostedZoneOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*SharedVpcPolicyAndHostedZoneArgs, error)
	DeleteTFVars() error
}

func NewSharedVpcPolicyAndHostedZoneService added in v1.6.0

func NewSharedVpcPolicyAndHostedZoneService(tfWorkspace string, clusterType constants.ClusterType) (SharedVpcPolicyAndHostedZoneService, error)

type StateOutput added in v1.6.3

type StateOutput struct {
	Resource string
}

type StatesOutput added in v1.6.3

type StatesOutput struct {
	States []StateOutput
}

type TerraformExecutor added in v1.6.3

type TerraformExecutor interface {
	RunTerraformInit() (string, error)
	RunTerraformPlan(argObj interface{}) (string, error)
	RunTerraformApply(argObj interface{}) (string, error)
	RunTerraformDestroy() (string, error)
	RunTerraformOutput() (string, error)
	RunTerraformOutputIntoObject(obj any) error
	RunTerraformState(subcommand string, options ...string) (string, error)
	GetStateResource(resourceType string, resoureName string) (interface{}, error)
	RunTerraformImport(importArgs ...string) (string, error)

	ReadTerraformVars(obj interface{}) error
	WriteTerraformVars(obj interface{}) error
	DeleteTerraformVars() error
}

func NewTerraformExecutor added in v1.6.3

func NewTerraformExecutor(tfWorkspace string, manifestsDir string) TerraformExecutor

type TrustedIP added in v1.6.3

type TrustedIP struct {
	Enabled bool   `json:"enabled,omitempty"`
	Id      string `json:"id,omitempty"`
}

type TrustedIPList added in v1.6.3

type TrustedIPList struct {
	Items []TrustedIP `json:"items,omitempty"`
}

type TrustedIPsArgs added in v1.6.3

type TrustedIPsArgs struct {
}

type TrustedIPsOutput added in v1.6.3

type TrustedIPsOutput struct {
	// TrustedIPs map[string][]TrustedIP `json:"trusted_ips,omitempty"`
	TrustedIPs TrustedIPList `json:"trusted_ips,omitempty"`
}

type TrustedIPsService added in v1.6.3

type TrustedIPsService interface {
	Init() error
	Plan(args *TrustedIPsArgs) (string, error)
	Apply(args *TrustedIPsArgs) (string, error)
	Output() (*TrustedIPsOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*TrustedIPsArgs, error)
	DeleteTFVars() error
}

func NewTrustedIPsService added in v1.6.3

func NewTrustedIPsService(tfWorkspace string, clusterType constants.ClusterType) (TrustedIPsService, error)

type TuningConfigArgs added in v1.6.3

type TuningConfigArgs struct {
	Cluster *string             `hcl:"cluster"`
	Name    *string             `hcl:"name"`
	Count   *int                `hcl:"tc_count"`
	Specs   *[]TuningConfigSpec `hcl:"specs"`
}

type TuningConfigOutput added in v1.6.3

type TuningConfigOutput struct {
	Names []string `json:"names,omitempty"`
	Specs []string `json:"specs,omitempty"`
}

type TuningConfigService added in v1.6.3

type TuningConfigService interface {
	Init() error
	Plan(args *TuningConfigArgs) (string, error)
	Apply(args *TuningConfigArgs) (string, error)
	Output() (*TuningConfigOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*TuningConfigArgs, error)
	DeleteTFVars() error
}

func NewTuningConfigService added in v1.6.3

func NewTuningConfigService(tfWorkspace string, clusterType constants.ClusterType) (TuningConfigService, error)

type TuningConfigSpec added in v1.6.4

type TuningConfigSpec struct {
	Type  *string `cty:"spec_type"`
	Value *string `cty:"spec_value"`
}

func NewTuningConfigSpecFromFile added in v1.6.4

func NewTuningConfigSpecFromFile(specFile string) TuningConfigSpec

func NewTuningConfigSpecFromString added in v1.6.4

func NewTuningConfigSpecFromString(specValue string) TuningConfigSpec

type VPCArgs

type VPCArgs struct {
	AWSRegion                 *string            `hcl:"aws_region"`
	AWSSharedCredentialsFiles *[]string          `hcl:"aws_shared_credentials_files"`
	NamePrefix                *string            `hcl:"name_prefix"`
	VPCCIDR                   *string            `hcl:"vpc_cidr"`
	AvailabilityZones         *[]string          `hcl:"availability_zones"`
	AvailabilityZonesCount    *int               `hcl:"availability_zones_count"`
	Tags                      *map[string]string `hcl:"tags"`
}

type VPCOutput added in v1.4.0

type VPCOutput struct {
	PrivateSubnets    []string `json:"private_subnets,omitempty"`
	PublicSubnets     []string `json:"public_subnets,omitempty"`
	AvailabilityZones []string `json:"availability_zones,omitempty"`
	VPCID             string   `json:"vpc_id,omitempty"`
	VPCCIDR           string   `json:"vpc_cidr,omitempty"`
}

type VPCService

type VPCService interface {
	Init() error
	Plan(args *VPCArgs) (string, error)
	Apply(args *VPCArgs) (string, error)
	Output() (*VPCOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*VPCArgs, error)
	DeleteTFVars() error
}

func NewVPCService

func NewVPCService(tfWorkspace string, clusterType constants.ClusterType) (VPCService, error)

type VPCTagArgs added in v1.5.0

type VPCTagArgs struct {
	AWSRegion *string   `hcl:"aws_region"`
	IDs       *[]string `hcl:"ids"`
	TagKey    *string   `hcl:"key"`
	TagValue  *string   `hcl:"value"`
}

type VPCTagOutput added in v1.6.3

type VPCTagOutput struct {
}

type VPCTagService added in v1.5.0

type VPCTagService interface {
	Init() error
	Plan(args *VPCTagArgs) (string, error)
	Apply(args *VPCTagArgs) (string, error)
	Output() (*VPCTagOutput, error)
	Destroy() (string, error)

	ReadTFVars() (*VPCTagArgs, error)
	DeleteTFVars() error
}

func NewVPCTagService added in v1.5.0

func NewVPCTagService(tfWorkspace string, clusterType constants.ClusterType) (VPCTagService, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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