Description:
  This template builds EFS for WordPress.

Parameters:
  WordPressEFSSecurityGroup:
    Type: String
    Description   : Please enter VPC Security Group ID for EFS.
  WordPressPrivateSubnet1:
    Type: String
    Description   : Please enter VPC private subnet1 for MountTarget.
  WordPressPrivateSubnet2:
    Type: String
    Description   : Please enter VPC private subnet2 for MountTarget.

Resources:
  WordPressEFS:
    Type: AWS::EFS::FileSystem
  WordPressEFSMountTarget1:
    Type: AWS::EFS::MountTarget
    Properties:
      FileSystemId   : !Ref WordPressEFS
      SecurityGroups :
        - !Ref WordPressEFSSecurityGroup 
      SubnetId       : !Ref WordPressPrivateSubnet1
  WordPressEFSMountTarget2:
    Type: AWS::EFS::MountTarget
    Properties:
      FileSystemId   : !Ref WordPressEFS
      SecurityGroups :
        - !Ref WordPressEFSSecurityGroup 
      SubnetId       : !Ref WordPressPrivateSubnet2

Outputs:
  WordPressEFS:
    Value: !Ref WordPressEFS
