How do we share a stack amongst team members in an...
# general
i
How do we share a stack amongst team members in an organization aka how do we pull each other’s projects
g
Everyone would need to be a member of the same Pulumi organization and have the appropriate permissions to the stack.
i
Okay better example with permissions configured etc etc: Stack A Stack B I want to pull Stack B
g
Do you mean you want to reference values from Stack B in a different stack?
i
How do we share each other’s projects and pull each other’s stacks from said project
so say :
organization/llama
organization/alpaca
I want to pull project alpaca
does this look right:
pulumi up --config-file=config/Pulumi.dev.yaml -s organization/alpaca/dev
g
Assuming you're running that from where you have the project's code on your machine, yes, that looks right.
The Pulumi service is not storing your project's code though, so you would still need to git clone/pull from where you're storing your Pulumi application code.
i
So that command attempts to create another stack
basically how can we share code + underlying infra among team members without the code creating new infra for each member - which is what I think is happening now
I simply want to pull down my project
If we create a new project it states:
pulumi new bla-bla -s organization/alpaca/dev
but how do we go about with an existing project
g
You would start from where your project's code is, then
pulumi stack select organization/alpaca/dev
, then
pulumi up
.
As a concrete example: 1.
git clone <https://github.com/pulumi/examples.git>
2.
cd examples/aws-ts-eks
3.
pulumi stack select dev
4.
pulumi up
i
this attempts to create a stack of the same name in the organization of an already existing stack and/or attempts to re-create the resources
Copy code
➜ pulumi stack select reactioncommerce/packer-ami/dev

➜ pulumi up --config-file=config/Pulumi.dev.yaml
Previewing update (reactioncommerce/dev):

     Type                      Name             Plan
 +   pulumi:pulumi:Stack       packer-ami-dev   create
 +   ├─ aws:ec2:SecurityGroup  mySecurityGroup  create
 +   └─ aws:ec2:Instance       ec2-instance     create
g
There's a
name
value in your
Pulumi.yaml
(not the
.dev.
one) for the Project that the CLI uses to choose the right stack. Do you have this
name
set to the same name as another project? This might be confusing the CLI. As an example:
Copy code
name: demo-aws-ts-webserver
runtime: nodejs
description: A minimal AWS TypeScript Pulumi program
The CLI will use
demo-aws-ts-webserver
when looking up the stack.
i
For each
Pulumi.yaml
file we have different name values per project. Are we supposed to have a repo per Pulumi project? Only one “Pulumi.yaml” file?
Where is this documented… ?
g
No, it's not required or expected to have a repo per Pulumi project. https://www.pulumi.com/docs/reference/stack/ and https://www.pulumi.com/docs/reference/organizing-stacks-projects/ talk through the concept of projects and stacks.