FileCache class

Resource for managing an Amazon File Cache cache. See the Create File Cache for more information.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.fsx.FileCache("example", {
    dataRepositoryAssociations: [{
        nfs: [{
            dnsIps: [
                "192.168.0.1",
                "192.168.0.2",
            ],
            version: "NFS3",
        }],
        dataRepositoryPath: "nfs://filer.domain.com",
        dataRepositorySubdirectories: [
            "test",
            "test2",
        ],
        fileCachePath: "/ns1",
    }],
    lustreConfigurations: [{
        metadataConfigurations: [{
            storageCapacity: 2400,
        }],
        deploymentType: "CACHE_1",
        perUnitStorageThroughput: 1000,
        weeklyMaintenanceStartTime: "2:05:00",
    }],
    fileCacheType: "LUSTRE",
    fileCacheTypeVersion: "2.12",
    subnetIds: [test1.id],
    storageCapacity: 1200,
});
import pulumi
import pulumi_aws as aws

example = aws.fsx.FileCache("example",
    data_repository_associations=[{
        "nfs": [{
            "dns_ips": [
                "192.168.0.1",
                "192.168.0.2",
            ],
            "version": "NFS3",
        }],
        "data_repository_path": "nfs://filer.domain.com",
        "data_repository_subdirectories": [
            "test",
            "test2",
        ],
        "file_cache_path": "/ns1",
    }],
    lustre_configurations=[{
        "metadata_configurations": [{
            "storage_capacity": 2400,
        }],
        "deployment_type": "CACHE_1",
        "per_unit_storage_throughput": 1000,
        "weekly_maintenance_start_time": "2:05:00",
    }],
    file_cache_type="LUSTRE",
    file_cache_type_version="2.12",
    subnet_ids=[test1["id"]],
    storage_capacity=1200)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Fsx.FileCache("example", new()
    {
        DataRepositoryAssociations = new[]
        {
            new Aws.Fsx.Inputs.FileCacheDataRepositoryAssociationArgs
            {
                Nfs = new[]
                {
                    new Aws.Fsx.Inputs.FileCacheDataRepositoryAssociationNfArgs
                    {
                        DnsIps = new[]
                        {
                            "192.168.0.1",
                            "192.168.0.2",
                        },
                        Version = "NFS3",
                    },
                },
                DataRepositoryPath = "nfs://filer.domain.com",
                DataRepositorySubdirectories = new[]
                {
                    "test",
                    "test2",
                },
                FileCachePath = "/ns1",
            },
        },
        LustreConfigurations = new[]
        {
            new Aws.Fsx.Inputs.FileCacheLustreConfigurationArgs
            {
                MetadataConfigurations = new[]
                {
                    new Aws.Fsx.Inputs.FileCacheLustreConfigurationMetadataConfigurationArgs
                    {
                        StorageCapacity = 2400,
                    },
                },
                DeploymentType = "CACHE_1",
                PerUnitStorageThroughput = 1000,
                WeeklyMaintenanceStartTime = "2:05:00",
            },
        },
        FileCacheType = "LUSTRE",
        FileCacheTypeVersion = "2.12",
        SubnetIds = new[]
        {
            test1.Id,
        },
        StorageCapacity = 1200,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/fsx"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := fsx.NewFileCache(ctx, "example", &fsx.FileCacheArgs{
			DataRepositoryAssociations: fsx.FileCacheDataRepositoryAssociationArray{
				&fsx.FileCacheDataRepositoryAssociationArgs{
					Nfs: fsx.FileCacheDataRepositoryAssociationNfArray{
						&fsx.FileCacheDataRepositoryAssociationNfArgs{
							DnsIps: pulumi.StringArray{
								pulumi.String("192.168.0.1"),
								pulumi.String("192.168.0.2"),
							},
							Version: pulumi.String("NFS3"),
						},
					},
					DataRepositoryPath: pulumi.String("nfs://filer.domain.com"),
					DataRepositorySubdirectories: pulumi.StringArray{
						pulumi.String("test"),
						pulumi.String("test2"),
					},
					FileCachePath: pulumi.String("/ns1"),
				},
			},
			LustreConfigurations: fsx.FileCacheLustreConfigurationArray{
				&fsx.FileCacheLustreConfigurationArgs{
					MetadataConfigurations: fsx.FileCacheLustreConfigurationMetadataConfigurationArray{
						&fsx.FileCacheLustreConfigurationMetadataConfigurationArgs{
							StorageCapacity: pulumi.Int(2400),
						},
					},
					DeploymentType:             pulumi.String("CACHE_1"),
					PerUnitStorageThroughput:   pulumi.Int(1000),
					WeeklyMaintenanceStartTime: pulumi.String("2:05:00"),
				},
			},
			FileCacheType:        pulumi.String("LUSTRE"),
			FileCacheTypeVersion: pulumi.String("2.12"),
			SubnetIds: pulumi.StringArray{
				test1.Id,
			},
			StorageCapacity: pulumi.Int(1200),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_fsx_filecache" "example" {
  data_repository_associations {
    nfs {
      dns_ips = ["192.168.0.1", "192.168.0.2"]
      version = "NFS3"
    }
    data_repository_path           = "nfs://filer.domain.com"
    data_repository_subdirectories = ["test", "test2"]
    file_cache_path                = "/ns1"
  }
  lustre_configurations {
    metadata_configurations {
      storage_capacity = 2400
    }
    deployment_type               = "CACHE_1"
    per_unit_storage_throughput   = 1000
    weekly_maintenance_start_time = "2:05:00"
  }
  file_cache_type         = "LUSTRE"
  file_cache_type_version = "2.12"
  subnet_ids              = [test1.id]
  storage_capacity        = 1200
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.fsx.FileCache;
import com.pulumi.aws.fsx.FileCacheArgs;
import com.pulumi.aws.fsx.inputs.FileCacheDataRepositoryAssociationArgs;
import com.pulumi.aws.fsx.inputs.FileCacheDataRepositoryAssociationNfArgs;
import com.pulumi.aws.fsx.inputs.FileCacheLustreConfigurationArgs;
import com.pulumi.aws.fsx.inputs.FileCacheLustreConfigurationMetadataConfigurationArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new FileCache("example", FileCacheArgs.builder()
            .dataRepositoryAssociations(FileCacheDataRepositoryAssociationArgs.builder()
                .nfs(FileCacheDataRepositoryAssociationNfArgs.builder()
                    .dnsIps(
                        "192.168.0.1",
                        "192.168.0.2")
                    .version("NFS3")
                    .build())
                .dataRepositoryPath("nfs://filer.domain.com")
                .dataRepositorySubdirectories(
                    "test",
                    "test2")
                .fileCachePath("/ns1")
                .build())
            .lustreConfigurations(FileCacheLustreConfigurationArgs.builder()
                .metadataConfigurations(FileCacheLustreConfigurationMetadataConfigurationArgs.builder()
                    .storageCapacity(2400)
                    .build())
                .deploymentType("CACHE_1")
                .perUnitStorageThroughput(1000)
                .weeklyMaintenanceStartTime("2:05:00")
                .build())
            .fileCacheType("LUSTRE")
            .fileCacheTypeVersion("2.12")
            .subnetIds(test1.id())
            .storageCapacity(1200)
            .build());

    }
}
resources:
  example:
    type: aws:fsx:FileCache
    properties:
      dataRepositoryAssociations:
        - nfs:
            - dnsIps:
                - 192.168.0.1
                - 192.168.0.2
              version: NFS3
          dataRepositoryPath: nfs://filer.domain.com
          dataRepositorySubdirectories:
            - test
            - test2
          fileCachePath: /ns1
      lustreConfigurations:
        - metadataConfigurations:
            - storageCapacity: 2400
          deploymentType: CACHE_1
          perUnitStorageThroughput: 1000
          weeklyMaintenanceStartTime: 2:05:00
      fileCacheType: LUSTRE
      fileCacheTypeVersion: '2.12'
      subnetIds:
        - ${test1.id}
      storageCapacity: 1200

