This message was deleted.
# getting-started
s
This message was deleted.
m
Do you think it might be the
uri
property? Where is
${region}
coming from?
c
Hi, It's comming from
const region = config.get("aws:region");
đź‘€ 1
I`ve tried with and without
pulumi.interpolate
m
We have a couple of examples of API Gateway-EventBridge integrations in our examples repository that you might find helpful for reference — one using API Gateway v1 and the other with Gateway v2: • https://github.com/pulumi/examples/tree/master/aws-ts-apigateway-eventbridge • https://github.com/pulumi/examples/tree/master/aws-ts-apigatewayv2-eventbridge
Ok yeah, I’m pretty sure if you log out
region
, you’ll get something like
undefined
If you want that value, you’ll need to retrieve it a little differently. Lemme get you a doc.
There’s an example of fetching the AWS region name in that section
c
I'll check that, but shouldn't
pulumi up
fail on other resources that use
region
too?
m
The provider itself (
@pulumi/aws
) will generally read that value correctly, whether from your stack config file or from your shell environment, so your deployment will generally be fine. But if you want to use that value within your program code as well, you need to read it by passing the “namespace” (in this case
aws
) to a new Config instance and reading the
region
setting with that instance.
c
Oh god... 4 hours on this. Chenged from
config.get
to
config.requeir
and
pulumi up
failed... thank you very much for the help
m
Ah, great! So it hadn’t been set at all, looks like.
I think you’ll still get an
undefined
when you try to use it in a string (for that ARN), but you should be able to use the config thing I mentioned to address that.
Hopefully those two end-to-end examples will help as well.
c
Ok, I think I`ll advance on this now, always hard at the beginning. I`ll read the resources and try to get it done. Thanks again
m
You bet! Best of luck.
364 Views