View Source ClusterEC2.Strategy.Tags (libcluster_ec2 v0.8.1)

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_to_nodename: &my_nodename_func/2,
        ip_type: :private,
        polling_interval: 10_000]]],
        show_debug: false

configuration-options

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
:ip_to_nodenamenodefaults to app_prefix@ip but can be used to override the nodename
:polling_intervalnoNumber of milliseconds to wait between polls to the EC2 api. Defaults to 5_000
:show_debugnoTrue or false, whether or not to show the debug log. Defaults to true

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.