Add a provider implementation for EC2 to support port exposing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyjuju |
Fix Released
|
Medium
|
Jim Baker |
Bug Description
Prior to the launch of a new machine instance, a unique EC2 security
group is added. The machine instance is then assigned to this group at
launch. Likewise, terminating the machine will result in the EC2 provider
deleting the security group for the machine.
Given this model of a security group per machine, with one service
unit per machine, exposing and unexposing ports for a service unit
corresponds to EC2's support for authorization and revocation of ports
per security group. In particular, EC2 supports a source address of
``0.0.0.0/0`` that corresponds to exposing the port to the world.
To make this concrete, consider the example of exposing the
``my-wordpress`` service. Once the command ``open-port 80`` has been
run on a given service unit of ``my-wordpress``, then for the
corresponding machine instance, the equivalent of this EC2 command is
run::
ec2-authorize $MACHINE_
Any additional service units of ``my-wordpress``, if they run
``open-port 80``, will likewise invoke the equivalent of the above
command, for the corresponding machine security groups.
If ``my-wordpress`` is unexposed, a ``my-wordpress`` service unit is
removed, the ``my-wordpress`` service is destroyed, or the
``close-port`` command is run for a service unit, then the equivalent
of the following EC2 command is run, for all applicable machines::
ec2-revoke $MACHINE_
Although this section showed the equivalent EC2 commands for
simplicity, txaws will be used for the actual implementation.
Related branches
- Gustavo Niemeyer: Approve
- William Reade (community): Approve
-
Diff: 1247 lines (+566/-203)23 files modifiedensemble/agents/provision.py (+8/-5)
ensemble/agents/tests/test_provision.py (+1/-1)
ensemble/agents/tests/test_unit.py (+1/-2)
ensemble/agents/unit.py (+2/-1)
ensemble/machine/__init__.py (+7/-6)
ensemble/machine/tests/test_machine.py (+0/-2)
ensemble/providers/common/launch.py (+22/-15)
ensemble/providers/common/tests/test_launch.py (+2/-3)
ensemble/providers/dummy.py (+3/-3)
ensemble/providers/ec2/__init__.py (+14/-0)
ensemble/providers/ec2/accessor.py (+19/-14)
ensemble/providers/ec2/launch.py (+70/-78)
ensemble/providers/ec2/securitygroup.py (+90/-0)
ensemble/providers/ec2/tests/common.py (+42/-29)
ensemble/providers/ec2/tests/test_accessor.py (+24/-2)
ensemble/providers/ec2/tests/test_bootstrap.py (+12/-6)
ensemble/providers/ec2/tests/test_files.py (+1/-1)
ensemble/providers/ec2/tests/test_launch.py (+106/-25)
ensemble/providers/ec2/tests/test_securitygroup.py (+129/-0)
ensemble/providers/orchestra/launch.py (+1/-1)
ensemble/providers/orchestra/tests/common.py (+0/-1)
ensemble/providers/tests/test_dummy.py (+9/-8)
examples/wordpress/hooks/db-relation-changed (+3/-0)
Changed in ensemble: | |
importance: | Undecided → Medium |
assignee: | nobody → Jim Baker (jimbaker) |
milestone: | none → budapest |
Changed in ensemble: | |
milestone: | budapest → dublin |
Changed in ensemble: | |
status: | New → In Progress |
Changed in ensemble: | |
status: | In Progress → Fix Released |