Skip to content

Generates AWSpec tests from Terraform status output

Notifications You must be signed in to change notification settings

sarunask/awspec-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

awspec-generator

Version: 0.1.0

Aim of this project to build a tool, which would be able to take Terraform state JSON and output AWSpec infrastructure tests. For now I have implemented such test resources:

  • VPC
  • Subnet
  • Security Group
  • VPN Gateway
  • VPN Connection
  • Customer Gateway
  • ELB
  • ASG
  • RDS Instance
  • IAM Policies
  • IAM Roles
  • EC2 instances
  • Route53 records (per zone testing)

Install program

In order to install program, you would need to Install GO language and setup it as described here. After you install GO, you could do from CLI:

go get -u github.com/sarunask/awspec-generator

If you added GOPATH/bin directory to you PATH, you would be able to run:

awspec-generator --help

Get Terraform state

In order to get Terraform state output you would have to execute such command:

terraform state pull > status.json

Run program

After you got Terraform state, you are ready to create AWSpec SPEC files:

awspec-generator -json_file status.json

If generation was successful, you would see ./spec directory with several files. Now you can install AWSpec, move generated .rb files and ./addons/ec2_helper.rb into you own spec directory and run tests.

NOTE: I strongly suggest to use RVM to install Ruby 2.4 and create gemset for your AWSpec installation.

About

Generates AWSpec tests from Terraform status output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages