Documentation ¶
Index ¶
- type AutoScalingSetInstanceProtectionOptions
- type AutoscalingAttachOptions
- type AutoscalingDetachOptions
- type AutoscalingLsOptions
- type AutoscalingUpdateOptions
- type Client
- func (client *Client) AutoScalingSetInstanceProtection(options AutoScalingSetInstanceProtectionOptions) error
- func (client *Client) AutoscalingAttach(options AutoscalingAttachOptions) error
- func (client *Client) AutoscalingDetach(options AutoscalingDetachOptions) error
- func (client *Client) AutoscalingLs(options AutoscalingLsOptions) error
- func (client *Client) AutoscalingUpdate(options AutoscalingUpdateOptions) error
- func (client *Client) Confirmation(message string) (bool, error)
- func (client *Client) EC2Ls(options EC2LsOptions) error
- func (client *Client) EC2RILs(options EC2RILsOptions) error
- func (client *Client) EC2SSH(options EC2SSHOptions) error
- func (client *Client) EC2Start(options EC2StartOptions) error
- func (client *Client) EC2Stop(options EC2StopOptions) error
- func (client *Client) ECRGetLogin(options ECRGetLoginOptions) error
- func (client *Client) ECSNodeDrain(options ECSNodeDrainOptions) error
- func (client *Client) ECSNodeLs(options ECSNodeLsOptions) error
- func (client *Client) ECSNodeRenew(options ECSNodeRenewOptions) error
- func (client *Client) ECSNodeUpdate(options ECSNodeUpdateOptions) error
- func (client *Client) ECSServiceLs(options ECSServiceLsOptions) error
- func (client *Client) ECSServiceUpdate(options ECSServiceUpdateOptions) error
- func (client *Client) ECSStatus(options ECSStatusOptions) error
- func (client *Client) ELBLs() error
- func (client *Client) ELBPs(options ELBPsOptions) error
- func (client *Client) ELBV2Ls() error
- func (client *Client) ELBV2Ps(options ELBV2PsOptions) error
- func (client *Client) FindEC2Instances(filterTag string, all bool) ([]*ec2.Instance, error)
- func (client *Client) FindEC2ReservedInstances(all bool) ([]*ec2.ReservedInstances, error)
- func (client *Client) FindSSMParameterMetadata(name string) ([]*ssm.ParameterMetadata, error)
- func (client *Client) FormatTime(t *time.Time) string
- func (client *Client) GetParametersByPath(path *string, withDecryption bool) ([]*ssm.Parameter, error)
- func (client *Client) GetSSMParameters(names []*string, withDecryption bool) ([]*ssm.Parameter, error)
- func (client *Client) IAMGetUser(username string) (*iam.User, error)
- func (client *Client) IAMUserCreateLoginProfile(username string, password string, changeRequired bool) error
- func (client *Client) IAMUserLs() error
- func (client *Client) IAMUserResetPassword(options IAMUserResetPasswordOptions) error
- func (client *Client) IAMUserUpdatePassword(username string, password string, changeRequired bool) error
- func (client *Client) RDSLs(options RDSLsOptions) error
- func (client *Client) SSMParameterDel(options SSMParameterDelOptions) error
- func (client *Client) SSMParameterEnv(options SSMParameterEnvOptions) error
- func (client *Client) SSMParameterGet(options SSMParameterGetOptions) error
- func (client *Client) SSMParameterLs(options SSMParameterLsOptions) error
- func (client *Client) SSMParameterPut(options SSMParameterPutOptions) error
- func (client *Client) STSID() error
- func (client *Client) WaitUntilAutoScalingGroupStable(asgName string) error
- func (client *Client) WaitUntilECSAllServicesStableWithContext(ctx context.Context, cluster string) error
- func (client *Client) WaitUntilECSAllTargetsInService(cluster string) error
- func (client *Client) WaitUntilECSContainerInstancesAreDrainedWithContext(ctx context.Context, cluster string, containerInstances []*string) error
- func (client *Client) WaitUntilECSContainerInstancesAreRegistered(cluster string, targetCapacity int64) error
- func (client *Client) WaitUntilECSContainerInstancesNoRunningTaskWithContext(ctx aws.Context, input *ecs.DescribeContainerInstancesInput, ...) error
- func (client *Client) WaitUntilECSContainerInstancesStatusWithContext(ctx aws.Context, input *ecs.DescribeContainerInstancesInput, status string, ...) error
- func (client *Client) WaitUntilECSServicesStableWithContext(ctx context.Context, cluster string, services []string) error
- type EC2LsOptions
- type EC2RILsOptions
- type EC2SSHOptions
- type EC2StartOptions
- type EC2StopOptions
- type ECRGetLoginOptions
- type ECSNodeDrainOptions
- type ECSNodeLsOptions
- type ECSNodeRenewOptions
- type ECSNodeUpdateOptions
- type ECSServiceLsOptions
- type ECSServiceUpdateOptions
- type ECSStatusOptions
- type ELBPsOptions
- type ELBV2PsOptions
- type IAMUserResetPasswordOptions
- type RDSLsOptions
- type SSMParameterDelOptions
- type SSMParameterEnvOptions
- type SSMParameterGetOptions
- type SSMParameterLsOptions
- type SSMParameterPutOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoScalingSetInstanceProtectionOptions ¶ added in v0.3.12
type AutoScalingSetInstanceProtectionOptions struct { AsgName string InstanceIds []*string ProtectedFromScaleIn bool }
AutoScalingSetInstanceProtectionOptions customizes the behavior of the Attach command.
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
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 ELBV2 *elbv2.ELBV2 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) AutoScalingSetInstanceProtection ¶ added in v0.3.12
func (client *Client) AutoScalingSetInstanceProtection(options AutoScalingSetInstanceProtectionOptions) error
AutoScalingSetInstanceProtection protects from termination when scale in your autoscaling group.
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
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(options ECRGetLoginOptions) 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) ECSServiceUpdate ¶ added in v0.3.15
func (client *Client) ECSServiceUpdate(options ECSServiceUpdateOptions) error
ECSServiceUpdate update ECS services.
func (*Client) ECSStatus ¶ added in v0.3.15
func (client *Client) ECSStatus(options ECSStatusOptions) error
ECSStatus prints ECS status.
func (*Client) ELBPs ¶ added in v0.0.7
func (client *Client) ELBPs(options ELBPsOptions) error
ELBPs describes ELB's instance health status.
func (*Client) ELBV2Ps ¶ added in v0.3.9
func (client *Client) ELBV2Ps(options ELBV2PsOptions) error
ELBV2Ps describes ELBV2's instance health status.
func (*Client) FindEC2Instances ¶ added in v0.0.8
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
FormatTime returns a localized time string. If humanize flag is true, it is converted to human frendly representation.
func (*Client) GetParametersByPath ¶ added in v0.3.13
func (client *Client) GetParametersByPath(path *string, withDecryption bool) ([]*ssm.Parameter, error)
GetParametersByPath returns a list of parameters that start with the specified path.
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
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) 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) WaitUntilAutoScalingGroupStable ¶ added in v0.3.4
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) WaitUntilECSAllServicesStableWithContext ¶ added in v0.3.17
func (client *Client) WaitUntilECSAllServicesStableWithContext(ctx context.Context, cluster string) error
WaitUntilECSAllServicesStableWithContext 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) WaitUntilECSAllTargetsInService ¶ added in v0.3.9
WaitUntilECSAllTargetsInService is a helper function which wait until all target related to ECS servcies are healthy.
func (*Client) WaitUntilECSContainerInstancesAreDrainedWithContext ¶ added in v0.3.18
func (client *Client) WaitUntilECSContainerInstancesAreDrainedWithContext(ctx context.Context, cluster string, containerInstances []*string) error
WaitUntilECSContainerInstancesAreDrainedWithContext 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.
func (*Client) WaitUntilECSContainerInstancesNoRunningTaskWithContext ¶ added in v0.3.18
func (client *Client) WaitUntilECSContainerInstancesNoRunningTaskWithContext(ctx aws.Context, input *ecs.DescribeContainerInstancesInput, opts ...request.WaiterOption) error
WaitUntilECSContainerInstancesNoRunningTaskWithContext waits until ECS ContainerInstances has no running tasks. The waitUntilECSContainerInstancesNoRunningTaskWithContext has fixed MaxAttempts(40) and Delay(15), we can't wait more than 10 minutes. We may be able to set a longer timeout, but there is no single appropriate value to meet any case. So we wrap it and allow timeout with a given context. Note that this function never timeout itself.
func (*Client) WaitUntilECSContainerInstancesStatusWithContext ¶ added in v0.3.18
func (client *Client) WaitUntilECSContainerInstancesStatusWithContext(ctx aws.Context, input *ecs.DescribeContainerInstancesInput, status string, opts ...request.WaiterOption) error
WaitUntilECSContainerInstancesStatusWithContext waits until ECS ContainerInstances in a given Status. The waitUntilECSContainerInstancesStatusWithContext has fixed MaxAttempts(40) and Delay(15), we can't wait more than 10 minutes. We may be able to set a longer timeout, but there is no single appropriate value to meet any case. So we wrap it and allow timeout with a given context. Note that this function never timeout itself.
func (*Client) WaitUntilECSServicesStableWithContext ¶ added in v0.3.17
func (client *Client) WaitUntilECSServicesStableWithContext(ctx context.Context, cluster string, services []string) error
WaitUntilECSServicesStableWithContext waits until ECS services stable. The official (*ECS) WaitUntilServicesStableWithContext has fixed MaxAttempts(40) and Delay(15), we can't wait more than 10 minutes. So we wrap it and allow timeout with a given context. Note that this function never timeout itself.
type EC2LsOptions ¶ added in v0.0.7
EC2LsOptions customize the behavior of the Ls command.
type EC2RILsOptions ¶ added in v0.1.1
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
EC2StartOptions customize the behavior of the Start command.
type EC2StopOptions ¶ added in v0.0.7
EC2StopOptions customize the behavior of the Stop command.
type ECRGetLoginOptions ¶ added in v0.3.14
type ECRGetLoginOptions struct {
RegistryIds []*string
}
ECRGetLoginOptions customize the behavior of the ECRGetLogin command.
type ECSNodeDrainOptions ¶ added in v0.3.4
type ECSNodeDrainOptions struct { Cluster string ContainerInstances []*string Wait bool Timeout time.Duration }
ECSNodeDrainOptions customize the behavior of the Drain command.
type ECSNodeLsOptions ¶ added in v0.3.4
ECSNodeLsOptions customize the behavior of the Ls command.
type ECSNodeRenewOptions ¶ added in v0.3.4
ECSNodeRenewOptions customize the behavior of the Renew command.
type ECSNodeUpdateOptions ¶ added in v0.3.4
ECSNodeUpdateOptions customize the behavior of the Update command.
type ECSServiceLsOptions ¶ added in v0.3.4
ECSServiceLsOptions customize the behavior of the Ls command.
type ECSServiceUpdateOptions ¶ added in v0.3.15
type ECSServiceUpdateOptions struct { Cluster string Service string DesiredCount *int64 Wait bool Timeout time.Duration Force bool }
ECSServiceUpdateOptions customize the behavior of the Update command.
type ECSStatusOptions ¶ added in v0.3.15
type ECSStatusOptions struct {
Cluster string
}
ECSStatusOptions 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 ELBV2PsOptions ¶ added in v0.3.9
type ELBV2PsOptions struct {
TargetGroupName string
}
ELBV2PsOptions 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
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
SSMParameterEnvOptions customize the behavior of the ParameterEnv command.
type SSMParameterGetOptions ¶ added in v0.0.9
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
SSMParameterPutOptions customize the behavior of the ParameterPut command.
Source Files ¶
- autoscaling.go
- autoscaling_attach.go
- autoscaling_detach.go
- autoscaling_ls.go
- autoscaling_set_instance_protection.go
- autoscaling_update.go
- autoscaling_waiter.go
- client.go
- config.go
- ec2.go
- ec2_ls.go
- ec2_ssh.go
- ec2_start.go
- ec2_stop.go
- ec2ri.go
- ec2ri_ls.go
- ecr_get_login.go
- ecs.go
- ecs_node_drain.go
- ecs_node_ls.go
- ecs_node_renew.go
- ecs_node_update.go
- ecs_service_ls.go
- ecs_service_update.go
- ecs_status.go
- ecs_waiter.go
- elb_ls.go
- elb_ps.go
- elbv2_ls.go
- elbv2_ps.go
- iam_user_ls.go
- iam_user_reset_password.go
- rds_ls.go
- ssm_parameter.go
- ssm_parameter_del.go
- ssm_parameter_env.go
- ssm_parameter_get.go
- ssm_parameter_ls.go
- ssm_parameter_put.go
- sts_id.go
- time.go