Skip to content

envssm is a Terraform file generator for AWS SSM written in Go.

License

Notifications You must be signed in to change notification settings

tetsuzawa/envssm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envssm

envssm is a Terraform file generator for AWS SSM written in Go.

Installation

go get github.com/tetsuzawa/envssm

Example

1. Prepare .env file

$ tree -a
.
└── .env
DB_USER=user
DB_PASSWORD=password

2. Run envssm

$ envssm

3. Check the output file

$ tree -a
.
├── .env
├── ssm.tf              # generated
├── terraform.tfvars    # generated
└── variable.tf         # generated
# ssm.tf

resource "aws_ssm_parameter" "db_user" {
  name        = "DB_USER"
  type        = "SecureString"
  value       = "var.db_user"
}

resource "aws_ssm_parameter" "db_password" {
  name        = "DB_PASSWORD"
  type        = "SecureString"
  value       = "var.db_password"
}
# variables.tf

variable "db_user" {
  type        = string
}

variable "db_password" {
  type        = string
}
# terraform.tfvars

db_user     = "user"
db_password = "password"

Options

  • -f: path of environment variables file
  • -d: generate place holders (eg. description = "")
  • -so: path of output SSM terraform file
  • -vo: path of output variables terraform file
  • -to: path of output tfvars terraform file

About

envssm is a Terraform file generator for AWS SSM written in Go.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published