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)
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
In order to get Terraform state output you would have to execute such command:
terraform state pull > status.json
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.