myaws

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoscalingAttachOptions added in v0.0.7

type AutoscalingAttachOptions struct {
	AsgName           string
	InstanceIds       []*string
	LoadBalancerNames []*string
	Wait              bool
}

AutoscalingAttachOptions customize the behavior of the Attach command.

type AutoscalingDetachOptions added in v0.0.7

type AutoscalingDetachOptions struct {
	AsgName           string
	InstanceIds       []*string
	LoadBalancerNames []*string
	Wait              bool
}

AutoscalingDetachOptions customize the behavior of the Detach command.

type AutoscalingLsOptions added in v0.0.7

type AutoscalingLsOptions struct {
	All bool
}

AutoscalingLsOptions customize the behavior of the Ls command.

type AutoscalingUpdateOptions added in v0.0.7

type AutoscalingUpdateOptions struct {
	AsgName         string
	DesiredCapacity int64
	Wait            bool
}

AutoscalingUpdateOptions customize the behavior of the Update command.

type Client added in v0.0.7

type Client struct {
	AutoScaling *autoscaling.AutoScaling
	EC2         *ec2.EC2
	ECS         *ecs.ECS
	ECR         *ecr.ECR
	ELB         *elb.ELB
	IAM         *iam.IAM
	RDS         *rds.RDS
	SSM         *ssm.SSM
	STS         *sts.STS
	// contains filtered or unexported fields
}

Client represents myaws CLI

func NewClient added in v0.0.7

func NewClient(stdin io.Reader, stdout io.Writer, stderr io.Writer, profile string, region string, timezone string, humanize bool, debug bool) (*Client, error)

NewClient initializes Client instance

func (*Client) AutoscalingAttach added in v0.0.7

func (client *Client) AutoscalingAttach(options AutoscalingAttachOptions) error

AutoscalingAttach attaches instances or load balancers from autoscaling group.

func (*Client) AutoscalingDetach added in v0.0.7

func (client *Client) AutoscalingDetach(options AutoscalingDetachOptions) error

AutoscalingDetach detaches instances or load balancers from autoscaling group.

func (*Client) AutoscalingLs added in v0.0.7

func (client *Client) AutoscalingLs(options AutoscalingLsOptions) error

AutoscalingLs describes autoscaling groups.

func (*Client) AutoscalingUpdate added in v0.0.7

func (client *Client) AutoscalingUpdate(options AutoscalingUpdateOptions) error

AutoscalingUpdate updates autoscaling group setting. Available param is currently desired-capacity only.

func (*Client) Confirmation added in v0.0.9

func (client *Client) Confirmation(message string) (bool, error)

Confirmation asks user for confirmation. "y" and "Y" returns true and others are false.

func (*Client) EC2Ls added in v0.0.7

func (client *Client) EC2Ls(options EC2LsOptions) error

EC2Ls describes EC2 instances.

func (*Client) EC2RILs added in v0.1.1

func (client *Client) EC2RILs(options EC2RILsOptions) error

EC2RILs describes EC2 Reserved Instances.

func (*Client) EC2SSH added in v0.0.7

func (client *Client) EC2SSH(options EC2SSHOptions) error

EC2SSH resolves IP address of EC2 instance and connects to it by SSH.

func (*Client) EC2Start added in v0.0.7

func (client *Client) EC2Start(options EC2StartOptions) error

EC2Start starts EC2 instances. If wait flag is true, wait until instance is in running state.

func (*Client) EC2Stop added in v0.0.7

func (client *Client) EC2Stop(options EC2StopOptions) error

EC2Stop stops EC2 instances. If wait flag is true, wait until instance is in stopped state.

func (*Client) ECRGetLogin added in v0.0.7

func (client *Client) ECRGetLogin() error

ECRGetLogin gets docker login command with authorization token for ECR.

func (*Client) ECSNodeDrain added in v0.3.4

func (client *Client) ECSNodeDrain(options ECSNodeDrainOptions) error

ECSNodeDrain Drain ECS container instances. We want to wait until drain action is completed, but the ECSNodeUpdate method is general purpose, so we implement a wait option to specialized method for draining.

func (*Client) ECSNodeLs added in v0.3.4

func (client *Client) ECSNodeLs(options ECSNodeLsOptions) error

ECSNodeLs describes ECS container instances.

func (*Client) ECSNodeRenew added in v0.3.4

func (client *Client) ECSNodeRenew(options ECSNodeRenewOptions) error

ECSNodeRenew renew ECS container instances with blue-green deployment. This method is an automation process to renew your ECS container instances if you update the AMI. creates new instances, drains the old instances, and discards the old instances.

func (*Client) ECSNodeUpdate added in v0.3.4

func (client *Client) ECSNodeUpdate(options ECSNodeUpdateOptions) error

