few-processor-86645
02/22/2019, 9:13 AMif (fs.existsSync(fullFileName)) {
// On the build server, I update the blob with the new artifact
const blob = new azure.storage.Blob("myblob-b", {
name: fileName,
source: fullFileName,
resourceGroupName: resourceGroup.name,
storageAccountName: storageAccount.name,
storageContainerName: zipDeployContainer.name,
type: "block"
})
} else {
// On my local machine, the artifact does not exists but I want to keep it
const stackRef = new pulumi.StackReference(`${organization}/${projectName}/${stackName}`);
// How do I tell pulumi keep the resource from the stack reference
const srblob = stackRef.getOutput("zipblob");
}
export const zipblob = blob;
big-piano-35669
get
and that, by doing so, it will read the resource from the existing state and leave it be.
} else {
const stackRef = new pulumi.StackReference(...)
const blob = azure.storage.Blob.get(
"my-blob-b",
stackRef.getOutput("zipblob"),
);
}
That said, I had never considered using StackReference
to reference the current stack being deployed, and I don't know if the read will prevent the delete, so @microscopic-florist-22719 should definitely weigh in before I lead you down the wrong path 🙂