alert-midnight-11504
10/25/2023, 3:17 PMgoogle
to manage our base / global infrastructure and is deployed before our other service
stacks.
The backend service depends on a the NEG being defined (even though its optional) when the backend is being created. The NEG urls are dynamic and not static (Cloud Run Service URL).
I am not sure how I am suppose to have 1 backend for many services, especially if each service is created in parallel. If I create all the services before creating the backend service (load balancer) that means I would have to tear down the entire backend every time a service changes which is not ideal. Thoughts?
IE trying to do something like this…
BackendService.get(`${namespace}-url-map`, globalExternalLoadBalancer.backendSelfLink, {}, { transformations: [(args) => {
return {
...args,
props: {
...args.props,
backends: (args.props.backends || []).push({
group: neg.selfLink
})
}
}
}]});
dry-keyboard-94795
10/25/2023, 4:15 PMalert-midnight-11504
10/25/2023, 4:26 PMdry-keyboard-94795
10/25/2023, 4:27 PMalert-midnight-11504
10/25/2023, 4:29 PMdry-keyboard-94795
10/25/2023, 4:35 PMfreezing-garage-4831
10/25/2023, 4:37 PMalert-midnight-11504
10/25/2023, 4:37 PMdry-keyboard-94795
10/25/2023, 4:38 PMfreezing-garage-4831
10/25/2023, 4:43 PMalert-midnight-11504
10/25/2023, 4:48 PMconst backendService = new BackendService('google-backend-service', {
project,
loadBalancingScheme: 'EXTERNAL',
name: 'google-backend-service',
description: 'Backend service for custom domain API Gateway load balancers',
logConfig: { enable: true },
backends: [{
group: neg.selfLink
}]
}, { parent: neg, deleteBeforeReplace: true, replaceOnChanges: ['*'] });
dry-keyboard-94795
10/25/2023, 5:01 PMalert-midnight-11504
10/25/2023, 5:10 PMdry-keyboard-94795
10/25/2023, 5:13 PMstocky-restaurant-98004
10/25/2023, 5:14 PMalert-midnight-11504
10/25/2023, 5:14 PMstocky-restaurant-98004
10/25/2023, 5:14 PMalert-midnight-11504
10/25/2023, 5:15 PMdry-keyboard-94795
10/25/2023, 5:16 PMalert-midnight-11504
10/25/2023, 5:17 PMdry-keyboard-94795
10/25/2023, 5:17 PMalert-midnight-11504
10/25/2023, 5:17 PMdry-keyboard-94795
10/25/2023, 5:17 PMlocal.Command
alert-midnight-11504
10/25/2023, 5:18 PMlocal.command
i can try and look this up real quickstocky-restaurant-98004
10/25/2023, 5:19 PMgcloud
with the Pulumi Command provider to do some of the stuff in Tim's repo because it's not supported in the provider.dry-keyboard-94795
10/25/2023, 5:19 PMbut not sure how to run gcloud commands safely during CI/CD dep;loyment with pulumithis depends on how you have auth setup. A default setup where you've setup the application-default credentials should work, but gets a little more involved if you're using assumed roles
stocky-restaurant-98004
10/25/2023, 5:19 PMcommand.local.Command
in Pulumi often serves a similar purpose to null_provider
with a provisioner or whatever it's called.alert-midnight-11504
10/25/2023, 5:20 PMstocky-restaurant-98004
10/25/2023, 5:20 PMcommand.local.Command
to use the cloud provider's CLI is not uncommon. I've had to do it with all of the hyperscalers at one point or another.alert-midnight-11504
10/25/2023, 5:21 PMdry-keyboard-94795
10/25/2023, 5:21 PMalert-midnight-11504
10/25/2023, 5:22 PMdry-keyboard-94795
10/25/2023, 5:24 PMalert-midnight-11504
10/25/2023, 5:24 PMdry-keyboard-94795
10/25/2023, 5:27 PMalert-midnight-11504
10/25/2023, 5:27 PMfreezing-garage-4831
10/25/2023, 5:27 PMalert-midnight-11504
10/25/2023, 5:29 PMdry-keyboard-94795
10/25/2023, 5:30 PMalert-midnight-11504
10/25/2023, 5:30 PMdry-keyboard-94795
10/25/2023, 5:31 PMalert-midnight-11504
10/25/2023, 5:31 PMdry-keyboard-94795
10/25/2023, 5:36 PMalert-midnight-11504
10/25/2023, 5:38 PMfreezing-garage-4831
10/25/2023, 5:39 PMdry-keyboard-94795
10/25/2023, 5:44 PMadd-path-matcher
requires distinct hostnames.
If all services are made in the same stack, this isn't a problem as the path matching rules can be combinedalert-midnight-11504
10/25/2023, 6:30 PM/webhooks/Authorization
on service A, and the other goes to /provider/Authorization
on service Bdry-keyboard-94795
10/25/2023, 6:33 PMalert-midnight-11504
10/25/2023, 6:34 PMdry-keyboard-94795
10/25/2023, 6:34 PMalert-midnight-11504
10/25/2023, 6:34 PMsignature
header. Thats how we want to split the traffic using route rulesdry-keyboard-94795
10/25/2023, 6:47 PMalert-midnight-11504
10/25/2023, 7:00 PMdry-keyboard-94795
10/25/2023, 7:01 PMalert-midnight-11504
10/25/2023, 7:02 PMdry-keyboard-94795
10/25/2023, 7:04 PMalert-midnight-11504
10/25/2023, 7:05 PMdry-keyboard-94795
10/25/2023, 7:09 PMalert-midnight-11504
10/25/2023, 7:10 PMdry-keyboard-94795
10/25/2023, 7:10 PMalert-midnight-11504
10/25/2023, 7:11 PMdry-keyboard-94795
10/25/2023, 7:11 PMalert-midnight-11504
10/25/2023, 7:12 PMdry-keyboard-94795
10/25/2023, 7:12 PMalert-midnight-11504
10/25/2023, 7:13 PMdry-keyboard-94795
10/25/2023, 7:13 PMalert-midnight-11504
10/25/2023, 7:14 PMdry-keyboard-94795
10/25/2023, 7:16 PMalert-midnight-11504
10/25/2023, 7:17 PMUrlMap.get()
in the service stack to get a reference from base Google stack and use a transformation
?dry-keyboard-94795
10/25/2023, 7:17 PMalert-midnight-11504
10/25/2023, 7:18 PMstocky-restaurant-98004
10/25/2023, 7:32 PMalert-midnight-11504
10/25/2023, 7:37 PMdry-keyboard-94795
10/25/2023, 7:38 PMalert-midnight-11504
10/25/2023, 7:39 PMdry-keyboard-94795
10/25/2023, 7:39 PMalert-midnight-11504
10/25/2023, 7:40 PMconst servicesStack = new pulumi.StackReference(`${org}/gcp-lb-multistack-services/dev`);
// These could be sourced from multiple stacks
const s1BackendServiceId = servicesStack.requireOutput("be1Id");
const s2BackendServiceId = servicesStack.requireOutput("be2Id");
IE the services have not been created yet. they are created once the Google stack has been deployed 😞dry-keyboard-94795
10/25/2023, 7:41 PMalert-midnight-11504
10/25/2023, 7:41 PMdry-keyboard-94795
10/25/2023, 7:42 PMalert-midnight-11504
10/25/2023, 7:42 PMdry-keyboard-94795
10/25/2023, 7:44 PMrouteRules
, it'll not recreate everything:
{
service: s2BackendServiceId,
priority: 3,
matchRules: [
{
prefixMatch: "/s2",
}
]
}
alert-midnight-11504
10/25/2023, 7:47 PMdry-keyboard-94795
10/25/2023, 7:48 PMalert-midnight-11504
10/25/2023, 7:49 PMdry-keyboard-94795
10/25/2023, 7:49 PMalert-midnight-11504
10/25/2023, 7:49 PMdry-keyboard-94795
10/25/2023, 7:50 PMrouteRules
, which are required for your header-based routingalert-midnight-11504
10/25/2023, 7:52 PMdry-keyboard-94795
10/25/2023, 7:52 PMexport
the urlmap config, update the yaml with additional path rules, then import
it.
I'm not sure what protections there are if you say these stacks will run in parallel; though it should be fine as this is only for createsalert-midnight-11504
10/25/2023, 7:53 PMdry-keyboard-94795
10/25/2023, 8:02 PMalert-midnight-11504
10/25/2023, 8:04 PMdry-keyboard-94795
10/25/2023, 8:06 PMalert-midnight-11504
10/25/2023, 8:15 PMsalmon-account-74572
10/25/2023, 8:40 PMalert-midnight-11504
10/26/2023, 7:34 PMdry-keyboard-94795
10/30/2023, 5:30 PM</mercilessUpselling>
🤣