libcluster_ec2 v0.4.1 ClusterEC2.Strategy.Tags View Source

This clustering strategy works by loading all instances that have the given tag associated with them.

All instances must be started with the same app name and have security groups configured to allow inter-node communication.

config :libcluster,
  topologies: [
    tags_example: [
      strategy: Elixir.ClusterEC2.Strategy.Tags,
      config: [
        ec2_tagname: "mytag",
        ec2_tagvalue: "tagvalue"
        app_prefix: "app"
        ip_type: :private
        polling_interval: 10_000]]]

Configuration Options

KeyRequiredDescription
:ec2_tagnameyesName of the EC2 instance tag to look for.
:ec2_tagvaluenoCan be passed a static value (string), a 0-arity function, or a 1-arity function (which will be passed the value of :ec2_tagname at invocation).
:app_prefixnoWill be prepended to the node’s private IP address to create the node name.
:ip_typenoOne of :private or :public, defaults to :private
:polling_intervalnoNumber of milliseconds to wait between polls to the EC2 api. Defaults to 5_000

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Callback implementation for Cluster.Strategy.start_link/1

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for Cluster.Strategy.start_link/1.