UpdateSecurityGroupRuleDescriptionsIngressCommand

Updates the description of an ingress (inbound) 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.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EC2Client, UpdateSecurityGroupRuleDescriptionsIngressCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, UpdateSecurityGroupRuleDescriptionsIngressCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // UpdateSecurityGroupRuleDescriptionsIngressRequest
  DryRun: true || false,
  GroupId: "STRING_VALUE",
  GroupName: "STRING_VALUE",
  IpPermissions: [ // IpPermissionList
    { // IpPermission
      IpProtocol: "STRING_VALUE",
      FromPort: Number("int"),
      ToPort: Number("int"),
      UserIdGroupPairs: [ // UserIdGroupPairList
        { // UserIdGroupPair
          Description: "STRING_VALUE",
          UserId: "STRING_VALUE",
          GroupName: "STRING_VALUE",
          GroupId: "STRING_VALUE",
          VpcId: "STRING_VALUE",
          VpcPeeringConnectionId: "STRING_VALUE",
          PeeringStatus: "STRING_VALUE",
        },
      ],
      IpRanges: [ // IpRangeList
        { // IpRange
          Description: "STRING_VALUE",
          CidrIp: "STRING_VALUE",
        },
      ],
      Ipv6Ranges: [ // Ipv6RangeList
        { // Ipv6Range
          Description: "STRING_VALUE",
          CidrIpv6: "STRING_VALUE",
        },
      ],
      PrefixListIds: [ // PrefixListIdList
        { // PrefixListId
          Description: "STRING_VALUE",
          PrefixListId: "STRING_VALUE",
        },
      ],
    },
  ],
  SecurityGroupRuleDescriptions: [ // SecurityGroupRuleDescriptionList
    { // SecurityGroupRuleDescription
      SecurityGroupRuleId: "STRING_VALUE",
      Description: "STRING_VALUE",
    },
  ],
};
const command = new UpdateSecurityGroupRuleDescriptionsIngressCommand(input);
const response = await client.send(command);
// { // UpdateSecurityGroupRuleDescriptionsIngressResult
//   Return: true || false,
// };

Example Usage

 Loading code editor

UpdateSecurityGroupRuleDescriptionsIngressCommand Input

Parameter
Type
Description
DryRun
boolean | undefined

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.

GroupId
string | undefined

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.

GroupName
string | undefined

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

IpPermissions
IpPermission[] | undefined

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

SecurityGroupRuleDescriptions
SecurityGroupRuleDescription[] | undefined

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

UpdateSecurityGroupRuleDescriptionsIngressCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Return
boolean | undefined

Returns true if the request succeeds; otherwise, returns an error.

Throws

Name
Fault
Details
EC2ServiceException
Base exception class for all service exceptions from EC2 service.