Explore! Customized Cloudformation Parameters of KMS and S3
Tags: aws, cloudformation, s3, kms
Published: 2022-09-14 17:31:07

“ I have checked the documents of AWS to use automated service for creation of s3 and kms. Using cloudformation it's very easy to create a bucket and a custom key. Pricing of S3 is cheaper to store the objects and Kms custom keys cost $1 per key.”

AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon EC2 instances or Amazon RDS DB instances), and CloudFormation takes care of provisioning and configuring those resources for you. You don't need to individually create and configure AWS resources and figure out what's dependent on what; CloudFormation handles that.  

In this post, you will get to know how to customize the cloudformation parameters of KMS and S3. Here I have used a cloudformation stack which creates the customized parameters for kms and s3.

#Architecture Overview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7k2kjkh3rsgnatkqm4x.png)
The architecture diagram shows the overall deployment architecture with data flow, cloudformation, amazon s3, aws kms.

#Solution overview
The blog post consists of the following phases:
1. Launch of Stack for KMS and S3
2. Output of Key and Bucket with Customized Parameters

##Phase 1: Launch of Stack for KMS and S3
1. Open the cloudformation console, create a stack for kms and s3 as template.yaml file. Kms stack creates customer managed keys with required policy. S3 stack creates buckets with its encryption using kms key and s3 managed keys. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb833lrfw9ko4iy420f0.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3r4cpwkpfjuxd2gl7y7n.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ohpy2cx55gk6km1vbwtg.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rve3yz7919u8qg1gwm0p.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0z0gvcice1kzfuc6gkpv.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4oewsvague81fmeteie2.png)

##Phase 2: Output of Key and Bucket with Customized Parameters
1. Open the s3 and kms console, check the buckets and key created. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rj3dz8o14x6a00vg1c50.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71gc7uriaxumuxjk02xx.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wcx0155jre6r6en6qsz.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f2tf7f1q2yzwrcyg6wr8.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51w0c1gw7c6gouyyfpqx.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qp42sj5oyl5mh4ahlat2.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/030363tfiru9ieyh9lqq.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/erv3r0bqjg7hr4lu8sge.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kywmdxv5d7a0r1gxc01k.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mtmpissog1366x7pvo6n.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/haa7i7ryiij5f2o2s9qp.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6qg5xahx8i4rm3a7zvf.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cw0ahph2urrfbhb3foc4.png)

#Clean-up
Delete Cloudformation stack and S3 buckets.

#Pricing
I review the pricing and estimated cost of this example. 
Cost of S3 = $0.009
Cost of Key Management Service = $1.0
Total Cost = $(1.0+0.009) = $1.009

#Summary
In this post, I showed “how to customize the cloudformation parameters of KMS and S3”.

For more details on CloudFormation, Checkout Get started CloudFormation, open the [CloudFormation console](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/). To learn more, read the [CloudFormation documentation](https://docs.aws.amazon.com/cloudformation/).

Thanks for reading!

Connect with me: [Linkedin](https://www.linkedin.com/in/gargee-bhatnagar-6b7223114)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38sdi4nsp89fnui8h7dk.png)