This message was deleted.
s
This message was deleted.
g
I either use the name of what it is derived from as a prefix, a hash or encoded form of it if is an invalid name like your case of IPs or just a random name and add a description if there is a field for that in the resource
instance-a => instance-a-allow-ssh
instance-a (ip: 10.0.0.5) => MTAuMC4wLjUK-allow-ssh
(bas64 of the ip) •
qZQxozk_8v84xu3S-allow-ssh
(base64 of 12 random bytes)
i
Hm. But instance names are generated, with two variables in each. And both names and IPs are properties of the instances that apparently I can use within the resource, but not in the name of the resource... But since I generate a list that holds the instance objects, maybe I could iterate over that, and use index of it as the identifier... Or use random hashes, but then they will need to be stored somewhere (yes, in the stack data, but still)
Basically I create instances in two independent clouds, and I need to let them access each other.
g
You can use the Random resource.
i
Yeah, I've seen that, didn't get to use it yet.
Time for Nth rewrite of the project ;D
g
If you mean for the name of the resource in the Pulumi graph I group them into a component and use
[name-of-component]-instance
and
[name-of-component]-rule
i
I'm afraid I didn't get far enough yet to know what you mean with that, sorry
And yeah, I mean the name of the resource within pulumi
g
I'm talking about `ComponentResource`s. There are useful for grouping resources. There are a few resources on the official SDKs that are actually Components. I think the most transparent/seamless among all of them are the inline AWS Lambda and Google Cloud Functions. They create a serialized function, a blob object to upload the code and the lambda/function itself using the code blob. https://www.pulumi.com/docs/intro/concepts/programming-model/#resources
i
Ah, thank you. Though at this very moment I need to wrap my head around generating security group objects for both clouds in a way that I can access easily when creating instances and security group rules
🤯
;)