Documentation ¶
Overview ¶
package oticonfig configuration for the oti command.
Essentials ¶
technically all you really need to get going are aws credentials. if you save them in aws_credentials.json then oti will find them automatically (use 0400 permissions on the file).
{ "AccessKey": "xxxxxxxxxxxx", "SecretKey": "yyyyyyyyyyyy", }
see the AwsKey type for details
Configuration file ¶
a configuration file can make repeated use much easier. create a file containing a json object. by default, oti looks for a file called oti.json.
see the C type for details on the configuration format.
Index ¶
- func Read(path string, c *C) error
- type AwsKey
- type C
- func (c *C) AwsAuth() (aws.Auth, error)
- func (c *C) AwsKey() (*AwsKey, error)
- func (c *C) Ec2KeyName(r aws.Region) string
- func (c *C) Ec2Region(r aws.Region) *Ec2Region
- func (c *C) Ec2SecurityGroups(r aws.Region) []awsec2.SecurityGroup
- func (c *C) Ec2Tag(tag otitag.OTITag) string
- func (c *C) PackerManifest(name string) (*PackerManifest, error)
- func (c *C) PackerManifestNames() ([]string, error)
- type Ec2
- type Ec2Region
- type Ec2SecurityGroup
- type Images
- type Packer
- type PackerManifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type C ¶
type C struct { // packer manifest configuration Packer Packer `json:",omitempty"` // metadata allowing usage of tags on images Images Images // see func (c *C) AwsKey() AwsKeyPath string `json:",omitempty"` // default Ec2 deployment configurations Ec2 Ec2 `json:",omitempty"` }
the json configuration for oti
func (*C) AwsKey ¶
unmarshal the json data stored in c.AwsKeyPath into a new AwsKey. return any error encountered.
func (*C) Ec2KeyName ¶
BUG uses the first region config with right name
func (*C) Ec2SecurityGroups ¶
func (c *C) Ec2SecurityGroups(r aws.Region) []awsec2.SecurityGroup
BUG uses the first region config with right name
func (*C) PackerManifest ¶
func (c *C) PackerManifest(name string) (*PackerManifest, error)
unmarshal a packer file by name. see c.Packers() for details about names.
func (*C) PackerManifestNames ¶
return the name of packer manifests in c.PackerDir. the name of the manifest is the file basename (without the ".json" extension).
type Ec2Region ¶
type Ec2Region struct { // a unique identifier for the object. required if more than one region // profile is defined for the same RegionName. Id string `json:",omitempty"` // an ec2 canonical region name (e.g. "us-east-1"). required RegionName string // ec2 key name (recommended). overrideable per instance KeyName string `json:",omitempty"` // security groups. additional groups can be added per instance. SecurityGroups []Ec2SecurityGroup `json:",omitempty"` }
type Ec2SecurityGroup ¶
security groups with neither Id or Name are ignored.
type Images ¶
type Images struct { // tag identifying the service(s) provided by an image NameTag string `json:",omitempty"` // tag identifying the date an image was created BuildDateTag string `json:",omitempty"` // tag containing a semantic version for the image VersionTag string `json:",omitempty"` // not used }
type Packer ¶
type Packer struct { // a directory containing packer manifests. // see func (c *C) Packer(string) ManifestDir string `json:",omitempty"` }
type PackerManifest ¶
type PackerManifest struct { Vars *jsontree.JsonTree Builders []*jsontree.JsonTree Provisioners []*jsontree.JsonTree }