@pulumi/cloud
Advanced tools
Comparing version 0.11.0-dev-5-g215a2f2 to 0.11.0-dev-7-gfe6a9e2
27
index.js
@@ -9,16 +9,17 @@ "use strict"; | ||
const config = new pulumi.Config("cloud:config"); | ||
// TODO(cyrusn): We probably want to move to a model where there is no fallback. It's probably best | ||
// that if the appropriate provider is not set by the runtime environment, we just want to fail-fast | ||
// so that that problem is addressed immediately. | ||
// | ||
// However, for now, it's fine to fall back to aws as that's the only provider we initially support | ||
// and there's no need to force all consumers to have to set pulumi:config:provider. | ||
let provider = config.get("provider"); | ||
if (!provider) { | ||
provider = "aws"; | ||
// console.log(`Warning: Provider not given. Falling back to ${provider} provider.`); | ||
const provider = config.require("provider"); | ||
// Load the implementation of @pulumi/cloud for the target provider. | ||
function loadFrameworkModule() { | ||
const frameworkModule = `@pulumi/cloud-${provider}`; | ||
pulumi.log.debug(`Loading ${frameworkModule} for current environment.`); | ||
try { | ||
return require(frameworkModule); | ||
} | ||
catch (_a) { | ||
throw new Error(` | ||
Attempted to load the '${provider}' implementation of '@pulumi/cloud', but no ${frameworkModule} module is \ | ||
installed. Install it now or select another provider implementation with the "cloud:config:provider" setting.`); | ||
} | ||
} | ||
const frameworkModule = `@pulumi/cloud-${provider}`; | ||
pulumi.log.debug(`Loading ${frameworkModule} for current environment.`); | ||
module.exports = require(frameworkModule); | ||
module.exports = loadFrameworkModule(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@pulumi/cloud", | ||
"version": "v0.11.0-dev-5-g215a2f2", | ||
"version": "v0.11.0-dev-7-gfe6a9e2", | ||
"description": "A highly productive, cloud neutral programming model.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
844
37622