sparse-intern-71089
03/30/2021, 12:41 PMbrave-planet-10645
03/30/2021, 12:42 PMhallowed-camera-52062
03/30/2021, 12:43 PMbetter-shampoo-48884
03/30/2021, 12:43 PMbrave-planet-10645
03/30/2021, 12:44 PMhallowed-camera-52062
03/30/2021, 12:44 PMdry-football-2639
03/30/2021, 1:41 PMconst lazyRunner = (resources: ResourceDefinition[]): ResourceOutputs => {
return resources.map((resource) => {
const getConventionName: ConventionNameGetter = useNamingConvention(
resource.name,
resource.environment
)
return provisionResource(resource, getConventionName)
})
}
const environmentName: string = pulumi.getStack().toLowerCase()
// Filter the resources that belong to the current environment
const resources: ResourceDefinition[] = resourcesDefinitions.filter(
(r: ResourceDefinition) => r.environment === environmentName
)
if (resources.length === 0) {
console.log(
`There are no resources to be deployed onto the current environment ('${environmentName}'). Skipping...`
)
}
export const resourceOutputs: ResourceOutputs = (resources.length === 0) ? null : lazyRunner(resources)