UNKNOWN
Project description
AWSのセキュリティグループを管理するツールです。
セキュリティグループの設定をcsvでダウンロード、コメントをつけてバージョン管理、追加したものをAPI経由で保存という使い方ができます。
## インストール
```
$ pip install sg
```
OR
```
$ python setup.py install
```
## 使い方
適切なディレクトリを作成し`init`コマンドを実行してください。
設定が保存されます。
```
$ cd yourpath
$ sgsg.py init
enter your region[us-east-1]:
us-west-2
save to sg.cfg
enter your aws_access_key_id:
xxx
enter your aws_secret_access_key:
xxx
save to aws_key
```
### リモートからローカルへの同期
以下AWS上に保存された設定を「リモート設定」、csvとして保存されている設定を「ローカル設定」と呼びます。
リモート設定を保存するには`fetch`コマンドを利用します。
```
$ sgsg.py fetch
mkdir security_groups
GROUP: group
save to security_groups/group.csv
```
ダウンロードされたcsvファイルにはコメントなどを追加することができます。エクセルなどで編集してください(文字コードはutf-8を想定しています)。
なお、新たなリモート設定が追加された場合も`fetch`で取得できます。更新時もコメントなどを消すことはありません。
### 差分の表示
ローカルとリモートの差分を表示するには`diff`コマンドを使用します。
`L:`とついているのはローカル設定だけにあるもの、`R:`とついているのはリモート設定だけにあるものです。
```
$ sgsg.py diff
GROUP: somegroup
L:tcp 22 22 192.168.11.1/32
R:tcp 22 22 0.0.0.0/32
```
### ローカルからリモートへの同期
更新を反映するには`commit`コマンドを使用します。
csvに追加、または削除を行なったあと、以下のコマンドを実行します。差分が表示されるので確認後yを選択してください。
```
sgsg.py commit security_groups/somegroup.csv
GROUP: somegroup
post this setting?[y/N]
+tcp 80 80 192.168.0.1
```
セキュリティグループの設定をcsvでダウンロード、コメントをつけてバージョン管理、追加したものをAPI経由で保存という使い方ができます。
## インストール
```
$ pip install sg
```
OR
```
$ python setup.py install
```
## 使い方
適切なディレクトリを作成し`init`コマンドを実行してください。
設定が保存されます。
```
$ cd yourpath
$ sgsg.py init
enter your region[us-east-1]:
us-west-2
save to sg.cfg
enter your aws_access_key_id:
xxx
enter your aws_secret_access_key:
xxx
save to aws_key
```
### リモートからローカルへの同期
以下AWS上に保存された設定を「リモート設定」、csvとして保存されている設定を「ローカル設定」と呼びます。
リモート設定を保存するには`fetch`コマンドを利用します。
```
$ sgsg.py fetch
mkdir security_groups
GROUP: group
save to security_groups/group.csv
```
ダウンロードされたcsvファイルにはコメントなどを追加することができます。エクセルなどで編集してください(文字コードはutf-8を想定しています)。
なお、新たなリモート設定が追加された場合も`fetch`で取得できます。更新時もコメントなどを消すことはありません。
### 差分の表示
ローカルとリモートの差分を表示するには`diff`コマンドを使用します。
`L:`とついているのはローカル設定だけにあるもの、`R:`とついているのはリモート設定だけにあるものです。
```
$ sgsg.py diff
GROUP: somegroup
L:tcp 22 22 192.168.11.1/32
R:tcp 22 22 0.0.0.0/32
```
### ローカルからリモートへの同期
更新を反映するには`commit`コマンドを使用します。
csvに追加、または削除を行なったあと、以下のコマンドを実行します。差分が表示されるので確認後yを選択してください。
```
sgsg.py commit security_groups/somegroup.csv
GROUP: somegroup
post this setting?[y/N]
+tcp 80 80 192.168.0.1
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sg-0.0.4.tar.gz
(9.1 kB
view hashes)
Built Distributions
sg-0.0.4-py2.7.egg
(24.9 kB
view hashes)
Close
Hashes for sg-0.0.4.macosx-10.10-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df546fbad699dd0c5ecf929c5273258db07e31b04c6e6b94a04b9d8821c86e7 |
|
MD5 | 6fb7a6f8f8c61b1aee9e15332c52723a |
|
BLAKE2b-256 | fa970eb28611fd5a694ca87f3feed3e047a480e1644848d558a1299222b99f8a |