UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

82 lines 3.35 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getImagesOutput = exports.getImages = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Get information about Google Compute Images. Check that your service account has the `compute.imageUser` role if you want to share [custom images](https://cloud.google.com/compute/docs/images/sharing-images-across-projects) from another project. If you want to use [public images][pubimg], do not forget to specify the dedicated project. For more information see * [the official documentation](https://cloud.google.com/compute/docs/images) and its [API](https://cloud.google.com/compute/docs/reference/latest/images). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const debian = gcp.compute.getImages({ * filter: "name eq my-image.*", * }); * const _default = new gcp.compute.Instance("default", { * name: "test", * machineType: "f1-micro", * zone: "us-central1-a", * bootDisk: { * initializeParams: { * image: debian.then(debian => debian.images?.[0]?.selfLink), * }, * }, * networkInterfaces: [{ * network: defaultGoogleComputeNetwork.name, * }], * }); * ``` */ function getImages(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("gcp:compute/getImages:getImages", { "filter": args.filter, "project": args.project, }, opts); } exports.getImages = getImages; /** * Get information about Google Compute Images. Check that your service account has the `compute.imageUser` role if you want to share [custom images](https://cloud.google.com/compute/docs/images/sharing-images-across-projects) from another project. If you want to use [public images][pubimg], do not forget to specify the dedicated project. For more information see * [the official documentation](https://cloud.google.com/compute/docs/images) and its [API](https://cloud.google.com/compute/docs/reference/latest/images). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const debian = gcp.compute.getImages({ * filter: "name eq my-image.*", * }); * const _default = new gcp.compute.Instance("default", { * name: "test", * machineType: "f1-micro", * zone: "us-central1-a", * bootDisk: { * initializeParams: { * image: debian.then(debian => debian.images?.[0]?.selfLink), * }, * }, * networkInterfaces: [{ * network: defaultGoogleComputeNetwork.name, * }], * }); * ``` */ function getImagesOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("gcp:compute/getImages:getImages", { "filter": args.filter, "project": args.project, }, opts); } exports.getImagesOutput = getImagesOutput; //# sourceMappingURL=getImages.js.map