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

important-appointment-55126

05/27/2020, 9:01 PM
If I just want to group a bunch of related resources together within a stack, so they show up thusly in the resource hierarchy, is it best practice to form them into a component? Or is there a simpler way of doing that?
l

little-cartoon-10569

05/27/2020, 9:05 PM
ComponentResource is the way to do that. It's pretty easy, you can configure a minimal one in just 5 or 6 lines.
The Pulumi / JFrog webinar earlier shows a really simple one.
m

millions-furniture-75402

05/27/2020, 9:19 PM
Is there a recording, or artifacts available from that webinar?
i

important-appointment-55126

05/27/2020, 9:23 PM
perfect will check that out 🙂
Just found that trying to re-parent a bucket policy/access block onto the associated bucket really doesn’t go well with the default concurrency; tries to re-create the policy while deleting the old one or something
b

broad-dog-22463

05/27/2020, 9:48 PM
@important-appointment-55126 you can use aliases to reparent things wiht out destorying them
i

important-appointment-55126

05/27/2020, 9:49 PM
ah nice tip thanks - i’m playing around in a lab account atm so it’s interesting to see what works and what doesn’t while setting up/tearing down is cheap
been a very educational day or so 🙂
created myself a
ResourceGroup
component i can just use for ad-hoc bundling of resources; very simple as you say
b

broad-dog-22463

05/27/2020, 9:53 PM
nice to hear 🙂
l

little-cartoon-10569

05/27/2020, 10:05 PM
@millions-furniture-75402 Looks like it hasn't been published yet, but it was only 4 hours ago so it's probably coming soon.
Here's the registration link, maybe this will turn into a download page when it's available? https://www.pulumi.com/webinars/sharing-and-reusing-infrastructure/
i

important-appointment-55126

05/27/2020, 10:12 PM
don’t see a way to get the current stack resource in Go.. that blog post showed the typescript version with
Copy code
pulumi.rootStackResource
but not finding the Go equivalent..
ctx.Stack()
returns a string name rather than a resource with the stack itself being an unpublished property
which is odd as the docs for Alias actual refer to
context.GetStack()
which isn’t a thing that exists https://pkg.go.dev/github.com/pulumi/pulumi/sdk/go/pulumi?tab=doc#Alias
and specifying an explicit
ParentURN
to the alias with the stack’s URN still seems to want the resource to be deleted and recreated