Maekawa is a cli client for AWS CloudWatch Events has idempotence.
Japanese version is under the English version. (日本語のREADMEが英語の下にあります)
Download latest binary for your archtecture from releaase page.
https://github.com/unasuke/maekawa/releases
And put that in your $PATH directory.
Or, run this.
$ go get github.com/unasuke/maekawaIf you using macOS and homebrew, you can install maekawa this command.
$ brew install unasuke/maekawa/maekawa- Installing the AWS Command Line Interface - AWS Command Line Interface
- Configuring the AWS Command Line Interface - AWS Command Line Interface
rules:
-
description: Execute every 5 minutes
event_pattern:
name: EveryFiveMinutes
role_arn:
schedule_expression: "cron(0/5 * * * ? *)"
state: ENABLED
targets:
-
arn: arn:aws:lambda:ap-northeast-1:000000000000:function:some-lambda-function
id: 05c99eea-4059-4294-8583-bb2d00df4226
input:
input_path:
-
name: TestEvent
schedule_expression: "rate(2 day)"
state: ENABLED
targets:
-
arn: arn:aws:lambda:ap-northeast-1:000000000000:function:another-lambda-function
id: 4c4d91c5-5f8b-4d5f-b28f-3fac49c835ad
input: |
{ "input": "json input" }
input_path:
-
arn: arn:aws:lambda:ap-northeast-1:00000000000:function:another-lambda-function
id: 3bde837b-3093-487c-9328-a677e05ae75d
input: |
{ "input": "some input" }
input_path:More example's in sample.yml.
$ maekawa --region=ap-northeast-1 --apply --dry-run # check what will changes
$ maekawa --region=ap-northeast-1 --apply # apply config.ymlSpecify aws region.
If set env AWS_REGION, use this. But, --region option is override env.
Specify aws profile.
If set env AWS_PROFILE, use this. But, --profile option is override env.
Apply your config to AWS CloudWatch Events.
Show what will changes without apply.
Specify config file path. (default config.yml)
Show options.
This software is licensed under the MIT License. Please see the LICENSE.txt file for details.
The aws-sdk-go is distributed under the Apache License 2.0.
https://github.com/aws/aws-sdk-go
The yaml package is distributed under the Apache License 2.0.
https://github.com/go-yaml/yaml
maekawaは冪等性を持つAWS CloudWatch Eventsのcli clientです。
最新版リリースの、適したアーキテクチャ向けのバイナリをreleaseページからダウンロードしてください。
https://github.com/unasuke/maekawa/releases
その後、ダウンロードしたバイナリを$PATHの通っている場所に置いてください。
もしくは、以下のコマンドを実行してください。
$ go get github.com/unasuke/maekawaもしmacOSとhomebrewを使用している場合、次のコマンドでもインストールできます。
$ brew install unasuke/maekawa/maekawa- Installing the AWS Command Line Interface - AWS Command Line Interface
- Configuring the AWS Command Line Interface - AWS Command Line Interface
rules:
-
description: Execute every 5 minutes
event_pattern:
name: EveryFiveMinutes
role_arn:
schedule_expression: "cron(0/5 * * * ? *)"
state: ENABLED
targets:
-
arn: arn:aws:lambda:ap-northeast-1:000000000000:function:some-lambda-function
id: 05c99eea-4059-4294-8583-bb2d00df4226
input:
input_path:
-
name: TestEvent
schedule_expression: "rate(2 day)"
state: ENABLED
targets:
-
arn: arn:aws:lambda:ap-northeast-1:000000000000:function:another-lambda-function
id: 4c4d91c5-5f8b-4d5f-b28f-3fac49c835ad
input: |
{ "input": "json input" }
input_path:
-
arn: arn:aws:lambda:ap-northeast-1:00000000000:function:another-lambda-function
id: 3bde837b-3093-487c-9328-a677e05ae75d
input: |
{ "input": "some input" }
input_path:sample.ymlに他の例があります。
$ maekawa --region=ap-northeast-1 --apply --dry-run # 変更部分の確認
$ maekawa --region=ap-northeast-1 --apply # config.ymlの内容を適用AWS regionを指定します。
環境変数にAWS_REGIONが存在する場合それを使用しますが、--regionが指定された場合はそちらで上書きます。
AWS profileを指定します。
環境変数にAWS_PROFILEが存在する場合それを使用しますが、--profileが指定された場合はそちらで上書きます。
configに記述された内容をAWS CloudWatch Eventsに適用します。
適用をせずに、何が変更されるかを確認します。
configファイルのpathを指定します。 (デフォルトは config.ymlです)
オプションの一覧を表示します。