is it forbidden to use Outputs as resource name? s...
# general
n
is it forbidden to use Outputs as resource name? seems like pulumi can't resolve those
w
I think you can't use an Output as resource_name (with Python), but you can set the resource's
name
with an Output
n
I keep getting
Copy code
TypeError: Expected resource name to be a string
I am trying
Copy code
self.rand = random.RandomId(
            self.resource_name(), byte_length=4, keepers={'target_port': target_port},
        ).hex
listener_kwargs = {
            'default_actions': [{'type': 'forward', 'target_group_arn': target_group.arn}],
            'load_balancer_arn': load_balancer.arn,
            'port': listener_port,
            'protocol': listener_protocol,
            'resource_name': pulumi.Output.concat(self.resource_name(), self.rand.hex),
        }
where self.resource_name() returns a string
and name can't be set with the listener 🤷‍♂️
w
p
resource names are static identifiers used by pulumi to build its internal graph, as `Output`s are dynamic (unknown until resolved), these can not be used to build a name
👍 1