Adds an inbound (ingress) rule to an Amazon Redshift security group. Depending on whether the application accessing your cluster is running on the Internet or an Amazon EC2 instance, you can authorize inbound access to either a Classless Interdomain Routing (CIDR)/Internet Protocol (IP) range or to an Amazon EC2 security group. You can add as many as 20 ingress rules to an Amazon Redshift security group.
If you authorize access to an Amazon EC2 security group, specify EC2SecurityGroupName and EC2SecurityGroupOwnerId. The Amazon EC2 security group and Amazon Redshift cluster must be in the same Amazon Web Services Region.
If you authorize access to a CIDR/IP address range, specify CIDRIP. For an overview of CIDR blocks, see the Wikipedia article on Classless Inter-Domain Routing.
You must also associate the security group with a cluster so that clients running on these IP addresses or the EC2 instance are authorized to connect to the cluster. For information about managing security groups, go to Working with Security Groups in the Amazon Redshift Cluster Management Guide.
Parameters:
-
cluster_security_group_name
(Optional[String], default:
None
)
–
The name of the security group to which the ingress rule is added.
-
cidrip
(Optional[String], default:
None
)
–
The IP range to be added the Amazon Redshift security group.
-
ec2_security_group_name
(Optional[String], default:
None
)
–
The EC2 security group to be added the Amazon Redshift security group.
-
ec2_security_group_owner_id
(Optional[String], default:
None
)
–
The Amazon Web Services account number of the owner of the security group specified by the EC2SecurityGroupName parameter. The Amazon Web Services Access Key ID is not an acceptable value.
Example: 111122223333
Raises:
Source code in docs_src/capo_redshift/_services/async_redshift.py
| async def authorize_cluster_security_group_ingress(
self,
*,
config_overrides: Optional[AsyncRedshiftClientConfig] = None,
cluster_security_group_name: Optional[
"capo_redshift.types.string.String"
] = None,
cidrip: Optional["capo_redshift.types.string.String"] = None,
ec2_security_group_name: Optional["capo_redshift.types.string.String"] = None,
ec2_security_group_owner_id: Optional[
"capo_redshift.types.string.String"
] = None,
) -> "capo_redshift.types.authorize_cluster_security_group_ingress_result.AuthorizeClusterSecurityGroupIngressResult":
"""<p>Adds an inbound (ingress) rule to an Amazon Redshift security group. Depending on whether the application accessing your cluster is running on the Internet or an Amazon EC2 instance, you can authorize inbound access to either a Classless Interdomain Routing (CIDR)/Internet Protocol (IP) range or to an Amazon EC2 security group. You can add as many as 20 ingress rules to an Amazon Redshift security group.</p> <p>If you authorize access to an Amazon EC2 security group, specify <i>EC2SecurityGroupName</i> and <i>EC2SecurityGroupOwnerId</i>. The Amazon EC2 security group and Amazon Redshift cluster must be in the same Amazon Web Services Region. </p> <p>If you authorize access to a CIDR/IP address range, specify <i>CIDRIP</i>. For an overview of CIDR blocks, see the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">Classless Inter-Domain Routing</a>. </p> <p>You must also associate the security group with a cluster so that clients running on these IP addresses or the EC2 instance are authorized to connect to the cluster. For information about managing security groups, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html">Working with Security Groups</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
Args:
cluster_security_group_name: <p>The name of the security group to which the ingress rule is added.</p>
cidrip: <p>The IP range to be added the Amazon Redshift security group.</p>
ec2_security_group_name: <p>The EC2 security group to be added the Amazon Redshift security group.</p>
ec2_security_group_owner_id: <p>The Amazon Web Services account number of the owner of the security group specified by the <i>EC2SecurityGroupName</i> parameter. The Amazon Web Services Access Key ID is not an acceptable value. </p> <p>Example: <code>111122223333</code> </p>
Raises:
capo_redshift.errors.authorization_already_exists_fault.AuthorizationAlreadyExistsFault: <p>The specified CIDR block or EC2 security group is already authorized for the specified cluster security group.</p>
capo_redshift.errors.authorization_quota_exceeded_fault.AuthorizationQuotaExceededFault: <p>The authorization quota for the cluster security group has been reached.</p>
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_cluster_security_group_state_fault.InvalidClusterSecurityGroupStateFault: <p>The state of the cluster security group is not <code>available</code>. </p>
capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_redshift.types.authorize_cluster_security_group_ingress_message.AuthorizeClusterSecurityGroupIngressMessage]",
) -> AsyncOperationResponse[
"capo_redshift.types.authorize_cluster_security_group_ingress_result.AuthorizeClusterSecurityGroupIngressResult"
]:
import capo_redshift._operations.redshift_service_version20121201.authorize_cluster_security_group_ingress
(
output,
http_response,
) = await capo_redshift._operations.redshift_service_version20121201.authorize_cluster_security_group_ingress.async_authorize_cluster_security_group_ingress(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AuthorizeClusterSecurityGroupIngress")
)
input_: capo_redshift.types.authorize_cluster_security_group_ingress_message.AuthorizeClusterSecurityGroupIngressMessage = {}
if cluster_security_group_name is not None:
input_["cluster_security_group_name"] = cluster_security_group_name
if cidrip is not None:
input_["cidrip"] = cidrip
if ec2_security_group_name is not None:
input_["ec2_security_group_name"] = ec2_security_group_name
if ec2_security_group_owner_id is not None:
input_["ec2_security_group_owner_id"] = ec2_security_group_owner_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|