@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
146 lines • 7.16 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["copyTagsToDataRepositoryAssociations"] = state ? state.copyTagsToDataRepositoryAssociations : undefined;
resourceInputs["dataRepositoryAssociationIds"] = state ? state.dataRepositoryAssociationIds : undefined;
resourceInputs["dataRepositoryAssociations"] = state ? state.dataRepositoryAssociations : undefined;
resourceInputs["dnsName"] = state ? state.dnsName : undefined;
resourceInputs["fileCacheId"] = state ? state.fileCacheId : undefined;
resourceInputs["fileCacheType"] = state ? state.fileCacheType : undefined;
resourceInputs["fileCacheTypeVersion"] = state ? state.fileCacheTypeVersion : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["lustreConfigurations"] = state ? state.lustreConfigurations : undefined;
resourceInputs["networkInterfaceIds"] = state ? state.networkInterfaceIds : undefined;
resourceInputs["ownerId"] = state ? state.ownerId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined;
resourceInputs["storageCapacity"] = state ? state.storageCapacity : undefined;
resourceInputs["subnetIds"] = state ? state.subnetIds : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.fileCacheType === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileCacheType'");
}
if ((!args || args.fileCacheTypeVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileCacheTypeVersion'");
}
if ((!args || args.storageCapacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'storageCapacity'");
}
if ((!args || args.subnetIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
resourceInputs["copyTagsToDataRepositoryAssociations"] = args ? args.copyTagsToDataRepositoryAssociations : undefined;
resourceInputs["dataRepositoryAssociations"] = args ? args.dataRepositoryAssociations : undefined;
resourceInputs["fileCacheType"] = args ? args.fileCacheType : undefined;
resourceInputs["fileCacheTypeVersion"] = args ? args.fileCacheTypeVersion : undefined;
resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
resourceInputs["lustreConfigurations"] = args ? args.lustreConfigurations : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined;
resourceInputs["storageCapacity"] = args ? args.storageCapacity : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
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