| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  | template = { | 
					
						
							|  |  |  |     "AWSTemplateFormatVersion": "2010-09-09", | 
					
						
							|  |  |  |     "Description": "AWS CloudFormation Sample Template to create a KMS Key.  The Fn::GetAtt is used to retrieve the ARN", | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |     "Resources": { | 
					
						
							|  |  |  |         "myKey": { | 
					
						
							|  |  |  |             "Type": "AWS::KMS::Key", | 
					
						
							|  |  |  |             "Properties": { | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |                 "Description": "Sample KmsKey", | 
					
						
							|  |  |  |                 "EnableKeyRotation": False, | 
					
						
							|  |  |  |                 "Enabled": True, | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |                 "KeyPolicy": { | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |                     "Version": "2012-10-17", | 
					
						
							|  |  |  |                     "Id": "key-default-1", | 
					
						
							|  |  |  |                     "Statement": [ | 
					
						
							|  |  |  |                         { | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |                             "Sid": "Enable IAM User Permissions", | 
					
						
							|  |  |  |                             "Effect": "Allow", | 
					
						
							|  |  |  |                             "Principal": { | 
					
						
							|  |  |  |                                 "AWS": { | 
					
						
							|  |  |  |                                     "Fn::Join": [ | 
					
						
							|  |  |  |                                         "", | 
					
						
							|  |  |  |                                         [ | 
					
						
							|  |  |  |                                             "arn:aws:iam::", | 
					
						
							|  |  |  |                                             {"Ref": "AWS::AccountId"}, | 
					
						
							|  |  |  |                                             ":root", | 
					
						
							|  |  |  |                                         ], | 
					
						
							|  |  |  |                                     ] | 
					
						
							|  |  |  |                                 } | 
					
						
							|  |  |  |                             }, | 
					
						
							|  |  |  |                             "Action": "kms:*", | 
					
						
							|  |  |  |                             "Resource": "*", | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |                         } | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |                     ], | 
					
						
							|  |  |  |                 }, | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |         } | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |     "Outputs": { | 
					
						
							|  |  |  |         "KeyArn": { | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |             "Description": "Generated Key Arn", | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |             "Value": {"Fn::GetAtt": ["myKey", "Arn"]}, | 
					
						
							| 
									
										
										
										
											2018-07-13 18:40:54 +08:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |     }, | 
					
						
							|  |  |  | } |