Documentation ¶
Index ¶
- Constants
- func ClientEC2() *ec2.Client
- func ClientIAM() *iam.Client
- func CountParameter(template []byte) int
- func CreateAccessKey(client IAMInterface)
- func CreateKeyIfNotExist(client Ec2Interface)
- func CreateLabPolicy(client IAMInterface, lab int)
- func CreateStack(client DeployInterface, name string, template []byte)
- func CreateUserIfnotExist(client IAMInterface)
- func DeleteAccessKey(client IAMInterface)
- func DeleteKey(client Ec2Interface)
- func DeleteLabPolicy(client IAMInterface, lab int)
- func DeleteUserIfExist(client IAMInterface)
- func FindAmi(client Ec2Interface, amiParameter string) string
- func GenerateMyPassword() string
- func GetAccount() string
- func GetRegion() string
- func Getenv(key, fallback string) string
- func IsStackCompleted(data map[string]CloudFormationResource) bool
- func PolicyIAMAdditionalName(lab int) string
- func PolicyIAMName(lab int) string
- func PopulateData(client DeployInterface, name string, data map[string]CloudFormationResource) (map[string]CloudFormationResource, time.Time)
- func ShowStatus(client DeployInterface, name string, template []byte)
- type AccessKey
- type CloudFormationResource
- type DeployInterface
- type Ec2Interface
- type IAMInterface
- type Parameter
- type Parameters
- type Template
Constants ¶
const ( // ColorDefault default color ColorDefault = "\x1b[39m" // ColorRed red for screen ColorRed = "\x1b[91m" // ColorGreen green for screen ColorGreen = "\x1b[32m" // ColorBlue blue for screen ColorBlue = "\x1b[94m" // ColorGray for screen ColorGray = "\x1b[90m" )
const StatusCreateComplete = "CREATE_COMPLETE"
StatusCreateComplete CloudFormation Status
const StatusCreateInProgress = "CREATE_IN_PROGRESS"
StatusCreateInProgress CloudFormation Status
const StatusDeleteComplete = "DELETE_COMPLETE"
StatusDeleteComplete CloudFormation Status
Variables ¶
This section is empty.
Functions ¶
func CountParameter ¶
CountParameter - how mny params in the cfn template
func CreateKeyIfNotExist ¶
func CreateKeyIfNotExist(client Ec2Interface)
CreateKeyIfNotExist ssh key handling
func CreateLabPolicy ¶
func CreateLabPolicy(client IAMInterface, lab int)
CreateLabPolicy policy for awsstudent
func CreateStack ¶
func CreateStack(client DeployInterface, name string, template []byte)
CreateStack creates a lab stack
func CreateUserIfnotExist ¶
func CreateUserIfnotExist(client IAMInterface)
CreateUserIfnotExist awsstudent go
func DeleteLabPolicy ¶
func DeleteLabPolicy(client IAMInterface, lab int)
DeleteLabPolicy policy for awsstudent
func GenerateMyPassword ¶
func GenerateMyPassword() string
func IsStackCompleted ¶
func IsStackCompleted(data map[string]CloudFormationResource) bool
IsStackCompleted check for everything "completed"
func PolicyIAMAdditionalName ¶
func PolicyIAMName ¶
func PopulateData ¶
func PopulateData(client DeployInterface, name string, data map[string]CloudFormationResource) (map[string]CloudFormationResource, time.Time)
PopulateData update status from describe call
func ShowStatus ¶
func ShowStatus(client DeployInterface, name string, template []byte)
ShowStatus status of stack
Types ¶
type CloudFormationResource ¶
type CloudFormationResource struct { LogicalResourceID string PhysicalResourceID string Status string Type string Timestamp time.Time }
CloudFormationResource holder for status
type DeployInterface ¶
type DeployInterface interface { CreateStack(ctx context.Context, params *cfn.CreateStackInput, optFns ...func(*cfn.Options)) (*cfn.CreateStackOutput, error) DescribeStackEvents(ctx context.Context, params *cfn.DescribeStackEventsInput, optFns ...func(*cfn.Options)) (*cfn.DescribeStackEventsOutput, error) DeleteStack(ctx context.Context, params *cfn.DeleteStackInput, optFns ...func(*cfn.Options)) (*cfn.DeleteStackOutput, error) UpdateStack(ctx context.Context, params *cfn.UpdateStackInput, optFns ...func(*cfn.Options)) (*cfn.UpdateStackOutput, error) }
DeployInterface interface for deployment
type Ec2Interface ¶
type Ec2Interface interface { DescribeKeyPairs(ctx context.Context, params *ec2.DescribeKeyPairsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeKeyPairsOutput, error) CreateKeyPair(ctx context.Context, params *ec2.CreateKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.CreateKeyPairOutput, error) DeleteKeyPair(ctx context.Context, params *ec2.DeleteKeyPairInput, optFns ...func(*ec2.Options)) (*ec2.DeleteKeyPairOutput, error) DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) }
Ec2Interface all actions which are used from ec2
type IAMInterface ¶
type IAMInterface interface { AttachUserPolicy(ctx context.Context, params *iam.AttachUserPolicyInput, optFns ...func(*iam.Options)) (*iam.AttachUserPolicyOutput, error) DetachUserPolicy(ctx context.Context, params *iam.DetachUserPolicyInput, optFns ...func(*iam.Options)) (*iam.DetachUserPolicyOutput, error) CreateAccessKey(ctx context.Context, params *iam.CreateAccessKeyInput, optFns ...func(*iam.Options)) (*iam.CreateAccessKeyOutput, error) DeleteAccessKey(ctx context.Context, params *iam.DeleteAccessKeyInput, optFns ...func(*iam.Options)) (*iam.DeleteAccessKeyOutput, error) ListAccessKeys(ctx context.Context, params *iam.ListAccessKeysInput, optFns ...func(*iam.Options)) (*iam.ListAccessKeysOutput, error) CreateLoginProfile(ctx context.Context, params *iam.CreateLoginProfileInput, optFns ...func(*iam.Options)) (*iam.CreateLoginProfileOutput, error) DeleteLoginProfile(ctx context.Context, params *iam.DeleteLoginProfileInput, optFns ...func(*iam.Options)) (*iam.DeleteLoginProfileOutput, error) ListAttachedUserPolicies(ctx context.Context, params *iam.ListAttachedUserPoliciesInput, optFns ...func(*iam.Options)) (*iam.ListAttachedUserPoliciesOutput, error) ListUsers(ctx context.Context, params *iam.ListUsersInput, optFns ...func(*iam.Options)) (*iam.ListUsersOutput, error) CreateUser(ctx context.Context, params *iam.CreateUserInput, optFns ...func(*iam.Options)) (*iam.CreateUserOutput, error) DeleteUser(ctx context.Context, params *iam.DeleteUserInput, optFns ...func(*iam.Options)) (*iam.DeleteUserOutput, error) ListPolicies(ctx context.Context, params *iam.ListPoliciesInput, optFns ...func(*iam.Options)) (*iam.ListPoliciesOutput, error) // CreatePolicy(ctx context.Context, params *iam.CreatePolicyInput, optFns ...func(*iam.Options)) (*iam.CreatePolicyOutput, error) DeletePolicy(ctx context.Context, params *iam.DeletePolicyInput, optFns ...func(*iam.Options)) (*iam.DeletePolicyOutput, error) }
IAMInterface used iam actions
type Parameter ¶
type Parameter struct { Type string `yaml:"Type"` Description string `yaml:"Description,omitempty"` Default interface{} `yaml:"Default,omitempty"` AllowedPattern string `yaml:"AllowedPattern,omitempty"` AllowedValues []string `yaml:"AllowedValues,omitempty"` ConstraintDescription string `yaml:"ConstraintDescription,omitempty"` MaxLength int `yaml:"MaxLength,omitempty"` MinLength int `yaml:"MinLength,omitempty"` MaxValue float64 `yaml:"MaxValue,omitempty"` MinValue float64 `yaml:"MinValue,omitempty"` NoEcho bool `yaml:"NoEcho,omitempty"` }
Parameter map parms
type Parameters ¶
Parameters map parms
func ReadParameter ¶
func ReadParameter(template []byte) Parameters
ReadParameter - return parameters in template
func (*Parameters) ReadParameter ¶
func (p *Parameters) ReadParameter() *Parameters
ReadParameter read cloudformation parameter - NO USED YET
type Template ¶
type Template struct { AWSTemplateFormatVersion string `yaml:"AWSTemplateFormatVersion,omitempty"` Description string `yaml:"Description,omitempty"` Metadata map[string]interface{} `yaml:"Metadata,omitempty"` Parameters Parameters `yaml:"Parameters,omitempty"` Mappings map[string]interface{} `yaml:"Mappings,omitempty"` Conditions map[string]interface{} `yaml:"Conditions,omitempty"` }
Template Parameters Cloudformation parameters