Class: Cumulus::VPC::AclEntryDiff

Inherits:
Common::Diff show all
Includes:
AclEntryChange
Defined in:
lib/vpc/models/AclEntryDiff.rb

Overview

Public: Represents a single difference between local configuration and AWS configuration

Constant Summary

Constants included from AclEntryChange

Cumulus::VPC::AclEntryChange::ACTION, Cumulus::VPC::AclEntryChange::CIDR, Cumulus::VPC::AclEntryChange::ICMP_CODE, Cumulus::VPC::AclEntryChange::ICMP_TYPE, Cumulus::VPC::AclEntryChange::PORTS, Cumulus::VPC::AclEntryChange::PROTOCOL

Constants included from Common::DiffChange

Common::DiffChange::ADD, Common::DiffChange::MODIFIED, Common::DiffChange::UNMANAGED

Instance Attribute Summary

Attributes inherited from Common::Diff

#aws, #changes, #info_only, #local, #type

Instance Method Summary collapse

Methods included from Common::DiffChange

next_change_id

Methods inherited from Common::Diff

#add_string, added, #initialize, #local_name, modified, #to_s, unmanaged, #unmanaged_string

Constructor Details

This class inherits a constructor from Cumulus::Common::Diff

Instance Method Details

#asset_typeObject



22
23
24
# File 'lib/vpc/models/AclEntryDiff.rb', line 22

def asset_type
  "Network Acl Entry"
end

#aws_nameObject



26
27
28
# File 'lib/vpc/models/AclEntryDiff.rb', line 26

def aws_name
  @aws.rule_number
end

#diff_stringObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/vpc/models/AclEntryDiff.rb', line 30

def diff_string
  resource = case @type
  when PROTOCOL
    "Protocol"
  when ACTION
    "Action"
  when CIDR
    "CIDR Block"
  when PORTS
    "Ports"
  when ICMP_TYPE
    "ICMP Type"
  when ICMP_CODE
    "ICMP Code"
  end

  [
    "#{resource}:",
    Colors.aws_changes("\tAWS - #{aws}"),
    Colors.local_changes("\tLocal - #{local}"),
  ].join("\n")
end