Class: AwsFlowLog

Inherits:
Object
  • Object
show all
Includes:
AwsSingularResourceMixin
Defined in:
lib/resources/aws/aws_flow_log.rb

Defined Under Namespace

Classes: Backend

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AwsSingularResourceMixin

#exists?, included

Methods included from AwsResourceMixin

#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner

Instance Attribute Details

#flow_log_idObject (readonly)

Returns the value of attribute flow_log_id.



40
41
42
# File 'lib/resources/aws/aws_flow_log.rb', line 40

def flow_log_id
  @flow_log_id
end

#log_group_nameObject (readonly)

Returns the value of attribute log_group_name.



40
41
42
# File 'lib/resources/aws/aws_flow_log.rb', line 40

def log_group_name
  @log_group_name
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



40
41
42
# File 'lib/resources/aws/aws_flow_log.rb', line 40

def resource_id
  @resource_id
end

Instance Method Details

#attached_to_eni?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/resources/aws/aws_flow_log.rb', line 28

def attached_to_eni?
  resource_type.eql?('eni') ? true : false
end

#attached_to_subnet?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/resources/aws/aws_flow_log.rb', line 32

def attached_to_subnet?
  resource_type.eql?('subnet') ? true : false
end

#attached_to_vpc?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/resources/aws/aws_flow_log.rb', line 36

def attached_to_vpc?
  resource_type.eql?('vpc') ? true : false
end

#resource_typeObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/resources/aws/aws_flow_log.rb', line 17

def resource_type
  case @resource_id
  when /^eni/
    @resource_type = 'eni'
  when /^subnet/
    @resource_type = 'subnet'
  when /^vpc/
    @resource_type = 'vpc'
  end
end

#to_sObject



13
14
15
# File 'lib/resources/aws/aws_flow_log.rb', line 13

def to_s
  "AWS Flow Log #{id}"
end