Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
taku-k committed Dec 22, 2016
1 parent 4125a0c commit cce4ad6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
26 changes: 24 additions & 2 deletions README.md
@@ -1,11 +1,33 @@
# swiro

swiro is a switching route tool for AWS to realize VIP (Virtual IP) with Routing-Based High Availability pattern.
It is possible to perform failover (switching of the connection destination) of the EC2 redundant across the subnet (AZ).


## Description

## Usage

* Switching routes

```
$ swiro switch rtb-xxxxxx 10.0.0.1 -I i-xxxxxx
```


## Example

```
$ swiro switch rtb-xxxxxx 10.0.0.1 -I i-xxxxxx
Switch the route below setting:
============================================
Route Table: route_table_name (rtb-xxxxxx)
Virtual IP: 10.0.0.1 -------- Src: src_instance_name (i-xxxxxx)
\\
======> Dest: dest_instance_name (i-xxxxxx)
============================================
Are you sure? (y/n) [y]: y
Success!!
```

## Install

To install, use `go get`:
Expand Down
3 changes: 3 additions & 0 deletions aws/route_table.go
Expand Up @@ -62,6 +62,9 @@ func (t *RouteTable) ReplaceRoute(vip, instance string) error {
if err = t.cli.replaceRoute(ctx, routeTableId, destinationCidrBlock, instanceId); err != nil {
return err
}

// TODO: check whether the route has actually replaced

return nil
}

Expand Down
1 change: 1 addition & 0 deletions command/switch.go
Expand Up @@ -56,6 +56,7 @@ Are you sure?`
if err != nil {
return err
}
fmt.Fprintln(os.Stdout, "Success!!")

return nil
}

0 comments on commit cce4ad6

Please sign in to comment.