Class: AwsSubnets

Inherits:
Object
  • Object
show all
Includes:
AwsPluralResourceMixin
Defined in:
lib/resources/aws/aws_subnets.rb

Defined Under Namespace

Classes: Backend

Instance Attribute Summary

Attributes included from AwsPluralResourceMixin

#table

Instance Method Summary collapse

Methods included from AwsPluralResourceMixin

included

Methods included from AwsResourceMixin

#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner

Instance Method Details

#fetch_from_apiObject



23
24
25
26
# File 'lib/resources/aws/aws_subnets.rb', line 23

def fetch_from_api
  backend = BackendFactory.create(inspec_runner)
  @table = backend.describe_subnets.subnets.map(&:to_h)
end

#to_sObject



37
38
39
# File 'lib/resources/aws/aws_subnets.rb', line 37

def to_s
  'EC2 VPC Subnets'
end

#validate_params(resource_params) ⇒ Object



16
17
18
19
20
21
# File 'lib/resources/aws/aws_subnets.rb', line 16

def validate_params(resource_params)
  unless resource_params.empty?
    raise ArgumentError, 'aws_vpc_subnets does not accept resource parameters.'
  end
  resource_params
end