ECSNodeUpdate Update ECS container instances.

func (*Client) ECSServiceLs added in v0.3.4

func (client *Client) ECSServiceLs(options ECSServiceLsOptions) error

ECSServiceLs describes ECS services.

func (*Client) ELBLs added in v0.0.7

func (client *Client) ELBLs() error

ELBLs describes ELBs.

func (*Client) ELBPs added in v0.0.7

func (client *Client) ELBPs(options ELBPsOptions) error

ELBPs describes ELB's instance health status.

func (*Client) FindEC2Instances added in v0.0.8

func (client *Client) FindEC2Instances(filterTag string, all bool) ([]*ec2.Instance, error)

FindEC2Instances returns an array of instances matching the conditions.

func (*Client) FindEC2ReservedInstances added in v0.1.1

func (client *Client) FindEC2ReservedInstances(all bool) ([]*ec2.ReservedInstances, error)

FindEC2ReservedInstances return an array of reserved instances matching the conditions.

func (*Client) FindSSMParameterMetadata added in v0.2.0

func (client *Client) FindSSMParameterMetadata(name string) ([]*ssm.ParameterMetadata, error)

FindSSMParameterMetadata returns an array of parameter metadata matching the name.

func (*Client) FormatTime added in v0.0.7

func (client *Client) FormatTime(t *time.Time) string

FormatTime returns a localized time string. If humanize flag is true, it is converted to human frendly representation.

func (*Client) GetSSMParameters added in v0.3.2

func (client *Client) GetSSMParameters(names []*string, withDecryption bool) ([]*ssm.Parameter, error)

GetSSMParameters returns an array of parameters at once.

func (*Client) IAMGetUser added in v0.0.9

func (client *Client) IAMGetUser(username string) (*iam.User, error)

IAMGetUser returns IAM user.

func (*Client) IAMUserCreateLoginProfile added in v0.1.1

func (client *Client) IAMUserCreateLoginProfile(username string, password string, changeRequired bool) error

IAMUserCreateLoginProfile creates a login profile for IAM User with initial password.

func (*Client) IAMUserLs added in v0.0.9

func (client *Client) IAMUserLs() error

IAMUserLs describes IAM users

func (*Client) IAMUserResetPassword added in v0.0.9

func (client *Client) IAMUserResetPassword(options IAMUserResetPasswordOptions) error

IAMUserResetPassword reset password for IAM user.

func (*Client) IAMUserUpdatePassword added in v0.1.1

func (client *Client) IAMUserUpdatePassword(username string, password string, changeRequired bool) error

IAMUserUpdatePassword updates the password of existing login profile for IAM user.

func (*Client) RDSLs added in v0.0.7

func (client *Client) RDSLs(options RDSLsOptions) error

RDSLs describes RDSs.

func (*Client) SSMParameterDel added in v0.2.0

func (client *Client) SSMParameterDel(options SSMParameterDelOptions) error

SSMParameterDel deletes SSM parameter.

func (*Client) SSMParameterEnv added in v0.2.0

func (client *Client) SSMParameterEnv(options SSMParameterEnvOptions) error

SSMParameterEnv prints SSM parameters as a list of environment variables.

func (*Client) SSMParameterGet added in v0.0.9

func (client *Client) SSMParameterGet(options SSMParameterGetOptions) error

SSMParameterGet get values from SSM parameter store with KMS decryption.

func (*Client) SSMParameterLs added in v0.2.0

func (client *Client) SSMParameterLs(options SSMParameterLsOptions) error

SSMParameterLs describes SSM parameters.

func (*Client) SSMParameterPut added in v0.0.9

func (client *Client) SSMParameterPut(options SSMParameterPutOptions) error

SSMParameterPut put value to SSM parameter store with KMS encryption.

func (*Client) STSID added in v0.1.0

func (client *Client) STSID() error

STSID gets caller identity.

func (*Client) WaitUntilAutoScalingGroupStable added in v0.3.4

func (client *Client) WaitUntilAutoScalingGroupStable(asgName string) error

WaitUntilAutoScalingGroupStable is a helper function which waits until the AutoScaling Group converges to the desired state. We only check the status of AutoScaling Group. If the ASG has an ELB, the health check status of ELB can link with the health status of ASG, so we don't check the status of ELB here. Due to the current limitation of the implementation of `request.Waiter`, we need to wait it in two steps. 1. Wait until the number of instances equals `DesiredCapacity`. 2. Wait until all instances are InService.

func (*Client) WaitUntilECSAllServicesStable added in v0.3.4

func (client *Client) WaitUntilECSAllServicesStable(cluster string) error

WaitUntilECSAllServicesStable is a helper function which wait until all ECS servcies are running the desired number of containers. The official (*ECS) WaitUntilServicesStable does not support more than 10 services. We need to check 10 services at a time.

