This message was deleted.
# general
s
This message was deleted.
l
Have you read through the programming model docs for apply? An important thing to understand is that
.Apply
calls also return outputs. If you're trying to access the raw value (printing for instance) this will always need to be done from within the apply callback function. https://www.pulumi.com/docs/intro/concepts/programming-model/#apply
If you share a complete code example and some details about what you're trying to do, I'm happy to take a look.
f
@lemon-agent-27707 Here: https://pastebin.com/bz2EtWsf
I'm trying to add the ecs cluster name into user-data
I read an re-read, but it's very likely that I'm missing something.
g
Copy code
user_data = ecs_cluster.name.apply(lambda name: """
#!/bin/bash
cat > /etc/ecs/ecs.config <<EOF
ECS_CLUSTER={ecs_cluster_name}
ECS_RESERVED_MEMORY=128
ECS_ENGINE_TASK_CLEANUP_WAIT_DURATION=30m
ECS_IMAGE_CLEANUP_INTERVAL=30m
ECS_NUM_IMAGES_DELETE_PER_CYCLE=10
EOF
""".format(
    ecs_cluster_name=name
))
You can access the name from within the apply and use it to make an output with your user data
f
Thanks @green-school-95910 let me try that
Worked as expected, Thank you