any way of using the nice `cloud.Service` abstract...
# general
t
any way of using the nice
cloud.Service
abstraction without spinning up a load balancer and making the service public?
c
cc @white-balloon-205
w
If you set
external: false
(which is the default) then I believe only an internal load balancer will be allocated - so the service will not be exposed publicly. We plan to move over to DNS service discovery for these not-exposed services. See https://github.com/pulumi/pulumi-cloud/issues/441.
t
reading the code I see setting
cloud-aws:usePrivateNetwork: "true"
makes a difference but seems to still create a load balancer, in the instance of fargate, it is possible to set load balancer to none
@white-balloon-205 if you look at your example https://github.com/pulumi/examples/blob/master/cloud-js-containers/index.js
external
is not set but you can access the service via the exported
hostname
I think you mean
external
on the
ContainerPort
?
as said setting
cloud-aws:usePrivateNetwork: "true"
seems to have a better result but I think its a good idea to be able to disable the load balancer and also probably some kind of control of the Service Discovery/DNS
w
100% agreed on moving over to DNS service discovery - very much want to do that soon. (It wasn't available when we initially built this, which is the only reason we went with the internal load balancer approach in the first place).
t
ha ok understood, if you look at the options in the Console there are a few options for LB and DNS so it would be good if we could have a few more parameters and a little less ‘magic’ cloud.Service would rock even more https://www.dropbox.com/s/l9x4v5voqpvxc4n/Screenshot%202018-10-17%2021.49.23.png?dl=0
@white-balloon-205 I was going to fork this and submit a PR however after spending most of the day unpicking cloud.Service I now have grey hair and conclude that its spaghetti and needs major improvement
specifically the calls into the
shared
lib for
getOrCreateNetwork
and
getCluster
and the references to external config makes it very difficult to inject into if you want to do something ‘slightly’ custom