templates/mssqlfsx-mad.template.yaml [1337:1414]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action:
                - iam:PassRole
              Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${AWSQuickstartSqlFSxRole}'
        PolicyName: QS-SqlFSx-SSM-PassRole
      ManagedPolicyArns:
      - "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
      Path: "/"
      AssumeRolePolicyDocument:
        Statement:
        - Action:
          - sts:AssumeRole
          Principal:
            Service:
            - ec2.amazonaws.com
          Effect: Allow
        Version: '2012-10-17'
  SqlFSxProfile:
    Type: AWS::IAM::InstanceProfile
    Properties:
      Roles:
      - Ref: SqlFSxRole
      Path: "/"
  SSMWaitHandle: 
    Type: AWS::CloudFormation::WaitConditionHandle
  SSMWaitCondition: 
    Type: AWS::CloudFormation::WaitCondition
    CreationPolicy:
      ResourceSignal:
        Timeout: PT120M
        Count: 1
    DependsOn: "SqlFSxInstance1"
    Properties: 
      Handle: 
        Ref: "SSMWaitHandle"
      Timeout: "7200"
      Count: 1
  WorkloadSecurityGroup:  
   Type: AWS::EC2::SecurityGroup
   Properties:
     GroupDescription: Allow access to the Workload instances
     VpcId:
       Ref: VPCID
     SecurityGroupIngress:
     - IpProtocol: '-1'
       FromPort: -1
       ToPort: -1
       CidrIp: 
         Ref: VPCcidr
  FSxWindowsFileSystem:
    Type: 'AWS::FSx::FileSystem'
    Properties:
      FileSystemType: WINDOWS
      StorageCapacity: 
        Ref: FileShareVolumeSize
      StorageType: SSD
      SubnetIds:
        - Ref: PrivateSubnet1ID
        - Ref: PrivateSubnet2ID
      SecurityGroupIds:
        - Ref: WorkloadSecurityGroup
        - Ref: DomainMemberSGID
      Tags:
        - Key: Name
          Value: SqlFSxFileSystem
      WindowsConfiguration:
        ThroughputCapacity: 
          Ref: FileShareThroughputCapacity
        WeeklyMaintenanceStartTime: '4:16:30'
        DailyAutomaticBackupStartTime: '01:00'
        AutomaticBackupRetentionDays: 30
        CopyTagsToBackups: false
        DeploymentType: MULTI_AZ_1
        PreferredSubnetId: 
          Ref: PrivateSubnet1ID
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



templates/mssqlfsx.template.yaml [1323:1400]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action:
                - iam:PassRole
              Resource: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${AWSQuickstartSqlFSxRole}'
        PolicyName: QS-SqlFSx-SSM-PassRole
      ManagedPolicyArns:
      - "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
      Path: "/"
      AssumeRolePolicyDocument:
        Statement:
        - Action:
          - sts:AssumeRole
          Principal:
            Service:
            - ec2.amazonaws.com
          Effect: Allow
        Version: '2012-10-17'
  SqlFSxProfile:
    Type: AWS::IAM::InstanceProfile
    Properties:
      Roles:
      - Ref: SqlFSxRole
      Path: "/"
  SSMWaitHandle: 
    Type: AWS::CloudFormation::WaitConditionHandle
  SSMWaitCondition: 
    Type: AWS::CloudFormation::WaitCondition
    CreationPolicy:
      ResourceSignal:
        Timeout: PT120M
        Count: 1
    DependsOn: "SqlFSxInstance1"
    Properties: 
      Handle: 
        Ref: "SSMWaitHandle"
      Timeout: "7200"
      Count: 1
  WorkloadSecurityGroup:  
   Type: AWS::EC2::SecurityGroup
   Properties:
     GroupDescription: Allow access to the Workload instances
     VpcId:
       Ref: VPCID
     SecurityGroupIngress:
     - IpProtocol: '-1'
       FromPort: -1
       ToPort: -1
       CidrIp: 
         Ref: VPCcidr
  FSxWindowsFileSystem:
    Type: 'AWS::FSx::FileSystem'
    Properties:
      FileSystemType: WINDOWS
      StorageCapacity: 
        Ref: FileShareVolumeSize
      StorageType: SSD
      SubnetIds:
        - Ref: PrivateSubnet1ID
        - Ref: PrivateSubnet2ID
      SecurityGroupIds:
        - Ref: WorkloadSecurityGroup
        - Ref: DomainMemberSGID
      Tags:
        - Key: Name
          Value: SqlFSxFileSystem
      WindowsConfiguration:
        ThroughputCapacity: 
          Ref: FileShareThroughputCapacity
        WeeklyMaintenanceStartTime: '4:16:30'
        DailyAutomaticBackupStartTime: '01:00'
        AutomaticBackupRetentionDays: 30
        CopyTagsToBackups: false
        DeploymentType: MULTI_AZ_1
        PreferredSubnetId: 
          Ref: PrivateSubnet1ID
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



