@pulumi/fastly
Version:
A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4
94 lines • 3.54 kB
JavaScript
;
// *** 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.Kvstore = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fastly from "@pulumi/fastly";
*
* // IMPORTANT: Deleting a KV Store requires first deleting its resource_link.
* // This requires a two-step `pulumi up` as we can't guarantee deletion order.
* // e.g. resource_link deletion within fastly_service_compute might not finish first.
* const exampleKvstore = new fastly.Kvstore("example", {name: "my_kv_store"});
* const example = fastly.getPackageHash({
* filename: "package.tar.gz",
* });
* const exampleServiceCompute = new fastly.ServiceCompute("example", {
* name: "my_compute_service",
* domains: [{
* name: "demo.example.com",
* }],
* "package": {
* filename: "package.tar.gz",
* sourceCodeHash: example.then(example => example.hash),
* },
* resourceLinks: [{
* name: "my_resource_link",
* resourceId: exampleKvstore.id,
* }],
* forceDestroy: true,
* });
* ```
*
* ## Import
*
* Fastly KV Stores can be imported using their Store ID, e.g.
*
* ```sh
* $ pulumi import fastly:index/kvstore:Kvstore example xxxxxxxxxxxxxxxxxxxx
* ```
*/
class Kvstore extends pulumi.CustomResource {
/**
* Get an existing Kvstore resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Kvstore(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Kvstore. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Kvstore.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
}
else {
const args = argsOrState;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Kvstore.__pulumiType, name, resourceInputs, opts);
}
}
exports.Kvstore = Kvstore;
/** @internal */
Kvstore.__pulumiType = 'fastly:index/kvstore:Kvstore';
//# sourceMappingURL=kvstore.js.map