wet-ambulance-3300
02/19/2021, 10:17 AMdata "archive_file" "source_archive" {
source_dir = var.source_directory
output_path = "./main.zip"
type = "zip"
}
resource "google_storage_bucket_object" "archive" {
name = "${lower(replace(base64encode(data.archive_file.source_archive.output_md5), "=", ""))}.zip"
bucket = google_storage_bucket.source_bucket.name
source = data.archive_file.source_archive.output_path
}
I saw https://www.pulumi.com/docs/intro/concepts/assets-archives/#archives but as far as I can tell, it just represents an archive. It does not actually create the archive... Please correct me if i'm wrong.gentle-diamond-70147
02/19/2021, 3:11 PMwet-ambulance-3300
02/19/2021, 5:01 PMimport * as SparkMD5 from 'spark-md5'
import * as pulumi from '@pulumi/pulumi'
import * as gcp from '@pulumi/gcp'
const source_archive = new pulumi.asset.FileArchive(args.source_directory)
const source_object = new gcp.storage.BucketObject('source_object', {
name: pulumi.output(source_archive.path).apply(file => `${SparkMD5.hash(file)}.zip`),
bucket: source_bucket.name,
source: source_archive.path
})
gentle-diamond-70147
02/22/2021, 5:35 PM