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 2601b63 commit d6dd6ecCopy full SHA for d6dd6ec
create_kms_keys.py
@@ -0,0 +1,24 @@
1
+# Boto3 script for creating "n" number KMS keys in AWS account
2
+# Script can be executed as below,
3
+# This command creates 2 KMS keys in default aws profile
4
+# python create_kms.py default 2
5
+# This command creates 2 KMS keys in account2 aws profile
6
+# python create_kms.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
+ kms = boto3.client('kms')
17
+ kms_data = kms.create_key( Origin='AWS_KMS',
18
+ Tags=[
19
+ {
20
+ 'TagKey': 'SampleKmsKey',
21
+ 'TagValue': 'SampleKmsKeyValue'
22
+ } ]
23
+ )
24
+ print ("S3 Bucket: ", kms_data)
0 commit comments