Skip to content

describe_cluster_security_groups

describe_cluster_security_groups(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_security_group_name: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    tag_keys: Optional[TagKeyList] = None,
    tag_values: Optional[TagValueList] = None,
) -> ClusterSecurityGroupMessage

Returns information about Amazon Redshift security groups. If the name of a security group is specified, the response will contain only information about only that security group.

For information about managing security groups, go to Amazon Redshift Cluster Security Groups in the Amazon Redshift Cluster Management Guide.

If you specify both tag keys and tag values in the same request, Amazon Redshift returns all security groups that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all security groups that have any combination of those values are returned.

If both tag keys and values are omitted from the request, security groups are returned regardless of whether they have tag keys or values associated with them.

Parameters:

  • cluster_security_group_name (Optional[String], default: None ) –

    The name of a cluster security group for which you are requesting details. You must specify either the Marker parameter or a ClusterSecurityGroupName parameter, but not both.

    Example: securitygroup1

  • max_records (Optional[IntegerOptional], default: None ) –

    The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.

    Default: 100

    Constraints: minimum 20, maximum 100.

  • marker (Optional[String], default: None ) –

    An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeClusterSecurityGroups request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.

    Constraints: You must specify either the ClusterSecurityGroupName parameter or the Marker parameter, but not both.

  • tag_keys (Optional[TagKeyList], default: None ) –

    A tag key or keys for which you want to return all matching cluster security groups that are associated with the specified key or keys. For example, suppose that you have security groups that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the security groups that have either or both of these tag keys associated with them.

  • tag_values (Optional[TagValueList], default: None ) –

    A tag value or values for which you want to return all matching cluster security groups that are associated with the specified tag value or values. For example, suppose that you have security groups that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the security groups that have either or both of these tag values associated with them.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def describe_cluster_security_groups(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_security_group_name: Optional[
        "capo_redshift.types.string.String"
    ] = None,
    max_records: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_redshift.types.string.String"] = None,
    tag_keys: Optional["capo_redshift.types.tag_key_list.TagKeyList"] = None,
    tag_values: Optional["capo_redshift.types.tag_value_list.TagValueList"] = None,
) -> (
    "capo_redshift.types.cluster_security_group_message.ClusterSecurityGroupMessage"
):
    """<p>Returns information about Amazon Redshift security groups. If the name of a security group is specified, the response will contain only information about only that security group.</p> <p> For information about managing security groups, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html">Amazon Redshift Cluster Security Groups</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p> <p>If you specify both tag keys and tag values in the same request, Amazon Redshift returns all security groups that match any combination of the specified keys and values. For example, if you have <code>owner</code> and <code>environment</code> for tag keys, and <code>admin</code> and <code>test</code> for tag values, all security groups that have any combination of those values are returned.</p> <p>If both tag keys and values are omitted from the request, security groups are returned regardless of whether they have tag keys or values associated with them.</p>

    Args:
        cluster_security_group_name: <p>The name of a cluster security group for which you are requesting details. You must specify either the <b>Marker</b> parameter or a <b>ClusterSecurityGroupName</b> parameter, but not both. </p> <p> Example: <code>securitygroup1</code> </p>
        max_records: <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. </p> <p>Default: <code>100</code> </p> <p>Constraints: minimum 20, maximum 100.</p>
        marker: <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <a>DescribeClusterSecurityGroups</a> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request. </p> <p>Constraints: You must specify either the <b>ClusterSecurityGroupName</b> parameter or the <b>Marker</b> parameter, but not both. </p>
        tag_keys: <p>A tag key or keys for which you want to return all matching cluster security groups that are associated with the specified key or keys. For example, suppose that you have security groups that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the security groups that have either or both of these tag keys associated with them.</p>
        tag_values: <p>A tag value or values for which you want to return all matching cluster security groups that are associated with the specified tag value or values. For example, suppose that you have security groups that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the security groups that have either or both of these tag values associated with them.</p>

    Raises:
        capo_redshift.errors.cluster_security_group_not_found_fault.ClusterSecurityGroupNotFoundFault: <p>The cluster security group name does not refer to an existing cluster security group.</p>
        capo_redshift.errors.invalid_tag_fault.InvalidTagFault: <p>The tag is invalid.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.describe_cluster_security_groups_message.DescribeClusterSecurityGroupsMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.cluster_security_group_message.ClusterSecurityGroupMessage"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.describe_cluster_security_groups

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.describe_cluster_security_groups.describe_cluster_security_groups(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeClusterSecurityGroups")
    )
    input_: capo_redshift.types.describe_cluster_security_groups_message.DescribeClusterSecurityGroupsMessage = {}
    if cluster_security_group_name is not None:
        input_["cluster_security_group_name"] = cluster_security_group_name
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys
    if tag_values is not None:
        input_["tag_values"] = tag_values

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output