続き!!
まずは作っていきましょう
その1
FSx.yamlファイルを使います。
その2
PJPrefixのみをhandsonという名前に変更して次へ
そのままスタックの作成へ・・・
そして事前に作っていたものがこちら
ここも結構時間がかかります!!
ソースコードはこちら
今回はドキュメントをみながら解説できればと思います。
ドキュメント
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
PJPrefix:
Description: Enter a prefix of this system.
Type: String
Default: "test"
AllowedPattern: "[a-zA-Z][a-zA-Z0-9][ -~]*"
ConstraintDescription: must begin with a letter and contain only alphanumeric characters.
StorageCapacity:
Description: "Storage Capacity"
Type: "Number"
Default: 32
MinValue: 32
MaxValue: 65536
ConstraintDescription: must be at least 32Gib to 65536Gib.
WeeklyMaintenanceStartTime:
Description: "Weekly Maintenance Time"
Type: String
Default: "2:20:30"
AllowedPattern: "^[1-7]:([0-1][0-9]|2[0-3]):[0-5][0-9]$"
ConstraintDescription: "d:HH:MM d = 1~7 HH = 00~23 MM = 00~59"
DailyAutomaticBackupStartTime:
Description: "Daily backup start time"
Type: String
Default: "16:30"
AllowedPattern: "^([0-1][0-9]|2[0-3]):[0-5][0-9]$"
ConstraintDescription: "HH:MM HH = 00~23 MM = 00~59"
AutomaticBackupRetentionDays:
Description: "Backup Retention Period"
Type: Number
Default: 7
MinValue: 0
MaxValue: 35
ConstraintDescription: The number of days to keep the automatic backup. The default is to keep the backup for seven days. Setting this value to 0 disables the creation of automatic backups. The maximum retention period for a backup is 35 days.
Resources:
WindowsSelfManagedADFileSystemWithAllConfigs:
Type: "AWS::FSx::FileSystem"
Properties:
FileSystemType: "WINDOWS"
StorageCapacity: !Ref StorageCapacity
StorageType: "SSD"
SubnetIds:
- { "Fn::ImportValue": !Sub "${PJPrefix}-private-subnet-a" } # VPCを合わせるPrivate
- { "Fn::ImportValue": !Sub "${PJPrefix}-private-subnet-c" }
SecurityGroupIds:
- { "Fn::ImportValue": !Sub "${PJPrefix}-fsx-sg" }
Tags:
- Key: Name
Value: !Sub ${PJPrefix}-file-server
WindowsConfiguration:
ActiveDirectoryId: { "Fn::ImportValue": !Sub "${PJPrefix}-windows-ad" }
ThroughputCapacity: 16
WeeklyMaintenanceStartTime: !Ref WeeklyMaintenanceStartTime
DailyAutomaticBackupStartTime: !Ref DailyAutomaticBackupStartTime
AutomaticBackupRetentionDays: !Ref AutomaticBackupRetentionDays
DeploymentType: "MULTI_AZ_1"
PreferredSubnetId: { "Fn::ImportValue": !Sub "${PJPrefix}-private-subnet-a" } # ADのサブネットをVPC合わせる
CopyTagsToBackups: false
Outputs:
WindowsSelfManagedADFileSystemWithAllConfigs:
Description: WindowsSelfManagedADFileSystem
Value: !Ref WindowsSelfManagedADFileSystemWithAllConfigs
Export:
Name: !Sub "${PJPrefix}-fsx"