Automating Kubernetes secrets creation using AWS SSM and Terraform

AWS EKS: Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS and on-premises.

AWS Parameter store: Parameter Store is an AWS service that stores strings. It can store secret data and non-secret data alike. Secrets stored in Parameter Store are secure strings, encrypted with a customer-specific AWS KMS key.

Terraform: Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.

Automation steps:

  1. Create a secret on AWS Parameter store from the AWS console.

or you can also create a secret using terraform random_password resource and store it in SSM parameter, and create a terraform datasource.

2. In terraform file add entry to call Kubernetes provider and add the EKS context in config_context

3. Create secret using kubernetes_secret resource provided by terraform Kubernetes provider like here, and call the datasource which was created in step 1.

That’s it, in 3 easy steps one can automate the process of creating K8s secrets.




Cloud and DevOps Specialist

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

TIL @ AWS Builders’ Day London 2019

Useful Resources to know more about Agile, Scrum and the World …

Implementing CQRS with core. Part 3

READ/DOWNLOAD*$ Database Administration: The Compl

Communities for Coders & Developers

Deploying Docker application in minutes

#build #metaverse #equivalent #location

March 2021 Roadmap Update, Part 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
pavan kumar ceemala

pavan kumar ceemala

Cloud and DevOps Specialist

More from Medium

Updating Terraform Cloud State with existing resources

How to: Terraform Locking State in S3

IaC using Terraform - CLI Basics

How-to setup a HA/DR database in AWS? [7 — Dynamic Terraform backend definition]