Hi folks, I am trying to access an output value in...
# python
s
Hi folks, I am trying to access an output value in Python and running into some issues. I read this documentation (https://www.pulumi.com/docs/intro/concepts/programming-model/#outputs-and-strings) and tried to implement the
apply
all
and
concat
functions, but couldn't get the Pulumi object to convert to a string. The documentation is mainly focused on multiple values or list values and doesn't have a section for a single string variable as far as I can tell. Additionally, I looked at each Python example found here (https://github.com/pulumi/examples) and couldn't find any that implemented this use case, and could I find any third-party blogs that do either. For reference, I am trying to access the
repository_url
string that is output from the
ecr.Repository
function.
Copy code
ecr = aws.ecr.Repository(
    "jupyterhub",
    name="jupyterhub",
    image_scanning_configuration={
        "scanOnPush": True,
    },
    image_tag_mutability="MUTABLE"
)
Has anyone done this in the past and can assist? Thank you all!
s
You should just be able to reference the variable.object like
ecr.repository_url.
I am actually in the middle of a project implementing Fargate. That worked for me. Another thing that is nice is the
pulumi.export
if you export your entire
ecr
object and go into the pulumi console you can see what the reference items are. Helps understand what the outputs are visually.