Cake Build addin for configuring Amazon Elastic Load Balancers
- Register Instances
- Deregister Instances
- Uses AWS fallback credentials (app.config / web.config file, SDK store or credentials file, environment variables, instance profile)
Cake.AWS.ElasticLoadBalancing is available as a nuget package from the package manager console:
Install-Package Cake.AWS.ElasticLoadBalancing
or directly in your build script via a cake addin directive:
#addin "Cake.AWS.ElasticLoadBalancing"
#addin "Cake.AWS.ElasticLoadBalancing"
LoadBalancingSettings settings = Context.CreateLoadBalancingSettings();
Task("Register-Instances")
.Description("Adds new instances to the load balancer.")
.Does(async () =>
{
await RegisterLoadBalancerInstances("LoadBlanerName", "instance1,instance2,instance3", settings);
});
Task("Deregister-Instances")
.Description("Deregisters instances from the load balancer.")
.Does(async () =>
{
await DeregisterLoadBalancerInstances("LoadBlanerName", "instance1,instance2,instance3", settings);
});
Task("Deregister-Instances-Fallback")
.Description("Deregisters instances from the load balancer, using AWS Fallback credentials")
.Does(async () =>
{
await DeregisterLoadBalancerInstances("LoadBlanerName", "instance1,instance2,instance3", Context.CreateLoadBalancingSettings());
});
RunTarget("Register-Instances");
A complete Cake example can be found here.
- Please be aware of the breaking changes that occurred with the release of Cake v0.22.0, you will need to upgrade Cake in order to use Cake.AWS.ElasticLoadBalancing v0.2.0 or above.
If your routing traffic to EC2 instances its worth checking out Cake.AWS.EC2 or if your using Route53 as your DNS server check out Cake.AWS.Route53.
If your looking for a way to trigger cake tasks based on windows events or at scheduled intervals then check out CakeBoss.
Copyright (c) 2015 - 2016 Phillip Sharpe
Cake.AWS.ElasticLoadBalancing is provided as-is under the MIT license. For more information see LICENSE.
If this project helps you in anyway then please ⭐ the repository.