We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6dd6ec commit 5981725Copy full SHA for 5981725
create_ecs_cluster.py
@@ -0,0 +1,23 @@
1
+# Boto3 script for creating "n" number ECS clusters in AWS account
2
+# Script can be executed as below,
3
+# This command creates 2 ECS in default aws profile
4
+# python create_ecs.py default 2
5
+# This command creates 2 ECS keys in account2 aws profile
6
+# python create_ecs.py account2 2
7
+
8
+import boto3
9
+import random
10
+import sys
11
12
+boto3.setup_default_session(profile_name=sys.argv[1])
13
+count = int(sys.argv[2])
14
15
+for i in range(0, count):
16
+ ecs = boto3.client('ecs')
17
+ random_num = random.randint(0,2002)
18
+ ecs_data = ecs.create_cluster(
19
+ clusterName='prfecs' + str(random_num)
20
+ #,
21
+ #tags= [{ "key": "prfecskey", "value": "prfecsvalue" }]
22
+ )
23
+ print ("ECS: ", ecs_data)
0 commit comments