Import

Using pulumi import, import Amazon File Cache cache using the resource id. For example:

$ pulumi import aws:fsx/fileCache:FileCache example fc-8012925589

Constructors

FileCache(String name, {FileCacheArgs? args, CustomResourceOptions? options})
Creates a new FileCache. name The Pulumi resource name. args Arguments used to configure this FileCache. The set of arguments for FileCache. options Resource options controlling this resource's behavior.
FileCache.reference(String urn)
Creates a typed reference to an existing FileCache resource.

Properties

arn ↔ Output<String>
ARN of the cache.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
copyTagsToDataRepositoryAssociations ↔ Output<bool?>
Whether to copy tags for the cache to data repository associations. Defaults to false.
latefinal
dataRepositoryAssociationIds ↔ Output<List<String>>
IDs of data repository associations that are associated with the cache.
latefinal
dataRepositoryAssociations ↔ Output<List<FileCacheDataRepositoryAssociation>?>
Configurations for up to 8 data repository associations (DRAs) to create during cache creation. All configurations must be of the same data repository type, either all S3 or all NFS. Maximum of 8. See dataRepositoryAssociation Block below.
latefinal
dnsName ↔ Output<String>
DNS name for the cache.
latefinal
fileCacheId ↔ Output<String>
System-generated, unique ID of the cache.
latefinal
fileCacheType ↔ Output<String>
Type of cache to create. The only supported value is LUSTRE.
latefinal
fileCacheTypeVersion ↔ Output<String>
Version for the type of cache to create. The only supported value is 2.12.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kmsKeyId ↔ Output<String>
ID of the KMS key to use for encrypting data on the cache. Defaults to the Amazon FSx-managed KMS key for your account.
latefinal
lustreConfigurations ↔ Output<List<FileCacheLustreConfiguration>?>
Configuration for the Lustre cache. Required when fileCacheType is LUSTRE. See lustreConfiguration Block below.
latefinal
networkInterfaceIds ↔ Output<List<String>>
IDs of the network interfaces.
latefinal
ownerId ↔ Output<String>
AWS account that created the cache.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityGroupIds ↔ Output<List<String>?>
IDs of the security groups to apply to all network interfaces created for cache access.
latefinal
storageCapacity ↔ Output<int>
Storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.
latefinal
subnetIds ↔ Output<List<String>>
Subnet IDs that the cache is accessible from. You can specify only one subnet ID.
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the file cache. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
vpcId ↔ Output<String>
ID of your VPC.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {FileCacheState? state, CustomResourceOptions? options}) → FileCache
Gets an existing FileCache resource's state with the given name and id.