Am I missing something? I go to create a bucket wi...
# aws
Am I missing something? I go to create a bucket with
aws.s3.Bucket("rd70-stream-dev" ..)
But my bucket is created as
. I don't know where I get the additional, unwanted
. Maybe I'm missing a basic s3 principal, but can't I provide arguments to not create the bucket in this case?
That's intentional (and described somewhere in the docs), to allow Pulumi to easily create the delete when doing a replace. For most resources, you can't have two instances with the same name.
It is possible to override the name any time you want, but then you have to enable delete-before-create so that replaces can happen.
Generally a better option is just to ensure that the Name tag is always set. AWS uses that for most resources as a "user friendly" name, in preference to the ID.
Thanks for quickly pointing this out. I missed it and it would have probably taken me time to find the doc
for s3 buckets specifically, there's a
argument which will specify the name for you:
I went ahead and am using the number appended name. How do I get the uri for the created bucket so I can pass it along as a string, via python? I am passing it as a template parameter but I see
Copy code
pulumi.ouput.Output object at 0x2045...
instead of the name using bucket as an argument
I think the type is Output[String]...
Sorry for my lack of better knowledge
If you're needing to take the bucket URI and render it within a template, you need to interpolate the resource output.
I tried doing something like values = x: yaml.load(Environment(...).get_template('...').render(uri=x))
and then using that like I did previously before just passing the string around. However I think wrapping up in the apply method that yaml loading my template it's not kosher
Got a template not found exception. I'm currently using jinja. It might be pretty ghetto since I think maybe there is a built in templating functionality
Here's a similar use case in Go, but hopefully gives you a good enough example - Essentially you need to do the rendering within the
👀 1
I was using jinja templates to keep the yaml helm chart I'm loading external so it doesn't clobber my application. But I think loading the template from the filesystem is causing the issue. I tried to move the loading into the
call, but I get a template not found exception.
The template loading was working well before I tried to work with provisioning an S3 bucket
I'm a little hard pressed to keep the helm chart configuration template outside of my program and as an external resource, because I want to separate the configuration from the program. I'd also like to IE be able to easily read the helm chart and provision externally
So I tried x: yaml.load(Environment(...).get_template('...').render(uri=x))
as above and also similar but adding the jinja FileSystemLoader into this
@gentle-diamond-70147 I looked at your reply and think I'm trying something similar but I made a mention in the python channel. Still haven't figured it out but thought if I provide more code it would become apparent to someone more seasoned:
Can you provide your full application code? I'm having trouble understanding what you're trying and how it's not working for you.
Hi @gentle-diamond-70147 what I found out was I had exported some part of the kubernetes cluster and that was causing the exception. The code is working. Thanks for your help!