createClusterSecurityGroup method
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 in the Amazon Redshift Cluster Management Guide.
May throw ClusterSecurityGroupAlreadyExistsFault. May throw ClusterSecurityGroupQuotaExceededFault. May throw TagLimitExceededFault. May throw InvalidTagFault.
Parameter clusterSecurityGroupName
:
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 AWS account.
examplesecuritygroup
Parameter description
:
A description for the security group.
Parameter tags
:
A list of tag instances.
Implementation
Future<CreateClusterSecurityGroupResult> createClusterSecurityGroup({
required String clusterSecurityGroupName,
required String description,
List<Tag>? tags,
}) async {
ArgumentError.checkNotNull(
clusterSecurityGroupName, 'clusterSecurityGroupName');
_s.validateStringLength(
'clusterSecurityGroupName',
clusterSecurityGroupName,
0,
2147483647,
isRequired: true,
);
ArgumentError.checkNotNull(description, 'description');
_s.validateStringLength(
'description',
description,
0,
2147483647,
isRequired: true,
);
final $request = <String, dynamic>{};
$request['ClusterSecurityGroupName'] = clusterSecurityGroupName;
$request['Description'] = description;
tags?.also((arg) => $request['Tags'] = arg);
final $result = await _protocol.send(
$request,
action: 'CreateClusterSecurityGroup',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateClusterSecurityGroupMessage'],
shapes: shapes,
resultWrapper: 'CreateClusterSecurityGroupResult',
);
return CreateClusterSecurityGroupResult.fromXml($result);
}