cmd

package
v0.0.0-...-ac7c9fb Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloudFormation = &cli.Command{
	Name:    "cloudformation",
	Aliases: []string{"cfn"},
	Usage:   "Get a list of stacks",
	Action: func(c *cli.Context) error {
		return getStackList(c.String("profile"), c.String("region"))
	},
	Subcommands: []*cli.Command{
		{
			Name:      "events",
			Usage:     "Get stack events",
			ArgsUsage: "[ --name | -n ] <CfnStackName>",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Aliases:  []string{"n"},
					Usage:    "Set stack name",
					Required: true,
				},
			},
			Action: func(c *cli.Context) error {
				return getStackEvents(c.String("profile"), c.String("region"), c.String("name"))
			},
		},
		{
			Name:      "outputs",
			Usage:     "Get stack outputs",
			ArgsUsage: "[ --name | -n ] <CfnStackName>",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "name",
					Aliases:  []string{"n"},
					Usage:    "Set stack name",
					Required: true,
				},
			},
			Action: func(c *cli.Context) error {
				return getStackEvents(c.String("profile"), c.String("region"), c.String("name"))
			},
		},
	},
}
View Source
var Ec2 = &cli.Command{
	Name:      "ec2",
	Usage:     "Get a list of EC2 instance",
	ArgsUsage: "[ --tag | -t ] <Key:Value>",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "tag",
			Aliases: []string{"t"},
			Usage:   "The Key-Value of the tag to filter",
		},
	},
	Action: func(c *cli.Context) error {
		return getEc2List(c.String("profile"), c.String("region"), c.String("tag"))
	},
	Subcommands: []*cli.Command{
		{
			Name:    "session",
			Aliases: []string{"s"},
			Usage:   "Start a session on your instances by launching shell terminal",
			Action: func(c *cli.Context) error {
				return startSession(c.String("profile"), c.String("region"))
			},
		},
		{
			Name:      "command",
			Aliases:   []string{"c"},
			Usage:     "Runs shell script to target instances",
			ArgsUsage: "[ --tag | -t ] <Key:Value> [ --id | -i ] <InstanceId> [ --file | -f ] <ScriptFile>",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:    "tag",
					Aliases: []string{"t"},
					Usage:   "Set Key-Value of the tag (e.g. -t Name:test-ec2)",
				},
				&cli.StringFlag{
					Name:    "id",
					Aliases: []string{"i"},
					Usage:   "Set EC2 instance id",
				},
				&cli.StringFlag{
					Name:    "file",
					Aliases: []string{"f"},
					Usage:   "Set execute file",
				},
			},
			Action: func(c *cli.Context) error {
				return sendCommand(c.String("profile"), c.String("region"), c.String("tag"), c.String("id"), c.String("file"), c.Args())
			},
		},
	},
}
View Source
var Ecs = &cli.Command{
	Name:  "ecs",
	Usage: "Get a list of ECS",
	Subcommands: []*cli.Command{
		{
			Name:  "clusters",
			Usage: "Get a list of ECS clusters",
			Action: func(c *cli.Context) error {
				return getClusters(c.String("profile"), c.String("region"))
			},
		},
		{
			Name:  "services",
			Usage: "Get a list of ECS services",
			Action: func(c *cli.Context) error {
				return getServices(c.String("profile"), c.String("region"))
			},
		},
	},
}
View Source
var ElastiCache = &cli.Command{
	Name:    "elasticache",
	Aliases: []string{"ec"},
	Usage:   "Get a list of ElastiCache",
	Action: func(c *cli.Context) error {
		return getEcNodeList(c.String("profile"), c.String("region"))
	},
}
View Source
var Elb = &cli.Command{
	Name:  "elb",
	Usage: "Get a list of ELB",
	Action: func(c *cli.Context) error {
		return getElbList(c.String("profile"), c.String("region"))
	},
}
View Source
var Iam = &cli.Command{
	Name:  "iam",
	Usage: "Get a list of IAM users",
	Action: func(c *cli.Context) error {
		return getUserList(c.String("profile"), c.String("region"))
	},
	Subcommands: []*cli.Command{
		{
			Name:  "role",
			Usage: "Get a list of IAM role",
			Action: func(c *cli.Context) error {
				return getRoleList(c.String("profile"), c.String("region"))
			},
		},
	},
}
View Source
var Rds = &cli.Command{
	Name:  "rds",
	Usage: "Get a list of RDS instance",
	Action: func(c *cli.Context) error {
		return getRdsList(c.String("profile"), c.String("region"))
	},
	Subcommands: []*cli.Command{
		{
			Name:    "cluster",
			Aliases: []string{"c"},
			Usage:   "Get a list of RDS cluster",
			Action: func(c *cli.Context) error {
				return getRdsClusterList(c.String("profile"), c.String("region"))
			},
			Subcommands: []*cli.Command{
				{
					Name:    "endpoint",
					Aliases: []string{"e"},
					Usage:   "Get a list of RDS cluster endpoint",
					Action: func(c *cli.Context) error {
						return getRdsClusterEndpoints(c.String("profile"), c.String("region"))
					},
				},
			},
		},
		{
			Name:    "s3export",
			Aliases: []string{"e"},
			Usage:   "Get a list of RDS S3 export",
			Action: func(c *cli.Context) error {
				return getRdsS3ExportList(c.String("profile"), c.String("region"))
			},
		},
	},
}
View Source
var Route53 = &cli.Command{
	Name:  "route53",
	Usage: "Get a list of Rotue53 Record resources",
	Action: func(c *cli.Context) error {
		return getRecordsList(c.String("profile"), c.String("region"))
	},
}
View Source
var S3 = &cli.Command{
	Name:  "s3",
	Usage: "Get a list of S3 Buckets",
	Action: func(c *cli.Context) error {
		return getBucketList(c.String("profile"), c.String("region"))
	},
	Subcommands: []*cli.Command{
		{
			Name:      "object",
			Usage:     "Get S3 object list",
			ArgsUsage: "[ --bucket | -b ] <BucketName>",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:    "bucket",
					Aliases: []string{"b"},
					Usage:   "Set bucket name",
				},
			},
			Action: func(c *cli.Context) error {
				return getObjectList(c.String("profile"), c.String("region"), c.String("bucket"))
			},
		},
		{
			Name:      "cat",
			Usage:     "Desplay S3 object file",
			ArgsUsage: "[ --bucket | -b ] <BucketName> [ --key | -k ] <ObjectKey>",
			Flags: []cli.Flag{
				&cli.StringFlag{
					Name:     "bucket",
					Aliases:  []string{"b"},
					Usage:    "Set bucket name",
					Required: true,
				},
				&cli.StringFlag{
					Name:     "key",
					Aliases:  []string{"k"},
					Usage:    "Set object key",
					Required: true,
				},
				&cli.BoolFlag{
					Name:    "download",
					Aliases: []string{"d"},
					Usage:   "Download object file",
				},
			},
			Action: func(c *cli.Context) error {
				return catObject(c.String("profile"), c.String("region"), c.String("bucket"), c.String("key"), c.Bool("download"))
			},
		},
	},
}
View Source
var Ssm = &cli.Command{
	Name:  "ssm",
	Usage: "Use Systems Manager services",
	Subcommands: []*cli.Command{
		{
			Name:    "parameter",
			Aliases: []string{"p"},
			Usage:   "Get parameter store",
			Action: func(c *cli.Context) error {
				return getParameter(c.String("profile"), c.String("region"))
			},
		},
	},
}

Functions

func Before

func Before(c *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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