This message was deleted.
# python
s
This message was deleted.
m
Copy code
Step #9 - "Pulumi Create Stack":       File "./__main__.py", line 56, in <module>
Step #9 - "Pulumi Create Stack":         organization_name=organization,
You’re setting
organization_name
to
organization
on line 56 of your
__main__.py
. Is
organization
a
str
?
d
thanks, there was something that was left from copy paste
now there is an additional failure, which is more surprising
Copy code
Step #9 - "Pulumi Create Stack":     error: Program failed with an unhandled exception:
Step #9 - "Pulumi Create Stack":     error: Traceback (most recent call last):
Step #9 - "Pulumi Create Stack":       File "/pulumi/pulumi-language-python-exec", line 85, in <module>
Step #9 - "Pulumi Create Stack":         loop.run_until_complete(coro)
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
Step #9 - "Pulumi Create Stack":         return future.result()
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 83, in run_in_stack
Step #9 - "Pulumi Create Stack":         await run_pulumi_func(lambda: Stack(func))
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 35, in run_pulumi_func
Step #9 - "Pulumi Create Stack":         func()
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 83, in <lambda>
Step #9 - "Pulumi Create Stack":         await run_pulumi_func(lambda: Stack(func))
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/site-packages/pulumi/runtime/stack.py", line 106, in __init__
Step #9 - "Pulumi Create Stack":         func()
Step #9 - "Pulumi Create Stack":       File "/pulumi/pulumi-language-python-exec", line 84, in <lambda>
Step #9 - "Pulumi Create Stack":         coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/runpy.py", line 280, in run_path
Step #9 - "Pulumi Create Stack":         run_name, mod_spec, pkg_name).copy()
Step #9 - "Pulumi Create Stack":       File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
Step #9 - "Pulumi Create Stack":         exec(code, run_globals)
Step #9 - "Pulumi Create Stack":       File "./__main__.py", line 55, in <module>
Step #9 - "Pulumi Create Stack":         project=ephemeral_project.new_project_id,
Step #9 - "Pulumi Create Stack":     AttributeError: 'Project' object has no attribute 'new_project_id'
Step #9 - "Pulumi Create Stack":     error: an unhandled error occurred: Program exited with non-zero exit code: 1
As you see from the code @microscopic-pilot-97530 there is the output in the component and it is even registered
@green-school-95910 or @gentle-diamond-70147 might now what might be going on with the output?
Copy code
Step #9 - "Pulumi Create Stack":     AttributeError: 'Project' object has no attribute 'new_project_id'
g
Indeed it seems like it should be
ehemeral_project.project_id
not
.new_project_id
Oh,
new_project_id
is the Output of you
Project
component
d
right
is my last statement self.register_output breaking something?
g
You need to assign it to the instance variable and call
register_outputs
Copy code
self.new_project_id = ephemeral_project.project_id
self.register_outputs({"new_project_id": ephemeral_project.project_id})
d
make sense, what does registering do? it makes it available for export?
g
The first allows you to reference the graph on your code, normal Python code The second is to effectively add them to the correct place on Pulumi resource graph
It could have been done differently on Pulumi side to make that line disappear, but maybe it just wasn't worth it...
Like, with a metaclass intercepting the attribute assignments and resource creation on the runtime to add their registration to the event queue automatically...
Yeah, not worth it. Would be hell to maintain
d
thanks that was it