AWS code-library documentation change
Summary
Added PowerShell V5 examples for DescribeInstanceAttribute API including security group, termination protection, and enhanced networking attributes
Security assessment
The change adds examples showing how to retrieve security-related attributes like security groups (groupSet) and termination protection (disableApiTermination). While these are security features, the change only demonstrates their retrieval rather than addressing a specific vulnerability or security incident.
Diff
diff --git a/code-library/latest/ug/ec2_example_ec2_DescribeInstanceAttribute_section.md b/code-library/latest/ug/ec2_example_ec2_DescribeInstanceAttribute_section.md index 577084d33..f8bb74469 100644 --- a//code-library/latest/ug/ec2_example_ec2_DescribeInstanceAttribute_section.md +++ b//code-library/latest/ug/ec2_example_ec2_DescribeInstanceAttribute_section.md @@ -178,0 +179,77 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example describes the instance type of the specified instance.** + + + Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceType + + +**Output:** + + + InstanceType : t2.micro + +**Example 2: This example describes whether enhanced networking is enabled for the specified instance.** + + + Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute sriovNetSupport + + +**Output:** + + + SriovNetSupport : simple + +**Example 3: This example describes the security groups for the specified instance.** + + + (Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute groupSet).Groups + + +**Output:** + + + GroupId + ------- + sg-12345678 + sg-45678901 + +**Example 4: This example describes whether EBS optimization is enabled for the specified instance.** + + + Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute ebsOptimized + + +**Output:** + + + EbsOptimized : False + +**Example 5: This example describes the 'disableApiTermination' attribute of the specified instance.** + + + Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute disableApiTermination + + +**Output:** + + + DisableApiTermination : False + +**Example 6: This example describes the 'instanceInitiatedShutdownBehavior' attribute of the specified instance.** + + + Get-EC2InstanceAttribute -InstanceId i-12345678 -Attribute instanceInitiatedShutdownBehavior + + +**Output:** + + + InstanceInitiatedShutdownBehavior : stop + + * For API details, see [DescribeInstanceAttribute](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +