質問編集履歴

1

追記

2018/06/05 07:38

投稿

aizawal-hiroki
aizawal-hiroki

スコア56

test CHANGED
File without changes
test CHANGED
@@ -23,3 +23,41 @@
23
23
 
24
24
 
25
25
  ssmで操作すればいいのか、他にいい方法があるのかご教授よろしくお願いします。
26
+
27
+
28
+
29
+ ***追記***
30
+
31
+ 色々調べた結果ssmのコマンド実行で、AWS-RunShellScriptで任意のコマンドが実行できるそうで色々調べたのですがどのようなコマンドで処理できるかいまいち理解できません
32
+
33
+
34
+
35
+ ```ここに言語を入力
36
+
37
+ def command(instance, commands):
38
+
39
+ ssm = boto3.client('ssm')
40
+
41
+ r = ssm.send_command(
42
+
43
+ InstanceIds = [instance.instance_id,
44
+
45
+ instance.instance_id2
46
+
47
+ ],
48
+
49
+ DocumentName = "AWS-RunShellScript",
50
+
51
+ Parameters = {
52
+
53
+ "commands": commands
54
+
55
+ }
56
+
57
+
58
+
59
+ ```
60
+
61
+ 上のようなものでどのインスタンスにどのドキュメントを付与するかというのは分かったのですがどうすれば二つあるインスタンスのcronの内どちらか一方にするというコマンドがわかりません。
62
+
63
+ ご協力お願いします