I am struggling with the same `Output` object, and...
# python
l
I am struggling with the same
Output
object, and I have a feeling of moving in circles 🙂
Copy code
api_service = Service(
    opts=ResourceOptions(depends_on=[api_deployment]),
    resource_name="api",
    spec={
        "type": "ClusterIP",
        "selector": {"app": "api-deployment"},
        "ports": [port_map(api_port)],
    }
)
# Name is something like: "api-vvf3g61k"
# Tried:
srv_name1 = api_service.metadata.name
srv_name2 = Output.all([api_service.metadata]).apply(lambda x: x.name)
srv_name3 = Output.all([api_service.metadata.name]).apply(lambda x: x)
srv_name4 = Output.all([api_service.status]).apply(lambda x: str(x))

print("srv_name1:" + pformat(srv_name1))
print("srv_name2:" + pformat(srv_name2))
print("srv_name3:" + pformat(srv_name3))
print("srv_name4:" + pformat(srv_name4))
I want to use that name in an env var to configure another deployment …