AWS code-library documentation change
Summary
Added PowerShell V5 examples for updating security group rule descriptions
Security assessment
Focuses on maintaining security group rule metadata which improves security hygiene, but doesn't address a specific vulnerability.
Diff
diff --git a/code-library/latest/ug/ec2_example_ec2_UpdateSecurityGroupRuleDescriptionsIngress_section.md b/code-library/latest/ug/ec2_example_ec2_UpdateSecurityGroupRuleDescriptionsIngress_section.md index 024414ccd..e4f879b5e 100644 --- a//code-library/latest/ug/ec2_example_ec2_UpdateSecurityGroupRuleDescriptionsIngress_section.md +++ b//code-library/latest/ug/ec2_example_ec2_UpdateSecurityGroupRuleDescriptionsIngress_section.md @@ -95,0 +96,33 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: Updates the description of an existing ingress (inbound) security group rule.** + + + $existingInboundRule = Get-EC2SecurityGroupRule -SecurityGroupRuleId "sgr-1234567890" + $ruleWithUpdatedDescription = [Amazon.EC2.Model.SecurityGroupRuleDescription]@{ + "SecurityGroupRuleId" = $existingInboundRule.SecurityGroupRuleId + "Description" = "Updated rule description" + } + + Update-EC2SecurityGroupRuleIngressDescription -GroupId $existingInboundRule.GroupId -SecurityGroupRuleDescription $ruleWithUpdatedDescription + + + +**Example 2: Removes the description of an existing ingress (inbound) security group rule (by omitting the parameter in the request).** + + + $existingInboundRule = Get-EC2SecurityGroupRule -SecurityGroupRuleId "sgr-1234567890" + $ruleWithoutDescription = [Amazon.EC2.Model.SecurityGroupRuleDescription]@{ + "SecurityGroupRuleId" = $existingInboundRule.SecurityGroupRuleId + } + + Update-EC2SecurityGroupRuleIngressDescription -GroupId $existingInboundRule.GroupId -SecurityGroupRuleDescription $ruleWithoutDescription + + + + * For API details, see [UpdateSecurityGroupRuleDescriptionsIngress](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +