sparse-intern-71089
12/18/2019, 4:52 PMimportant-leather-28796
12/18/2019, 4:57 PMinfrastructure
, so I use that stack output. I believe the pulumi guides have something similar to this.important-leather-28796
12/18/2019, 4:57 PMimport { stackPath } from '@alienfast/pulumi-common'
import { StackReference } from '@pulumi/pulumi'
// how about now or now
export const identity: StackReference = new StackReference(stackPath('identity'))
export const infrastructure: StackReference = new StackReference(stackPath('infrastructure'))
export const infrastructurePath = stackPath('infrastructure')
important-leather-28796
12/18/2019, 4:57 PMimport { getStack, Config } from '@pulumi/pulumi'
import { productNameFromProject } from './productNameFromProject'
/**
* Given the dirName, construct the fully qualified stack path from the current
* project/stack.
*
* @param dirName e.g. `infrastructure`
*/
export const stackPath = (dirName: string) => {
const config = new Config('pulumi')
const organization = config.require('organization') // e.g. rosskevin || alienfast
const stack = getStack() // => "development"
const product = productNameFromProject()
return `${organization}/${product}-${dirName}/${stack}`
}
important-leather-28796
12/18/2019, 4:58 PMexport const kubernetes = new k8s.Provider(stack.infrastructurePath, {
kubeconfig: stack.infrastructure.requireOutput('cluster').apply(cluster => cluster.kubeconfig),
})
stocky-island-3676
12/18/2019, 5:05 PMbusy-umbrella-36067
12/18/2019, 5:06 PMinfrastructure
stack, but we don't want to hide the opts
from developers in case they want to deploy to multiple clusterswhite-balloon-205
important-leather-28796
12/18/2019, 5:09 PMstocky-island-3676
12/18/2019, 5:19 PMimportant-leather-28796
12/18/2019, 5:20 PM