Skip to content

Commit

Permalink
Change 'ez' to 'simple' to align with repo name
Browse files Browse the repository at this point in the history
  • Loading branch information
haugenj committed Sep 2, 2020
1 parent 4652277 commit 3fa1f54
Show file tree
Hide file tree
Showing 37 changed files with 167 additions and 167 deletions.
2 changes: 1 addition & 1 deletion BUILD.md
Expand Up @@ -23,7 +23,7 @@ The resulting binary will be in the generated `build/` dir
$ make build
$ ls build/
ez-ec2
simple-ec2
```

## Test
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Expand Up @@ -19,14 +19,14 @@ COPY . .
RUN make build
# In case the target is build for testing:
# $ docker build --target=builder -t test .
CMD ["/aws-simple-ec2-cli/build/ez-ec2"]
CMD ["/aws-simple-ec2-cli/build/simple-ec2"]

# Copy the binary into a thin image
FROM amazonlinux:2 as amazonlinux
FROM scratch
WORKDIR /
COPY --from=builder /aws-simple-ec2-cli/build/ez-ec2 .
COPY --from=builder /aws-simple-ec2-cli/build/simple-ec2 .
COPY --from=amazonlinux /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/
COPY THIRD_PARTY_LICENSES .
USER 1000
ENTRYPOINT ["/ez-ec2"]
ENTRYPOINT ["/simple-ec2"]
28 changes: 14 additions & 14 deletions Makefile
@@ -1,9 +1,9 @@
MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST))))
PROJECT_IMPORT_DIR = ez-ec2
PROJECT_IMPORT_DIR = simple-ec2
BUILD_DIR_PATH = ${MAKEFILE_PATH}/build
CLI_BINARY_NAME = ez-ec2
CLI_BINARY_NAME = simple-ec2
VERSION ?= $(shell git describe --tags --always --dirty)
BIN ?= ez-ec2
BIN ?= simple-ec2
REPO_FULL_NAME ?= awslabs/aws-simple-ec2-cli
GOOS ?= $(uname | tr '[:upper:]' '[:lower:]')
GOARCH ?= amd64
Expand All @@ -14,9 +14,9 @@ LATEST_RELEASE_TAG=$(shell git tag | tail -1)
PREVIOUS_RELEASE_TAG=$(shell git tag | tail -2 | head -1)

# The main CloudFormation template for creating a new stack during launch
EZEC2_CLOUDFORMATION_TEMPLATE_FILE=${MAKEFILE_PATH}/cloudformation_template.json
EZEC2_CLOUDFORMATION_TEMPLATE_ENCODED=$(shell cat ${EZEC2_CLOUDFORMATION_TEMPLATE_FILE} | base64 | tr -d \\n)
EZEC2_CLOUDFORMATION_TEMPLATE_VAR=${PROJECT_IMPORT_DIR}/pkg/cfn.Ezec2CloudformationTemplateEncoded
SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_FILE=${MAKEFILE_PATH}/cloudformation_template.json
SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_ENCODED=$(shell cat ${SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_FILE} | base64 | tr -d \\n)
SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_VAR=${PROJECT_IMPORT_DIR}/pkg/cfn.SimpleEc2CloudformationTemplateEncoded

# The CloudFormation template for e2e cfn test
E2E_CFN_TEST_CLOUDFORMATION_TEMPLATE_FILE=${MAKEFILE_PATH}/test/e2e/e2e-cfn-test/cloudformation_template.json
Expand All @@ -33,12 +33,12 @@ E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_FILE=${MAKEFILE_PATH}/test/e2e/e2e-ec
E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_ENCODED=$(shell cat ${E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_FILE} | base64 | tr -d \\n)
E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_VAR=${PROJECT_IMPORT_DIR}/pkg/cfn.E2eEc2helperTestCloudformationTemplateEncoded

EMBED_TEMPLATE_FLAG=-ldflags '-X "${EZEC2_CLOUDFORMATION_TEMPLATE_VAR}=${EZEC2_CLOUDFORMATION_TEMPLATE_ENCODED}"\
EMBED_TEMPLATE_FLAG=-ldflags '-X "${SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_VAR}=${SIMPLE_EC2_CLOUDFORMATION_TEMPLATE_ENCODED}"\
-X "${E2E_CFN_TEST_CLOUDFORMATION_TEMPLATE_VAR}=${E2E_CFN_TEST_CLOUDFORMATION_TEMPLATE_ENCODED}"\
-X "${E2E_CONNECT_TEST_CLOUDFORMATION_TEMPLATE_VAR}=${E2E_CONNECT_TEST_CLOUDFORMATION_TEMPLATE_ENCODED}"\
-X "${E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_VAR}=${E2E_EC2HELPER_TEST_CLOUDFORMATION_TEMPLATE_ENCODED}"'

E2E_TEST_PACKAGES=ez-ec2/test/e2e/...
E2E_TEST_PACKAGES=simple-ec2/test/e2e/...

GO_TEST=go test ${EMBED_TEMPLATE_FLAG} -bench=. ${MAKEFILE_PATH}
DELETE_STACK=aws cloudformation delete-stack --stack-name
Expand All @@ -64,20 +64,20 @@ unit-test:

e2e-test:
${GO_TEST}/test/e2e/... -v
${DELETE_STACK}ez-ec2-e2e-cfn-test
${DELETE_STACK}ez-ec2-e2e-connect-test
${DELETE_STACK}ez-ec2-e2e-ec2helper-test
${DELETE_STACK}simple-ec2-e2e-cfn-test
${DELETE_STACK}simple-ec2-e2e-connect-test
${DELETE_STACK}simple-ec2-e2e-ec2helper-test

e2e-cfn-test:
${GO_TEST}/test/e2e/e2e-cfn-test/... -v
${DELETE_STACK}ez-ec2-e2e-cfn-test
${DELETE_STACK}simple-ec2-e2e-cfn-test

e2e-connect-test:
${GO_TEST}/test/e2e/e2e-connect-test/... -v
${DELETE_STACK}ez-ec2-e2e-connect-test
${DELETE_STACK}simple-ec2-e2e-connect-test

e2e-ec2helper-test:
${GO_TEST}/test/e2e/e2e-ec2helper-test/... -v
${DELETE_STACK}ez-ec2-e2e-ec2helper-test
${DELETE_STACK}simple-ec2-e2e-ec2helper-test

test: unit-test e2e-test
48 changes: 24 additions & 24 deletions README.md
Expand Up @@ -41,7 +41,7 @@ In order to launch a new EC2 instance, customers need to specify a lot of option
1. Install AWS Simple EC2 CLI

```
go install ez-ec2
go install simple-ec2
```

2. Install sshpass (1.06+)
Expand All @@ -64,12 +64,12 @@ export AWS_SECRET_ACCESS_KEY="..."
**All CLI Options**

```
$ ez-ec2 launch -h
$ simple-ec2 launch -h
Launch an Amazon EC2 instance with the default configurations.
All configurations can be overridden by configurations provided by configuration files or user input
Usage:
ez-ec2 launch [flags]
simple-ec2 launch [flags]
Flags:
-a, --auto-termination-timer int The auto-termination timer for the instance in minutes
Expand All @@ -89,7 +89,7 @@ Flags:
**Single Command Launch**

