AWSTemplateFormatVersion: '2010-09-09'
Resources:           
  SampleAutoWLMParameterGroup:
    Type: AWS::Redshift::ClusterParameterGroup
    Properties:
      Description: "Sample auto WLM queue, for learning purpose only"
      ParameterGroupFamily: "redshift-1.0"
      ParameterGroupName: "auto-wlm-demo"
      Parameters:
        - ParameterName: enable_user_activity_logging
          ParameterValue: 'true'                    
        - ParameterName: wlm_json_configuration
          ParameterValue: "[{\"user_group\":[\"etl\"],\"query_group\":[],\"auto_wlm\":true,\"queue_type\":\"auto\",\"priority\":\"high\",\"name\":\"ETL\"},{\"user_group\":[\"bi\"],\"query_group\":[],\"auto_wlm\":true,\"queue_type\":\"auto\",\"priority\":\"low\",\"name\":\"BI\"},{\"user_group\":[],\"query_group\":[],\"user_role\":\"redshiftrole\",\"auto_wlm\":true,\"queue_type\":\"auto\",\"priority\":\"normal\",\"name\":\"RBAC\"}]"                    
  SampleManualWLMParameterGroup:
    Type: AWS::Redshift::ClusterParameterGroup
    Properties:
      Description: "Sample manual WLM queue, for learning purpose only"
      ParameterGroupFamily: "redshift-1.0"
      ParameterGroupName: "manual-wlm-demo"
      Parameters:
        - ParameterName: enable_user_activity_logging
          ParameterValue: 'true'                    
        - ParameterName: wlm_json_configuration
          ParameterValue: "[{\"user_group\":[\"etl\"],\"query_group\":[],\"query_concurrency\":9,\"memory_percent_to_use\": 60,\"name\":\"ETL\"},{\"user_group\":[\"bi\"],\"query_group\":[],\"query_concurrency\":3,\"memory_percent_to_use\": 20,\"name\":\"BI\"},{\"user_group\":[],\"query_group\":[],\"user_role\":\"redshiftrole\",\"query_concurrency\":3,\"memory_percent_to_use\": 20,\"name\":\"RBAC\"}]"                    
Outputs:
  SampleAutoWLMParameterGroupName:
    Description: "The name of sample auto wlm parameter group"
    Value: !Ref SampleAutoWLMParameterGroup 
  SampleManualWLMParameterGroupName:
    Description: "The name of sample manual wlm parameter group"
    Value: !Ref SampleManualWLMParameterGroup 