When using python, is it possible to have more tha...
# general
s
When using python, is it possible to have more than one
__main__.py
for one project? eg.:
pulumi up file.py
?
b
pulumi will always look for
__main__.py
- are you want to break your code into distinct files?
s
@billowy-army-68599 yes, I've used the
import
feature and now there is lots of variables hardcoded, I went something like a main file for prod and another for dev...
b
that's what stacks are for..
you use stacks, stack configuration and then ise the same code between prod and dev
s
So, I've imported this:
Copy code
container = aws.ecs.TaskDefinition("Foo",    
    ...
    task_role_arn="arn:aws:iam::393964450433:role/ECSTaskRole-123",
    ...)
Then I should:
Copy code
my_task_role_arn = pulumi.Config('foo').get('bar')

container = aws.ecs.TaskDefinition("Foo",    
    ...
    task_role_arn=my_task_role_arn,
    ...)
b
corrrect!
the for each stack
pulumi config set task_role_arn <foo>
s
@billowy-army-68599 Thanks!!