This message was deleted.
# general
s
This message was deleted.
b
I don't have a blog post to hand, but as someone who has maintained large infra as code deployments, my strong recommendation is to make your stacks and projects as small as possible and use stack references where possible
p
Thanks @billowy-army-68599, that was definitely the natural feeling I was getting. How do you handle bootstrapping a completely new environment e.g bringing up all of the stacks ?
b
main reasons: - minimizing your blast radius - allowing separation of concerns (ie when your org grows, you'll be able to permission up stacks based on services) - reduce complexity (think the unix philosophy)
that largely depends on your needs, but a common pattern is a mono-repo with a directory per pulumi project/stack and then use your CI to figure out the logical dependencies There are more advanced patterns you can with CI triggers as you grow
p
Thanks!
b
if you need to run anything by me, feel free to reach out!
b
I use micro stacks and stack refs all over the place in my infra
if you need something "above" to orchestrate a change that includes multiple stacks look into automation API
im not using automation API (yet!) but i use something similar with a cli and python and I have larger commands like
add service
or
refresh environment
that will execute multiple stacks in a row
i also namespace all my stacks by like
{project}-{aws_account}-{environment}-{region}-{?service}
so that it's pretty easy to mix and match and programatically get stack refs
i name my stacks in this way and then use some utils to parse the stack name and immediately have something to workwith on dereferencing when loading up a new stack
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

import Utils from '../../../../../shared-ts/utils/utils';
import AwsUtils from '../../../../../shared-ts/aws/utils';

var stack_info = AwsUtils._parse_environment_stack();

// dereference
const env = stack_info['env'];
const company = stack_info['company'];
const region = stack_info['region'];
const prefix = stack_info['prefix'];
const definition_data = stack_info['definition_data'];
const env_config = stack_info['env_config'];
const account_config = stack_info['account_config'];

const vpc = new pulumi.StackReference(`${company}-vpc.${region}.${env}`);

var private_subnet_ids = <pulumi.Output<string[]>>vpc.getOutput(`private_subnet_ids`);
m
Hi all , first time here, could anyone point me to documentation related to policy document ? I am trying to find my way using c# and policies , I see a lot of examples of string containing json describing policies but I am unable to find a place where this json is explained. I might be a poor searcher too :)