@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
146 lines • 6.53 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.FileCache = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an Amazon File Cache cache.
* See the [Create File Cache](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileCache.html) for more information.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.fsx.FileCache("example", {
* dataRepositoryAssociations: [{
* dataRepositoryPath: "nfs://filer.domain.com",
* dataRepositorySubdirectories: [
* "test",
* "test2",
* ],
* fileCachePath: "/ns1",
* nfs: [{
* dnsIps: [
* "192.168.0.1",
* "192.168.0.2",
* ],
* version: "NFS3",
* }],
* }],
* fileCacheType: "LUSTRE",
* fileCacheTypeVersion: "2.12",
* lustreConfigurations: [{
* deploymentType: "CACHE_1",
* metadataConfigurations: [{
* storageCapacity: 2400,
* }],
* perUnitStorageThroughput: 1000,
* weeklyMaintenanceStartTime: "2:05:00",
* }],
* subnetIds: [test1.id],
* storageCapacity: 1200,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Amazon File Cache cache using the resource `id`. For example:
*
* ```sh
* $ pulumi import aws:fsx/fileCache:FileCache example fc-8012925589
* ```
*/
class FileCache extends pulumi.CustomResource {
/**
* Get an existing FileCache 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 FileCache(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of FileCache. 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'] === FileCache.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["copyTagsToDataRepositoryAssociations"] = state?.copyTagsToDataRepositoryAssociations;
resourceInputs["dataRepositoryAssociationIds"] = state?.dataRepositoryAssociationIds;
resourceInputs["dataRepositoryAssociations"] = state?.dataRepositoryAssociations;
resourceInputs["dnsName"] = state?.dnsName;
resourceInputs["fileCacheId"] = state?.fileCacheId;
resourceInputs["fileCacheType"] = state?.fileCacheType;
resourceInputs["fileCacheTypeVersion"] = state?.fileCacheTypeVersion;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["lustreConfigurations"] = state?.lustreConfigurations;
resourceInputs["networkInterfaceIds"] = state?.networkInterfaceIds;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["region"] = state?.region;
resourceInputs["securityGroupIds"] = state?.securityGroupIds;
resourceInputs["storageCapacity"] = state?.storageCapacity;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcId"] = state?.vpcId;
}
else {
const args = argsOrState;
if (args?.fileCacheType === undefined && !opts.urn) {
throw new Error("Missing required property 'fileCacheType'");
}
if (args?.fileCacheTypeVersion === undefined && !opts.urn) {
throw new Error("Missing required property 'fileCacheTypeVersion'");
}
if (args?.storageCapacity === undefined && !opts.urn) {
throw new Error("Missing required property 'storageCapacity'");
}
if (args?.subnetIds === undefined && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
resourceInputs["copyTagsToDataRepositoryAssociations"] = args?.copyTagsToDataRepositoryAssociations;
resourceInputs["dataRepositoryAssociations"] = args?.dataRepositoryAssociations;
resourceInputs["fileCacheType"] = args?.fileCacheType;
resourceInputs["fileCacheTypeVersion"] = args?.fileCacheTypeVersion;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["lustreConfigurations"] = args?.lustreConfigurations;
resourceInputs["region"] = args?.region;
resourceInputs["securityGroupIds"] = args?.securityGroupIds;
resourceInputs["storageCapacity"] = args?.storageCapacity;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["dataRepositoryAssociationIds"] = undefined /*out*/;
resourceInputs["dnsName"] = undefined /*out*/;
resourceInputs["fileCacheId"] = undefined /*out*/;
resourceInputs["networkInterfaceIds"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FileCache.__pulumiType, name, resourceInputs, opts);
}
}
exports.FileCache = FileCache;
/** @internal */
FileCache.__pulumiType = 'aws:fsx/fileCache:FileCache';
//# sourceMappingURL=fileCache.js.map