mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
Closes CORE-121 The dependency on the generated `tfvars` file is frustrating for first-time MSP setup because it currently requires `-stable=false` to update, and doesn't actually serve any purpose for deploy types other than `subscription` (which uses it to isolate image changes that happen on via GitHub actions). This makes it so that we don't generate, or depend on, the dynamic `tfvars` file unless you are using `subscription`. I've also added a rollout spec configuration, `initialImageTag`, to make the initial tag we provision environments with configurable (as some services might not publish `insiders` images) - see the docstring. ## Test plan Inspect output of `sg msp generate -all` |
||
|---|---|---|
| .. | ||
| cloudrun | ||
| iam | ||
| monitoring | ||
| project | ||
| tfcworkspaces | ||
| BUILD.bazel | ||
| README.md | ||
| stacks.go | ||
CDKTF stacks
A stack is a fully composed set of CDKTF resources that maps to a Terraform workspace. A set of stacks composes a CDKTF application.
Each stack package must declare the following interface:
import (
"github.com/sourcegraph/sourcegraph/dev/managedservicesplatform/internal/stack"
"github.com/sourcegraph/sourcegraph/dev/managedservicesplatform/internal/stack/options/googleprovider"
)
// CrossStackOutput allows programatic access to stack outputs across stacks.
// For human reference outputs, use (stack.ExplicitStackOutputs).Add(...)
type CrossStackOutput struct {}
type Variables struct {}
const StackName = "..."
func NewStack(stacks *stack.Set, vars Variables) (*CrossStackOutput, error) {
stack, outputs := stacks.New(StackName,
googleprovider.With(vars.ProjectID),
// ... other stack-wide options
)
// ...
}