import { FSxClient, AssociateFileSystemAliasesCommand } from "@aws-sdk/client-fsx"; // ES Modules import
// const { FSxClient, AssociateFileSystemAliasesCommand } = require("@aws-sdk/client-fsx"); // CommonJS import
const client = new FSxClient(config);
const command = new AssociateFileSystemAliasesCommand(input);
const response = await client.send(command);
import { StorageGatewayClient, AssociateFileSystemCommand } from "@aws-sdk/client-storage-gateway"; // ES Modules import
// const { StorageGatewayClient, AssociateFileSystemCommand } = require("@aws-sdk/client-storage-gateway"); // CommonJS import
const client = new StorageGatewayClient(config);
const command = new AssociateFileSystemCommand(input);
const response = await client.send(command);
/* This operation creates a new Amazon FSx for Windows File Server file system. */
var params = {
ClientRequestToken: "a8ca07e4-61ec-4399-99f4-19853801bcd5",
FileSystemType: "WINDOWS",
KmsKeyId: "arn:aws:kms:us-east-1:012345678912:key/1111abcd-2222-3333-4444-55556666eeff",
SecurityGroupIds: [
"sg-edcd9784"
],
StorageCapacity: 3200,
StorageType: "HDD",
SubnetIds: [
"subnet-1234abcd"
],
Tags: [
{
Key: "Name",
Value: "MyFileSystem"
}
],
WindowsConfiguration: {
ActiveDirectoryId: "d-1234abcd12",
Aliases: [
"accounting.corp.example.com"
],
AutomaticBackupRetentionDays: 30,
DailyAutomaticBackupStartTime: "05:00",
ThroughputCapacity: 32,
WeeklyMaintenanceStartTime: "1:05:00"
}
};
fsx.createFileSystem(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
FileSystem: {
CreationTime: <Date Representation>,
DNSName: "fs-0123456789abcdef0.fsx.com",
FileSystemId: "fs-0123456789abcdef0",
KmsKeyId: "arn:aws:kms:us-east-1:012345678912:key/1111abcd-2222-3333-4444-55556666eeff",
Lifecycle: "CREATING",
OwnerId: "012345678912",
ResourceARN: "arn:aws:fsx:us-east-1:012345678912:file-system/fs-0123456789abcdef0",
StorageCapacity: 3200,
StorageType: "HDD",
SubnetIds: [
"subnet-1234abcd"
],
Tags: [
{
Key: "Name",
Value: "MyFileSystem"
}
],
VpcId: "vpc-ab1234cd",
WindowsConfiguration: {
ActiveDirectoryId: "d-1234abcd12",
Aliases: [
{
Lifecycle: "CREATING",
Name: "accounting.corp.example.com"
}
],
AutomaticBackupRetentionDays: 30,
DailyAutomaticBackupStartTime: "05:00",
ThroughputCapacity: 32,
WeeklyMaintenanceStartTime: "1:05:00"
}
}
}
*/
});
/* This operation untags an Amazon FSx resource. */
var params = {
ResourceARN: "arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec",
TagKeys: [
"Name"
]
};
fsx.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
}
*/
});
/* This operation lists tags for an Amazon FSx resource. */
var params = {
ResourceARN: "arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec"
};
fsx.listTagsForResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
Tags: [
{
Key: "Name",
Value: "MyFileSystem"
}
]
}
*/
});