For a highly available infrastructure, in most modern production environments, load balancers are one of the most important components. In this recipe, we will learn how to configure AWS elastic load balancers using Salt modules.
Create and edit
/opt/ salt-cookbook/production/aws/elb.sls
to have the following entries:salt-cookbook: boto_elb.present: - region: us-west-2 - availability_zones: - us-west-2a - us-west-2c - keyid: <access-key> - key: '<secret-key>' - listeners: - elb_port: 80 instance_port: 80 elb_protocol: HTTP - attributes: cross_zone_load_balancing: enabled: true - health_check: target: 'HTTP:80/' - cnames: - name: lb1.salt-cookbook.com. zone: salt-cookbook.com. ttl: 60
Apply the state to the Salt master by running...