私の戦闘力は53万です

awsとgcpについて書きます

AWS fsx for windows (自己所有AD)の事前のAD設定メモ

FSXを自己所有のADで作成する際、AD側で何をすれば良いのかが AWSのドキュメントを見ても、いまいち分かりにくかったです。 docs.aws.amazon.com aws.amazon.com 上記を見ながら作業をしてみたところ正常動作でき、 作業をより分かりやすく残しておきたいと思い、 備忘メモとしてブログ化します。

ADの事前設定

ADでOU、グループ、ユーザを作成

まず、AD側の手順として、下記を作成します。

設定項目 設定値
OU FileSystems
UserName fsxservice
FileSystemAdministratorsGroup FSXAdmins
Password 適当

「dsa.msc」を開く f:id:remmemento:20210119005924p:plain OUを「FileSystems」で作成します。 f:id:remmemento:20210119005945p:plain

FileSystemsの中にユーザ、グループを作成します f:id:remmemento:20210119010841p:plain f:id:remmemento:20210119010821p:plain

その後、上記で作成したOUに権限を移譲します。
作成したOUで右クリックDelegate Controlを選択 f:id:remmemento:20210119010105p:plain

「FSXAdmins」を指定 f:id:remmemento:20210119010133p:plain

「Create a custom task to delegate」を選択します。 f:id:remmemento:20210119012129p:plain

「Only the following objects in the folder」を選択し
「Computer objects」を選択します。
下記2つを選択します。

  • 「Create selected objects in this folder」

  • 「Delete selected objects in this folder」 f:id:remmemento:20210119011043p:plain

さらに次の画面で下記を選択します。

  1. Reset Password
  2. Read and write Account Restriction
  3. Validated write to DNS host name
  4. Validated write to service principal name

f:id:remmemento:20210119012328p:plain

以上でAD側の作業は完了です。

fsxを作成する

上記が作成できましたら、fsxを作成します。 cloudformationを作りました。

AWSTemplateFormatVersion: "2010-09-09"
Description: A templete for fsx for windows
Parameters:
  EnvPrefix:
    Type: String
    Default: "test"
  # KmsKeyId:
  #   Type: String
  StorageCapacity:
    Type: Number
    Default : 32
  VPCId:
    Type: AWS::EC2::VPC::Id
    Default: vpc-xxxxxxxxxxx
  SubnetIds:
    Type: List<AWS::EC2::Subnet::Id>
    Default: subnet-xxxxxxxxxxx
  DailyAutomaticBackupStartTime:
    Type: String
    Default: "16:00"
  DeploymentType:
    Type: String
    Default: SINGLE_AZ_2
    # Default: MULTI_AZ_1
  ThroughputCapacity:
    Type: Number
    Default : 8
  WeeklyMaintenanceStartTime:
    Type: String
    Default: "6:17:00"
    
  OnpreDNS:
    Type: CommaDelimitedList
    Default: xxx.xxx.xxx.xxx
  OnpreDomainName:
    Type: String
    Default: fsx-test.local
  FileSystemAdministratorsGroup:
    Type: String
    Default: FSXAdmins
  UserName:
    Type: String
    Default: fsxservice
#本当はパラメータストア等を参照するのが良いです
  Password: 
    Type: String
    Default: xxxxxxxxxxxxxx
    NoEcho: True
  OrganizationalUnitDistinguishedName:
    Type: String
    Default: "OU=FileSystems,DC=fsx-test,DC=local"
  FSXAllowedRange:
    Type: String
    Default: xx.xx.xx.xx/xx
   

Resources :
  fsx:
    Type: AWS::FSx::FileSystem
    Properties: 
      # BackupId: String
      # KmsKeyId: kms
      # LustreConfiguration: 
      #   LustreConfiguration
      FileSystemType: WINDOWS
      SecurityGroupIds: 
        - !Ref sg
      StorageCapacity: !Ref StorageCapacity
      StorageType: SSD
      # StorageType: HDD
      # The StorageCapacity specified is not supported. Storage capacity for HDD must be no less than 2000
      SubnetIds: !Ref SubnetIds
      WindowsConfiguration: 
        # ActiveDirectoryId: !Ref ActiveDirectoryId
        AutomaticBackupRetentionDays: 7
        CopyTagsToBackups: true
        DailyAutomaticBackupStartTime: !Ref DailyAutomaticBackupStartTime
        DeploymentType: !Ref DeploymentType
        # PreferredSubnetId: String
        SelfManagedActiveDirectoryConfiguration: 
          DnsIps: !Ref OnpreDNS
          DomainName: !Ref OnpreDomainName
          FileSystemAdministratorsGroup: !Ref FileSystemAdministratorsGroup
          OrganizationalUnitDistinguishedName: !Ref OrganizationalUnitDistinguishedName
          Password: !Ref Password
          UserName: !Ref UserName
        ThroughputCapacity: !Ref ThroughputCapacity
        WeeklyMaintenanceStartTime: !Ref WeeklyMaintenanceStartTime

  sg:
    Type: AWS::EC2::SecurityGroup
    Properties: 
      GroupDescription: !Sub ${EnvPrefix}-sg
      GroupName: !Sub ${EnvPrefix}-sg
      VpcId: !Ref VPCId
      SecurityGroupIngress:
        -
          CidrIp: !Ref FSXAllowedRange
          FromPort: 445
          ToPort: 445
          IpProtocol: tcp
        -
          CidrIp: !Ref FSXAllowedRange
          FromPort: 5985
          ToPort: 5985
          IpProtocol: tcp
      Tags:
        -
          Key: Name
          Value: FSX