```
$ ez-ec2 launch
$ simple-ec2 launch
Please confirm if you would like to launch instance with following options:
+----------------+-------------------------------------------------+
Expand All @@ -99,7 +99,7 @@ Please confirm if you would like to launch instance with following options:
| Instance Type | t2.micro |
| Image | ami-123example |
| Security Group | Default SG(sg-123example) |
| | ez-ec2 SSH Security Group(sg-123example) |
| | simple-ec2 SSH Security Group(sg-123example) |
| EBS Volumes | /dev/xvda(gp2): 8 GiB |
+----------------+-------------------------------------------------+
[ yes / no ]
Expand All @@ -112,7 +112,7 @@ Instance ID: i-123example
**Single Command Launch With Flags**

```
$ ez-ec2 launch -r us-east-2 -m ami-123example -t t2.micro -s subnet-123example -g sg-123example
$ simple-ec2 launch -r us-east-2 -m ami-123example -t t2.micro -s subnet-123example -g sg-123example
Please confirm if you would like to launch instance with following options:
+----------------+-------------------------------------------------+
Expand All @@ -121,7 +121,7 @@ Please confirm if you would like to launch instance with following options:
| Subnet | subnet-123example |
| Instance Type | t2.micro |
| Image | ami-123example |
| Security Group | ez-ec2 SSH Security(sg-123example) |
| Security Group | simple-ec2 SSH Security(sg-123example) |
| EBS Volumes | /dev/xvda(gp2): 8 GiB |
+----------------+-------------------------------------------------+
[ yes / no ]
Expand All @@ -134,7 +134,7 @@ Instance ID: i-123example
**Interactive Mode Launch**

