Skip to content

update_security_group_rule_descriptions_egress async

update_security_group_rule_descriptions_egress(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    group_id: Optional[SecurityGroupId] = None,
    group_name: Optional[SecurityGroupName] = None,
    ip_permissions: Optional[IpPermissionList] = None,
    security_group_rule_descriptions: Optional[SecurityGroupRuleDescriptionList] = None,
) -> UpdateSecurityGroupRuleDescriptionsEgressResult

Updates the description of an egress (outbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously. You can remove a description for a security group rule by omitting the description parameter in the request.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • group_id (Optional[SecurityGroupId], default: None ) –

    The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.

  • group_name (Optional[SecurityGroupName], default: None ) –

    [Default VPC] The name of the security group. You must specify either the security group ID or the security group name.

  • ip_permissions (Optional[IpPermissionList], default: None ) –

    The IP permissions for the security group rule. You must specify either the IP permissions or the description.

  • security_group_rule_descriptions (Optional[SecurityGroupRuleDescriptionList], default: None ) –

    The description for the egress security group rules. You must specify either the description or the IP permissions.

Raises:

Examples:

To update an outbound security group rule description This example updates the description for the specified security group rule.

>>> await client.update_security_group_rule_descriptions_egress(group_id='sg-123abc12', ip_permissions=[{'IpProtocol': 'tcp', 'FromPort': 80, 'ToPort': 80, 'IpRanges': [{'CidrIp': '203.0.113.0/24', 'Description': 'Outbound HTTP access to server 2'}]}])
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def update_security_group_rule_descriptions_egress(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    group_id: Optional["capo_ec2.types.security_group_id.SecurityGroupId"] = None,
    group_name: Optional[
        "capo_ec2.types.security_group_name.SecurityGroupName"
    ] = None,
    ip_permissions: Optional[
        "capo_ec2.types.ip_permission_list.IpPermissionList"
    ] = None,
    security_group_rule_descriptions: Optional[
        "capo_ec2.types.security_group_rule_description_list.SecurityGroupRuleDescriptionList"
    ] = None,
) -> "capo_ec2.types.update_security_group_rule_descriptions_egress_result.UpdateSecurityGroupRuleDescriptionsEgressResult":
    """<p>Updates the description of an egress (outbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously. You can remove a description for a security group rule by omitting the description parameter in the request.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        group_id: <p>The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.</p>
        group_name: <p>[Default VPC] The name of the security group. You must specify either the security group ID or the security group name.</p>
        ip_permissions: <p>The IP permissions for the security group rule. You must specify either the IP permissions or the description.</p>
        security_group_rule_descriptions: <p>The description for the egress security group rules. You must specify either the description or the IP permissions.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update an outbound security group rule description
        This example updates the description for the specified security group rule.

        >>> await client.update_security_group_rule_descriptions_egress(group_id='sg-123abc12', ip_permissions=[{'IpProtocol': 'tcp', 'FromPort': 80, 'ToPort': 80, 'IpRanges': [{'CidrIp': '203.0.113.0/24', 'Description': 'Outbound HTTP access to server 2'}]}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.update_security_group_rule_descriptions_egress_request.UpdateSecurityGroupRuleDescriptionsEgressRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.update_security_group_rule_descriptions_egress_result.UpdateSecurityGroupRuleDescriptionsEgressResult"
    ]:
        import capo_ec2._operations.amazon_ec2.update_security_group_rule_descriptions_egress

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.update_security_group_rule_descriptions_egress.async_update_security_group_rule_descriptions_egress(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateSecurityGroupRuleDescriptionsEgress"),
    )
    input_: capo_ec2.types.update_security_group_rule_descriptions_egress_request.UpdateSecurityGroupRuleDescriptionsEgressRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if group_id is not None:
        input_["group_id"] = group_id
    if group_name is not None:
        input_["group_name"] = group_name
    if ip_permissions is not None:
        input_["ip_permissions"] = ip_permissions
    if security_group_rule_descriptions is not None:
        input_["security_group_rule_descriptions"] = (
            security_group_rule_descriptions
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output