class GeoEngineer::Resources::AwsElasticacheReplicationGroup

AwsElasticacheReplicationGroup is the aws_elasticache_replication_group terrform resource,

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

Public Class Methods

_fetch_remote_resources(provider) click to toggle source
# File lib/geoengineer/resources/aws_elasticache_replication_group.rb, line 36
def self._fetch_remote_resources(provider)
  ec = AwsClients.elasticache(provider)
  ec.describe_replication_groups['replication_groups'].map(&:to_h).map do |rg|
    rg[:_terraform_id] = rg[:replication_group_id]
    rg[:_geo_id] = rg[:replication_group_id]
    rg
  end
end

Public Instance Methods

to_terraform_state() click to toggle source
# File lib/geoengineer/resources/aws_elasticache_replication_group.rb, line 21
def to_terraform_state
  tfstate = super

  attributes = {}

  # Workaround for availability zones
  availability_zones.each_with_index do |az, i|
    attributes["availability_zones.#{i}"] = az
  end
  attributes['availability_zones.#'] = availability_zones.count.to_s

  tfstate[:primary][:attributes] = attributes
  tfstate
end