https://pulumi.com logo
#general
Title
# general
q

quick-action-34599

05/03/2019, 10:20 PM
I am doing it by using endpointString.apply(…) and sometimes it gets created, sometimes it gets deleted
w

white-balloon-205

05/03/2019, 10:22 PM
Are you invoking the Lambda using the AWS SDK inside the Google Cloud Function? Or are you trying to invoke it through an HTTP endpoint (API Gateway)? There is no direct HTTP-addressable endpoint for a raw AWS Lambda.
q

quick-action-34599

05/03/2019, 10:23 PM
http endpoint call
w

white-balloon-205

05/03/2019, 10:23 PM
API Gateway?
q

quick-action-34599

05/03/2019, 10:23 PM
it’s not a raw lambda, it’s a
cloud.API
sorry
w

white-balloon-205

05/03/2019, 10:24 PM
Ahh - got it.
Note that you need to call
api.publish()
for the API to get created. The response from that is https://pulumi.io/reference/pkg/nodejs/@pulumi/cloud/index.html#HttpDeployment which has a
url
property you should be able to `GET`/`POST`.
q

quick-action-34599

05/03/2019, 10:28 PM
Yea it is mostly working
But sometimes it seems like pulumi wants to delete the gcloud function
I'm assuming because im creating it in an apply() handler?
w

white-balloon-205

05/03/2019, 10:29 PM
Ahh. Yes - you should in general not create resources inside an
apply
. This will frequently lead to misleading previews.
q

quick-action-34599

05/03/2019, 10:29 PM
Basically i need to wait for the lambda url to be ready and create the gcloud function after
w

white-balloon-205

05/03/2019, 10:29 PM
You should rarely need to do this - in almost all cases you should be able to pass the derived values into the constructor of the Google Cloud function.
Like:
Copy code
let api = new API();
let url = api.publish().url;
let gcloudfunction = new Function("f", async () => {
   console.log(url.get());
});
q

quick-action-34599

05/03/2019, 10:31 PM
When I did that I got an error about pulumi resource. JS missing
Sorry I am having to voice to text
w

white-balloon-205

05/03/2019, 10:32 PM
Might be easiest to open an issue with repro steps and error message?
q

quick-action-34599

05/03/2019, 10:34 PM
No problem. I can do that on Monday. Thanks for your help
@white-balloon-205 I must have done something wrong initially because I tried
url.get()
again and it’s working. Thanks!
👍 1
2 Views