updates aws profile init to use inputs instead of attributes

Signed-off-by: Collin McNeese <cmcneese@chef.io>
This commit is contained in:
Collin McNeese 2021-03-17 09:19:11 -05:00
parent 2f4dc632a1
commit 9da7a7338d
No known key found for this signature in database
GPG key ID: 9FA182748DD18914
3 changed files with 5 additions and 8 deletions

View file

@ -1,2 +0,0 @@
# Below is to be uncommented and set with your AWS Custom VPC ID:
# aws_vpc_id: 'vpc-xxxxxxx'

View file

@ -2,11 +2,11 @@
title "Sample Section"
aws_vpc_id = attribute("aws_vpc_id", default: "", description: "Optional AWS VPC identifier.")
aws_vpc_id = input("aws_vpc_id")
# You add controls here
control "aws-single-vpc-exists-check" do # A unique ID for this control.
only_if { aws_vpc_id != "" } # Only run this control if the `aws_vpc_id` attribute is provided.
control "aws-single-vpc-exists-check" do # A unique ID for this control.
only_if { aws_vpc_id != "" } # Only run this control if the `aws_vpc_id` input is provided.
impact 1.0 # The criticality, if this control fails.
title "Check to see if custom VPC exists." # A human-readable title.
describe aws_vpc(aws_vpc_id) do # The test itself.

View file

@ -7,14 +7,13 @@ license: Apache-2.0
summary: An InSpec Compliance Profile For AWS
version: 0.1.0
inspec_version: '~> 4'
attributes:
inputs:
- name: aws_vpc_id
required: false
# Below is deliberately left as a default empty string to allow the profile to run when this is not provided.
# Please see the README for more details.
default: ''
value: ''
description: 'Optional Custom AWS VPC Id'
type: string
depends:
- name: inspec-aws
url: https://github.com/inspec/inspec-aws/archive/master.tar.gz