terraform

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBCluster

type DBCluster struct {
	Endpoints []string `json:"endpoint"`
}

DBCluster defines a RDS cluster instance resource.

type ElasticSearchDomain

type ElasticSearchDomain struct {
	Endpoint string `json:"endpoint"`
	Tags     Tags   `json:"tags"`
}

ElasticSearchDomain is an AWS Elasticsearch domain.

type IAMAccess

type IAMAccess struct {
	Id     string `json:"id"`
	Secret string `json:"secret"`
}

IAMAccess is a set of credentials that allow API requests to be made as an IAM user.

type Instance

type Instance struct {
	PrivateIP  string `json:"private_ip"`
	PublicIP   string `json:"public_ip"`
	PublicDNS  string `json:"public_dns"`
	PrivateDNS string `json:"private_dns"`
	Tags       Tags   `json:"tags"`
}

Instance is an AWS EC2 instance resource.

type Output

type Output struct {
	ClusterName         string
	Proxy               Instance            `json:"proxy"`
	Instances           []Instance          `json:"instances"`
	DBCluster           DBCluster           `json:"dbCluster"`
	Agents              []Instance          `json:"agents"`
	MetricsServer       Instance            `json:"metricsServer"`
	ElasticSearchServer ElasticSearchDomain `json:"elasticServer"`
	JobServers          []Instance          `json:"jobServers"`
	S3Bucket            S3Bucket            `json:"s3Bucket"`
	S3Key               IAMAccess           `json:"s3Key"`
	DBSecurityGroup     []SecurityGroup     `json:"dbSecurityGroup"`
}

Output contains the output variables which are created after a deployment.

func (*Output) DBReaders added in v1.3.0

func (o *Output) DBReaders() []string

DBReaders returns the list of db reader endpoints.

func (*Output) DBWriter added in v1.3.0

func (o *Output) DBWriter() string

DBWriter returns the db writer endpoint.

func (*Output) HasAgents added in v1.10.0

func (o *Output) HasAgents() bool

HasAgents returns whether a deployment includes agent instances.

func (*Output) HasAppServers

func (o *Output) HasAppServers() bool

HasAppServers returns whether a deployment includes app server instances.

func (*Output) HasDB added in v1.2.0

func (o *Output) HasDB() bool

HasDB returns whether a deployment has database installed in it or not.

func (*Output) HasElasticSearch

func (o *Output) HasElasticSearch() bool

HasElasticSearch returns whether a deployment has ElasticSaearch installed in it or not.

func (*Output) HasJobServer added in v1.3.0

func (o *Output) HasJobServer() bool

HasJobServer returns whether a deployment has a dedicated job server.

func (*Output) HasMetrics

func (o *Output) HasMetrics() bool

HasMetrics returns whether a deployment includes the metrics instance.

func (*Output) HasProxy

func (o *Output) HasProxy() bool

HasProxy returns whether a deployment has proxy installed in it or not.

func (*Output) HasS3Bucket

func (o *Output) HasS3Bucket() bool

HasS3Bucket returns whether a deployment includes the S3 Bucket.

func (*Output) HasS3Key

func (o *Output) HasS3Key() bool

HasS3Key returns whether a deployment includes the S3 Key.

type PyroscopeConfig added in v1.11.0

type PyroscopeConfig struct {
	LogLevel        string         `yaml:"log-level"`
	NoSelfProfiling bool           `yaml:"no-self-profiling"`
	ScrapeConfigs   []ScrapeConfig `yaml:"scrape-configs"`
}

func NewPyroscopeConfig added in v1.11.0

func NewPyroscopeConfig(mmTargets, ltTargets []string) *PyroscopeConfig

type S3Bucket

type S3Bucket struct {
	Id     string `json:"id"`
	Region string `json:"region"`
}

S3Bucket defines a specific S3 bucket.

type ScrapeConfig added in v1.11.0

type ScrapeConfig struct {
	JobName         string         `yaml:"job-name"`
	Scheme          string         `yaml:"scheme"`
	ScrapeInterval  string         `yaml:"scrape-interval"`
	EnabledProfiles []string       `yaml:"enabled-profiles,flow"`
	StaticConfigs   []StaticConfig `yaml:"static-configs,omitempty"`
}

type SecurityGroup added in v1.10.0

type SecurityGroup struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

SecurityGroup is an AWS security group resource.

type StaticConfig added in v1.11.0

type StaticConfig struct {
	Application string   `yaml:"application"`
	SpyName     string   `yaml:"spy-name"`
	Targets     []string `yaml:"targets,flow"`
}

type Tags

type Tags struct {
	Name string `json:"Name"`
}

Tags are the values attached to resource.

type Terraform

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

Terraform manages all operations related to interacting with an AWS environment using Terraform.

func New

func New(id string, cfg deployment.Config) (*Terraform, error)

New returns a new Terraform instance.

func (*Terraform) Config added in v1.3.0

func (t *Terraform) Config() *deployment.Config

Config returns the deployment config associated with the Terraform instance.

func (*Terraform) Create

func (t *Terraform) Create(initData bool) error

Create creates a new load test environment.

func (*Terraform) Destroy

func (t *Terraform) Destroy() error

Destroy destroys the created load-test environment.

func (*Terraform) GetCoordinatorStatus

func (t *Terraform) GetCoordinatorStatus() (coordinator.Status, error)

GetCoordinatorStatus returns information about the status of the coordinator in the current load-test deployment.

func (*Terraform) Info

func (t *Terraform) Info() error

Info displays information about the current load-test deployment.

func (*Terraform) IngestDump added in v1.10.0

func (t *Terraform) IngestDump() error

IngestDump works on an already deployed terraform setup and restores the DB dump file to the Mattermost server. It uses the deployment config for the dump URI.

func (*Terraform) InjectAction added in v1.10.0

func (t *Terraform) InjectAction(actionID string) (coordinator.Status, error)

InjectAction injects a named action for all agents that is run once.

func (*Terraform) OpenBrowserFor

func (t *Terraform) OpenBrowserFor(resource string) error

OpenBrowserFor opens a web browser for the resource

func (*Terraform) OpenSSHFor

func (t *Terraform) OpenSSHFor(resource string) error

OpenSSHFor starts a ssh connection to the resource

func (*Terraform) Output

func (t *Terraform) Output() (*Output, error)

Output reads the current terraform output and caches it internally for future use. The output is guaranteed to be up to date after calls to Create and Destroy.

func (*Terraform) RunSSHCommand added in v1.3.0

func (t *Terraform) RunSSHCommand(resource string, args []string) error

RunSSHCommand runs a command on a given machine.

func (*Terraform) StartCoordinator

func (t *Terraform) StartCoordinator(config *coordinator.Config) error

StartCoordinator starts the coordinator in the current load-test deployment.

func (*Terraform) StopCoordinator

func (t *Terraform) StopCoordinator() (coordinator.Status, error)

StopCoordinator stops the coordinator in the current load-test deployment.

func (*Terraform) Sync added in v1.3.0

func (t *Terraform) Sync() error

Sync runs a terraform sync with all the required parameters.

func (*Terraform) UploadDashboard added in v1.2.0

func (t *Terraform) UploadDashboard(dashboard string) (string, error)

UploadDashboard uploads the given dashboard to Grafana and returns its URL. Returns an error in case of failure.

Directories

Path Synopsis
Package ssh is a simple wrapper around an ssh.Client which implements utilities to be performed with a remote server.
Package ssh is a simple wrapper around an ssh.Client which implements utilities to be performed with a remote server.

Jump to

Keyboard shortcuts

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