func (*Client) WaitUntilECSContainerInstancesAreDrained added in v0.3.4

func (client *Client) WaitUntilECSContainerInstancesAreDrained(cluster string, containerInstances []*string) error

WaitUntilECSContainerInstancesAreDrained is a helper function which waits until the ECS container instances are drained. Due to the current limitation of the implementation of `request.Waiter`, we need to wait it in two steps. 1. Wait until container instances are DRAINING state. 2. Wait until no running tasks on the container instances.

func (*Client) WaitUntilECSContainerInstancesAreRegistered added in v0.3.4

func (client *Client) WaitUntilECSContainerInstancesAreRegistered(cluster string, targetCapacity int64) error

WaitUntilECSContainerInstancesAreRegistered is a helper function which waits until the ECS container instances are registered. Due to the current limitation of the implementation of `request.Waiter`, we need to wait it in two steps. 1. Wait until the number of container instances is targetCapacity. 2. Wait until container instances are ACTIVE state.

type EC2LsOptions added in v0.0.7

type EC2LsOptions struct {
	All       bool
	Quiet     bool
	FilterTag string
	Fields    []string
}

EC2LsOptions customize the behavior of the Ls command.

type EC2RILsOptions added in v0.1.1

type EC2RILsOptions struct {
	All    bool
	Quiet  bool
	Fields []string
}

EC2RILsOptions customize the behavior of the Ls command.

type EC2SSHOptions added in v0.0.7

type EC2SSHOptions struct {
	FilterTag    string
	LoginName    string
	IdentityFile string
	Private      bool
	Command      string
}

EC2SSHOptions customize the behavior of the SSH command.

type EC2StartOptions added in v0.0.7

type EC2StartOptions struct {
	InstanceIds []*string
	Wait        bool
}

EC2StartOptions customize the behavior of the Start command.

type EC2StopOptions added in v0.0.7

type EC2StopOptions struct {
	InstanceIds []*string
	Wait        bool
}

EC2StopOptions customize the behavior of the Stop command.

type ECSNodeDrainOptions added in v0.3.4

type ECSNodeDrainOptions struct {
	Cluster            string
	ContainerInstances []*string
	Wait               bool
}

ECSNodeDrainOptions customize the behavior of the Drain command.

type ECSNodeLsOptions added in v0.3.4

type ECSNodeLsOptions struct {
	Cluster string
}

ECSNodeLsOptions customize the behavior of the Ls command.

type ECSNodeRenewOptions added in v0.3.4

type ECSNodeRenewOptions struct {
	Cluster string
	AsgName string
}

ECSNodeRenewOptions customize the behavior of the Renew command.

type ECSNodeUpdateOptions added in v0.3.4

type ECSNodeUpdateOptions struct {
	Cluster            string
	ContainerInstances []*string
	Status             string
}

ECSNodeUpdateOptions customize the behavior of the Update command.

type ECSServiceLsOptions added in v0.3.4

type ECSServiceLsOptions struct {
	Cluster string
}

ECSServiceLsOptions customize the behavior of the Ls command.

type ELBPsOptions added in v0.0.7

type ELBPsOptions struct {
	LoadBalancerName string
}

ELBPsOptions customize the behavior of the Ps command.

type IAMUserResetPasswordOptions added in v0.0.9

type IAMUserResetPasswordOptions struct {
	UserName string
}

IAMUserResetPasswordOptions customize the behavior of the IAMUserResetPassword command.

type RDSLsOptions added in v0.0.7

type RDSLsOptions struct {
	Quiet  bool
	Fields []string
}

RDSLsOptions customize the behavior of the Ls command.

type SSMParameterDelOptions added in v0.2.0

type SSMParameterDelOptions struct {
	Name string
}

SSMParameterDelOptions customize the behavior of the ParameterDel command.

type SSMParameterEnvOptions added in v0.2.0

type SSMParameterEnvOptions struct {
	Name         string
	DockerFormat bool
}

SSMParameterEnvOptions customize the behavior of the ParameterEnv command.

type SSMParameterGetOptions added in v0.0.9

type SSMParameterGetOptions struct {
	Names          []*string
	WithDecryption bool
}

SSMParameterGetOptions customize the behavior of the ParameterGet command.

type SSMParameterLsOptions added in v0.2.0

type SSMParameterLsOptions struct {
	Name string
}

SSMParameterLsOptions customize the behavior of the ParameterLs command.

type SSMParameterPutOptions added in v0.0.9

type SSMParameterPutOptions struct {
	Name  string
	Value string
	KeyID string
}

SSMParameterPutOptions customize the behavior of the ParameterPut command.

Jump to

Keyboard shortcuts

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