class GeoEngineer::Resources::AwsRouteTableAssociation

AwsRouteTableAssociation is the aws_route_table_association terrform resource,

{www.terraform.io/docs/providers/aws/r/route_table_association.html Terraform Docs}

Public Class Methods

_fetch_remote_resources(provider) click to toggle source
# File lib/geoengineer/resources/aws_route_table_association.rb, line 25
def self._fetch_remote_resources(provider)
  AwsClients
    .ec2(provider)
    .describe_route_tables['route_tables']
    .map(&:to_h)
    .map { |route_table| route_table[:associations] }
    .flatten
    .compact
    .reject { |association| association[:main] }
    .map { |association| _merge_ids(association) }
end
_merge_ids(association) click to toggle source
# File lib/geoengineer/resources/aws_route_table_association.rb, line 37
def self._merge_ids(association)
  association.merge(
    {
      _terraform_id: association[:route_table_association_id],
      _geo_id: "#{association[:subnet_id]}::#{association[:route_table_id]}"
    }
  )
end

Public Instance Methods

support_tags?() click to toggle source
# File lib/geoengineer/resources/aws_route_table_association.rb, line 21
def support_tags?
  false
end
to_terraform_state() click to toggle source
# File lib/geoengineer/resources/aws_route_table_association.rb, line 12
def to_terraform_state
  tfstate = super
  tfstate[:primary][:attributes] = {
    'subnet_id' => subnet_id,
    'route_table_id' => route_table_id
  }
  tfstate
end