Thread
#general
    s

    straight-crayon-4578

    4 months ago
    When using python, is it possible to have more than one
    __main__.py
    for one project? eg.:
    pulumi up file.py
    ?
    b

    billowy-army-68599

    4 months ago
    pulumi will always look for
    __main__.py
    - are you want to break your code into distinct files?
    s

    straight-crayon-4578

    4 months ago
    @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

    billowy-army-68599

    4 months ago
    that's what stacks are for..
    you use stacks, stack configuration and then ise the same code between prod and dev
    s

    straight-crayon-4578

    4 months ago
    So, I've imported this:
    container = aws.ecs.TaskDefinition("Foo",    
        ...
        task_role_arn="arn:aws:iam::393964450433:role/ECSTaskRole-123",
        ...)
    Then I should:
    my_task_role_arn = pulumi.Config('foo').get('bar')
    
    container = aws.ecs.TaskDefinition("Foo",    
        ...
        task_role_arn=my_task_role_arn,
        ...)
    b

    billowy-army-68599

    4 months ago
    corrrect!
    the for each stack
    pulumi config set task_role_arn <foo>
    s

    straight-crayon-4578

    4 months ago
    @billowy-army-68599 Thanks!!