An article was published in AWS Blog to introduce the solution in detail.
Both provisioning and testing would require that the default AWS region and profile be set beforehand.
Use export
to set those environmental variables.
export AWS_DEFAULT_REGION=cn-north-1
export AWS_PROFILE=
To provision the example resources, run the following:
cd main/terraform
terraform init
terraform apply -auto-approve
To release the resources, run:
terraform destroy -auto-approve
The following commands test that the resources are provisioned as expected with supported INSPEC commands as defined in the profile
folder.
Make sure that the check
command outptus no errors before running the exec
command.
cd test/inspec
inspec vendor profile
inspec check profile
inspec exec profile --target=aws:// --input-file=input.yaml
The following command tests unsupported resources via bash scripts, which delegate to AWS CLI invocation to retrieve the information.
cd test/inspec
inspec vendor extension
inspec check extension
inspec exec extension --input-file=input.yaml
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.