:doc:`Redshift <../../redshift>` / Client / create_cluster_security_group

*****************************
create_cluster_security_group
*****************************



.. py:method:: Redshift.Client.create_cluster_security_group(**kwargs)

  

  Creates a new Amazon Redshift security group. You use security groups to control access to non-VPC clusters.

   

  For information about managing security groups, go to `Amazon Redshift Cluster Security Groups <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html>`__ in the *Amazon Redshift Cluster Management Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateClusterSecurityGroup>`_  


  **Request Syntax**
  ::

    response = client.create_cluster_security_group(
        ClusterSecurityGroupName='string',
        Description='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ClusterSecurityGroupName: string
  :param ClusterSecurityGroupName: **[REQUIRED]** 

    The name for the security group. Amazon Redshift stores the value as a lowercase string.

     

    Constraints:

     

    
    * Must contain no more than 255 alphanumeric characters or hyphens.
     
    * Must not be "Default".
     
    * Must be unique for all security groups that are created by your Amazon Web Services account.
    

     

    Example: ``examplesecuritygroup``

    

  
  :type Description: string
  :param Description: **[REQUIRED]** 

    A description for the security group.

    

  
  :type Tags: list
  :param Tags: 

    A list of tag instances.

    

  
    - *(dict) --* 

      A tag consisting of a name/value pair for a resource.

      

    
      - **Key** *(string) --* 

        The key, or name, for the resource tag.

        

      
      - **Value** *(string) --* 

        The value for the resource tag.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'ClusterSecurityGroup': {
              'ClusterSecurityGroupName': 'string',
              'Description': 'string',
              'EC2SecurityGroups': [
                  {
                      'Status': 'string',
                      'EC2SecurityGroupName': 'string',
                      'EC2SecurityGroupOwnerId': 'string',
                      'Tags': [
                          {
                              'Key': 'string',
                              'Value': 'string'
                          },
                      ]
                  },
              ],
              'IPRanges': [
                  {
                      'Status': 'string',
                      'CIDRIP': 'string',
                      'Tags': [
                          {
                              'Key': 'string',
                              'Value': 'string'
                          },
                      ]
                  },
              ],
              'Tags': [
                  {
                      'Key': 'string',
                      'Value': 'string'
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ClusterSecurityGroup** *(dict) --* 

        Describes a security group.

        
        

        - **ClusterSecurityGroupName** *(string) --* 

          The name of the cluster security group to which the operation was applied.

          
        

        - **Description** *(string) --* 

          A description of the security group.

          
        

        - **EC2SecurityGroups** *(list) --* 

          A list of EC2 security groups that are permitted to access clusters associated with this cluster security group.

          
          

          - *(dict) --* 

            Describes an Amazon EC2 security group.

            
            

            - **Status** *(string) --* 

              The status of the EC2 security group.

              
            

            - **EC2SecurityGroupName** *(string) --* 

              The name of the EC2 Security Group.

              
            

            - **EC2SecurityGroupOwnerId** *(string) --* 

              The Amazon Web Services account ID of the owner of the EC2 security group specified in the ``EC2SecurityGroupName`` field.

              
            

            - **Tags** *(list) --* 

              The list of tags for the EC2 security group.

              
              

              - *(dict) --* 

                A tag consisting of a name/value pair for a resource.

                
                

                - **Key** *(string) --* 

                  The key, or name, for the resource tag.

                  
                

                - **Value** *(string) --* 

                  The value for the resource tag.

                  
            
          
        
      
        

        - **IPRanges** *(list) --* 

          A list of IP ranges (CIDR blocks) that are permitted to access clusters associated with this cluster security group.

          
          

          - *(dict) --* 

            Describes an IP range used in a security group.

            
            

            - **Status** *(string) --* 

              The status of the IP range, for example, "authorized".

              
            

            - **CIDRIP** *(string) --* 

              The IP range in Classless Inter-Domain Routing (CIDR) notation.

              
            

            - **Tags** *(list) --* 

              The list of tags for the IP range.

              
              

              - *(dict) --* 

                A tag consisting of a name/value pair for a resource.

                
                

                - **Key** *(string) --* 

                  The key, or name, for the resource tag.

                  
                

                - **Value** *(string) --* 

                  The value for the resource tag.

                  
            
          
        
      
        

        - **Tags** *(list) --* 

          The list of tags for the cluster security group.

          
          

          - *(dict) --* 

            A tag consisting of a name/value pair for a resource.

            
            

            - **Key** *(string) --* 

              The key, or name, for the resource tag.

              
            

            - **Value** *(string) --* 

              The value for the resource tag.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`Redshift.Client.exceptions.ClusterSecurityGroupAlreadyExistsFault`

  
  *   :py:class:`Redshift.Client.exceptions.ClusterSecurityGroupQuotaExceededFault`

  
  *   :py:class:`Redshift.Client.exceptions.TagLimitExceededFault`

  
  *   :py:class:`Redshift.Client.exceptions.InvalidTagFault`

  