```
$ ez-ec2 launch -i
$ simple-ec2 launch -i
Select the region you wish to launch the instance: [default: us-east-2]
+------------------+---------------------------+------------------+-------------------------+
Expand Down Expand Up @@ -211,7 +211,7 @@ What security group would you like to use?
| OPTION | SECURITY GROUP | DESCRIPTION |
+--------+-------------------------------------------------+-------------------------------------------------------+
| 1. | Default SSH SG(sg-123example) | launch-wizard-1 created 2020-06-07T19:45:39.448-04:00 |
| 2. | ez-ec2 SSH Security Group(sg-123example) | Created by ez-ec2 for SSH connection to instances |
| 2. | simple-ec2 SSH Security Group(sg-123example) | Created by simple-ec2 for SSH connection to instances |
| 3. | Default SG(sg-123example) | default VPC security group |
| 4. | Add all available security groups |
| 5. | Create a new security group that enables SSH |
Expand All @@ -237,7 +237,7 @@ Please confirm if you would like to launch instance with following options:
| 2.Subnet | My Default Subnet(subnet-123example) |
| 3.Instance Type | t2.nano |
| 4.Image | ami-123example |
| 5.Security Group | ez-ec2 SSH Security Group(sg-123example) |
| 5.Security Group | simple-ec2 SSH Security Group(sg-123example) |
| EBS Volumes | /dev/xvda(gp2): 8 GiB |
+------------------+-------------------------------------------------+
[ yes / no ]
Expand All @@ -250,19 +250,19 @@ Do you want to save the configuration above as a JSON file that can be used in n
[ yes / no ]
yes
Saving config...
Config successfully saved: /Users/$USER/.ez-ec2/ez-ec2.json
Config successfully saved: /Users/$USER/.simple-ec2/simple-ec2.json
```

### Connect

**All CLI Options**

```
$ ez-ec2 connect -h
$ simple-ec2 connect -h
Connect to an Amazon EC2 Instance, given the region and instance id
Usage:
ez-ec2 connect [flags]
simple-ec2 connect [flags]
Flags:
-h, --help help for connect
Expand All @@ -275,7 +275,7 @@ Flags:
**Single Command Connect**

```
$ ez-ec2 connect -r us-east-2 -n i-123example
$ simple-ec2 connect -r us-east-2 -n i-123example
Last login: Wed Jul 29 21:01:45 2020 from 52.95.4.1
__| __|_ )
Expand All @@ -293,7 +293,7 @@ logout
**Interactive Mode Connect**

```
$ ez-ec2 connect -i
$ simple-ec2 connect -i
Select the region you wish to launch the instance: [default: us-east-2]
+------------------+---------------------------+------------------+-------------------------+
Expand All @@ -314,9 +314,9 @@ Select the instance you want to connect to:
+--------+---------------------+-------------+------------------------+
| OPTION | INSTANCE | TAG-KEY | TAG-VALUE |
+--------+---------------------+-------------+------------------------+
| 1. | i-123example | CreatedBy | ez-ec2 |
| 1. | i-123example | CreatedBy | simple-ec2 |
| | | CreatedTime | 2020-7-29 16:38:52 EDT |
| 2. | i-123example | CreatedBy | ez-ec2 |
| 2. | i-123example | CreatedBy | simple-ec2 |
| | | CreatedTime | 2020-7-29 16:35:48 EDT |
+--------+---------------------+-------------+------------------------+
2
Expand All @@ -337,11 +337,11 @@ logout
**All CLI Options**

```
$ ez-ec2 terminate -h
$ simple-ec2 terminate -h
Terminate Amazon EC2 Instances, given the region and instance ids
Usage:
ez-ec2 terminate [flags]
simple-ec2 terminate [flags]
Flags:
-h, --help help for terminate
Expand All @@ -353,15 +353,15 @@ Flags:
**One Command Terminate**

```
$ ez-ec2 terminate -r us-east-2 -n i-123example
$ simple-ec2 terminate -r us-east-2 -n i-123example
Terminating instances
Instances [i-123example] terminated successfully
```

**Interactive Terminate**

