config

package
v0.0.0-...-96bdf66 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBSizes = map[string]string{
	"small":  "db.t2.small",
	"medium": "db.t2.medium",
	"large":  "db.m4.large",
}

DBSizes maps SML sizes to RDS instance classes

View Source
var WorkerSizes = []string{"medium", "large", "xlarge"}

WorkerSizes are the permitted concourse worker sizes

Functions

This section is empty.

Types

type Client

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

Client is a client for loading the config file from S3

func New

func New(iaas iaas.IClient, project string) *Client

New instantiates a new client

func (*Client) DeleteAll

func (client *Client) DeleteAll(config *Config) error

DeleteAll deletes the entire configuration bucket

func (*Client) DeleteAsset

func (client *Client) DeleteAsset(filename string) error

DeleteAsset deletes an associated configuration file

func (*Client) HasAsset

func (client *Client) HasAsset(filename string) (bool, error)

HasAsset returns true if an associated configuration file exists

func (*Client) Load

func (client *Client) Load() (*Config, error)

Load loads an existing config file from S3

func (*Client) LoadAsset

func (client *Client) LoadAsset(filename string) ([]byte, error)

LoadAsset loads an associated configuration file

func (*Client) LoadOrCreate

func (client *Client) LoadOrCreate(deployArgs *DeployArgs) (*Config, bool, error)

LoadOrCreate loads an existing config file from S3, or creates a default if one doesn't already exist

func (*Client) StoreAsset

func (client *Client) StoreAsset(filename string, contents []byte) error

StoreAsset stores an associated configuration file

func (*Client) Update

func (client *Client) Update(config *Config) error

Update stores the conconcourse up config file to S3

type Config

type Config struct {
	AvailabilityZone          string `json:"availability_zone"`
	ConcourseCACert           string `json:"concourse_ca_cert"`
	ConcourseCert             string `json:"concourse_cert"`
	ConcourseDBName           string `json:"concourse_db_name"`
	ConcourseKey              string `json:"concourse_key"`
	ConcoursePassword         string `json:"concourse_password"`
	ConcourseUsername         string `json:"concourse_username"`
	ConcourseUserProvidedCert bool   `json:"concourse_user_provided_cert"`
	ConcourseWorkerCount      int    `json:"concourse_worker_count"`
	ConcourseWorkerSize       string `json:"concourse_worker_size"`
	ConfigBucket              string `json:"config_bucket"`
	Deployment                string `json:"deployment"`
	DirectorCACert            string `json:"director_ca_cert"`
	DirectorCert              string `json:"director_cert"`
	DirectorHMUserPassword    string `json:"director_hm_user_password"`
	DirectorKey               string `json:"director_key"`
	DirectorMbusPassword      string `json:"director_mbus_password"`
	DirectorNATSPassword      string `json:"director_nats_password"`
	DirectorPassword          string `json:"director_password"`
	DirectorPublicIP          string `json:"director_public_ip"`
	DirectorRegistryPassword  string `json:"director_registry_password"`
	DirectorUsername          string `json:"director_username"`
	Domain                    string `json:"domain"`
	EncryptionKey             string `json:"encryption_key"`
	GrafanaPassword           string `json:"grafana_password"`
	GrafanaUsername           string `json:"grafana_username"`
	HostedZoneID              string `json:"hosted_zone_id"`
	HostedZoneRecordPrefix    string `json:"hosted_zone_record_prefix"`
	InfluxDBPassword          string `json:"influxdb_password"`
	InfluxDBUsername          string `json:"influxdb_username"`
	MultiAZRDS                bool   `json:"multi_az_rds"`
	PrivateKey                string `json:"private_key"`
	Project                   string `json:"project"`
	PublicKey                 string `json:"public_key"`
	RDSDefaultDatabaseName    string `json:"rds_default_database_name"`
	RDSInstanceClass          string `json:"rds_instance_class"`
	RDSPassword               string `json:"rds_password"`
	RDSUsername               string `json:"rds_username"`
	Region                    string `json:"region"`
	SourceAccessIP            string `json:"source_access_ip"`
	TFStatePath               string `json:"tf_state_path"`
}

Config represents a concourse-up configuration file

type DeployArgs

type DeployArgs struct {
	IAAS        string
	AWSRegion   string
	Domain      string
	TLSCert     string
	TLSKey      string
	WorkerCount int
	WorkerSize  string
	SelfUpdate  bool
	DBSize      string
	// DBSizeIsSet is true if the user has manually specified the db-size (ie, it's not the default)
	DBSizeIsSet bool
}

DeployArgs are arguments passed to the deploy command

func (DeployArgs) Validate

func (args DeployArgs) Validate() error

Validate validates that flag interdependencies

type DestroyArgs

type DestroyArgs struct {
	AWSRegion string
	IAAS      string
}

DestroyArgs are arguments passed to the destroy command

type IClient

type IClient interface {
	Load() (*Config, error)
	DeleteAll(config *Config) error
	LoadOrCreate(deployArgs *DeployArgs) (*Config, bool, error)
	Update(*Config) error
	StoreAsset(filename string, contents []byte) error
	HasAsset(filename string) (bool, error)
	LoadAsset(filename string) ([]byte, error)
	DeleteAsset(filename string) error
}

IClient is an interface for the config file client

type InfoArgs

type InfoArgs struct {
	AWSRegion string
	JSON      bool
	IAAS      string
}

InfoArgs are arguments passed to the info command

Jump to

Keyboard shortcuts

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