This message was deleted.
# getting-started
s
This message was deleted.
m
Hi there — yes, in order to get at the underlying/resolved value, you’ll need to use
apply
as described here: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/?language=python#apply
d
I thought that the result of the call to apply is another Output object?
m
Yes — the result of the call to
apply
is an
Output[T]
, but within the callback that’s passed to apply, you can work with the raw `T`:
Copy code
bucket = s3.Bucket('my-bucket')

def compare(a, b):
    if a == b:
        print("match")
    else:
        print("no match")

bucket.id.apply(lambda id: compare(id, "some-string"))
👍 1
You can also do something like this, which can be a little nicer to work with:
Copy code
bucket = s3.Bucket('my-bucket')
some_known_value = "foo"

# Capture the result as an Output[bool].
is_match = bucket.id.apply(lambda id: id == some_known_value)

# Use its apply() to work with the result.  
is_match.apply(lambda m: print("Match!" if m else "No match."))
d
Okay thank you! I'll give that a shot