```
$ ez-ec2 terminate -i
$ simple-ec2 terminate -i
Select the region you wish to launch the instance: [default: us-east-2]
+------------------+---------------------------+------------------+-------------------------+
Expand All @@ -382,9 +382,9 @@ Select the instance you want to terminate:
+--------+---------------------+-------------+------------------------+
| OPTION | INSTANCE | TAG-KEY | TAG-VALUE |
+--------+---------------------+-------------+------------------------+
| 1. | i-123example | CreatedBy | ez-ec2 |
| 1. | i-123example | CreatedBy | simple-ec2 |
| | | CreatedTime | 2020-7-29 16:38:52 EDT |
| 2. | i-456example | CreatedBy | ez-ec2 |
| 2. | i-456example | CreatedBy | simple-ec2 |
| | | CreatedTime | 2020-7-29 16:35:48 EDT |
+--------+---------------------+-------------+------------------------+
1
Expand All @@ -393,7 +393,7 @@ Select the instance you want to terminate:
+--------+--------------------------------+-------------+------------------------+
| OPTION | INSTANCE | TAG-KEY | TAG-VALUE |
+--------+--------------------------------+-------------+------------------------+
| 1. | i-456example | CreatedBy | ez-ec2 |
| 1. | i-456example | CreatedBy | simple-ec2 |
| | | CreatedTime | 2020-7-29 16:35:48 EDT |
| 2. | Don't add any more instance id |
+--------+--------------------------------+-------------+------------------------+
Expand Down
8 changes: 4 additions & 4 deletions cloudformation_template.json
Expand Up @@ -9,7 +9,7 @@
"Tags": [
{
"Key": "Name",
"Value": "ez-ec2 VPC"
"Value": "simple-ec2 VPC"
}
]
}
Expand All @@ -25,7 +25,7 @@
"Tags": [
{
"Key": "Name",
"Value": "ez-ec2 Subnet"
"Value": "simple-ec2 Subnet"
}
],
"VpcId": {
Expand All @@ -44,7 +44,7 @@
"Tags": [
{
"Key": "Name",
"Value": "ez-ec2 Subnet"
"Value": "simple-ec2 Subnet"
}
],
"VpcId": {
Expand All @@ -63,7 +63,7 @@
"Tags": [
{
"Key": "Name",
"Value": "ez-ec2 Subnet"
"Value": "simple-ec2 Subnet"
}
],
"VpcId": {
Expand Down
8 changes: 4 additions & 4 deletions cmd/connect.go
Expand Up @@ -17,10 +17,10 @@ import (
"fmt"
"strings"

"ez-ec2/pkg/cli"
"ez-ec2/pkg/ec2helper"
ec2ichelper "ez-ec2/pkg/ec2instanceconnecthelper"
"ez-ec2/pkg/question"
"simple-ec2/pkg/cli"
"simple-ec2/pkg/ec2helper"
ec2ichelper "simple-ec2/pkg/ec2instanceconnecthelper"
"simple-ec2/pkg/question"

"github.com/aws/aws-sdk-go/aws/session"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/flags.go
Expand Up @@ -14,7 +14,7 @@
package cmd

import (
"ez-ec2/pkg/config"
"simple-ec2/pkg/config"
)

// Used for flags
Expand Down
8 changes: 4 additions & 4 deletions cmd/launch.go
Expand Up @@ -17,10 +17,10 @@ import (
"fmt"
"strconv"

"ez-ec2/pkg/cli"
"ez-ec2/pkg/config"
"ez-ec2/pkg/ec2helper"
"ez-ec2/pkg/question"
"simple-ec2/pkg/cli"
"simple-ec2/pkg/config"
"simple-ec2/pkg/ec2helper"
"simple-ec2/pkg/question"

"github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down
8 changes: 4 additions & 4 deletions cmd/root.go
Expand Up @@ -20,12 +20,12 @@ import (
)

var rootCmd = &cobra.Command{
Use: "ez-ec2",
Short: "AWS Simple EC2 CLI (ez-ec2) is a simple tool to launch, connect and terminate Amazon EC2 instances",
Long: `AWS Simple EC2 CLI (ez-ec2) is a simple tool to launch, connect and terminate Amazon EC2 instances.
Use: "simple-ec2",
Short: "AWS Simple EC2 CLI (simple-ec2) is a simple tool to launch, connect and terminate Amazon EC2 instances",
Long: `AWS Simple EC2 CLI (simple-ec2) is a simple tool to launch, connect and terminate Amazon EC2 instances.
Users can easily launch an instance with or without custom configurations.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("This command cannot be used alone. Please refer to ez-ec2 --help for available command combinations")
fmt.Println("This command cannot be used alone. Please refer to simple-ec2 --help for available command combinations")
},
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/terminate.go
Expand Up @@ -17,9 +17,9 @@ import (
"fmt"
"strings"

"ez-ec2/pkg/cli"
"ez-ec2/pkg/ec2helper"
"ez-ec2/pkg/question"
"simple-ec2/pkg/cli"
"simple-ec2/pkg/ec2helper"
"simple-ec2/pkg/question"

"github.com/aws/aws-sdk-go/aws/session"
"github.com/spf13/cobra"
Expand Down

0 comments on commit 3fa1f54

Please sign in to comment.