This message was deleted.
s
This message was deleted.
b
it’s this line:
Copy code
rta_name = f"rta-{pub_subnet.id}-public"
You can’t concat a string with an
Output[str]
resource names need to be known on creation so this won’t work, you’ll need to use a known value
b
ok thanks
ok I changed it and I think I fixed that error but now I'm getting a stack error that tells me I'm missing a resource name argument where I've clearly defined one here's the new code
Copy code
pub_rtas = []

for pub_subnet in pub_subnets:
    rta_name = pub_subnet.id
    newCall = pub_rtas.append(f"{rta_name}-public")

    ec2.RouteTableAssociation(
		resource_name = newCall,
	    subnet_id = pub_subnet.id,
	    gateway_id = igw.id,
	    route_table_id="HNO-route-table-public",
	)
b
no that doesn’t look correct either:
Copy code
rta_name = pub_subnet.id
    newCall = pub_rtas.append(f"{rta_name}-public")
this just assigned the value
pub_subnet.id
to a string, so it’s still an
Output[str]
so you still can’t concatenate
Copy code
resource_name = newCall,
i din’t think that’s a valid parameter
b
I got it from pulumi documentation and it's built into vscode as well. I don't think you normally need it but I tried to go more explicit since it's saying it doesn't exist
340 Views