Reputation: 1
Below is the elastic load balancer, taken from here:
"ElasticLoadBalancer": {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"CrossZone": "false",
"SecurityGroups": [ { "Ref": "ElbSecurityGroup" } ],
"Listeners": [
{
"LoadBalancerPort": "80",
"InstancePort": "8080",
"Protocol": "http"
}
],
"Instances": [ { "Ref": "EC2Instance"} ],
"Subnets": [ { "Ref": "SubnetId"} ]
}
}
where ELB is behaving as public facing resource for Jenkins(running in EC2).
EC2 instance running Jenkins is also sitting in public subnet.
Currently ELB is public facing to Internet.
How to make ELB privately accessible within company network only? Because ELB is generally used as public facing resource.
Upvotes: 1
Views: 2280
Reputation: 1
If the company network is outside AWS cloud besides making the load balancer private by setting up the scheme property to "internal", you will need to set up a vpn between you company network and the AWS VPC + subnetwork where the jenkins EC2 instance is located.
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-internal-load-balancers.html https://aws.amazon.com/es/vpn/
Upvotes: 0
Reputation: 8593
There should be scheme
property you should be able to set the value to internal
After that, you should be able to restrict access to the company subnets using security groups.
Reference:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-elb.html
Schema parameter The type of load balancer. Valid only for load balancers in a VPC.
If Scheme is internet-facing, the load balancer has a public DNS name that resolves to a public IP address.
If Scheme is internal, the load balancer has a public DNS name that resolves to a private IP address.
Hope you find this answer helpful.
Upvotes: 3