AWS AWSEC2 documentation change
Summary
Restructured AMI billing documentation with updated console/AWS CLI instructions, added PowerShell examples, and simplified output formatting
Security assessment
Changes focus on improving billing information clarity and adding PowerShell support. No security vulnerabilities or security features are mentioned. Modifications are procedural improvements for accessing billing metadata rather than security controls.
Diff
diff --git a/AWSEC2/latest/UserGuide/view-billing-info.md b/AWSEC2/latest/UserGuide/view-billing-info.md index 85bbafe60..162f7bbdf 100644 --- a//AWSEC2/latest/UserGuide/view-billing-info.md +++ b//AWSEC2/latest/UserGuide/view-billing-info.md @@ -5,2 +4,0 @@ -Find AMI billing information (console)Find AMI billing information (AWS CLI) - @@ -9,3 +7 @@ Find AMI billing information (console)Find AMI billing information (AWS CLI) -In the Amazon EC2 console, you can view the AMI billing information from the **AMIs** page or from the **Instances** page. You can also find billing information using the AWS CLI or the instance metadata service. - -The following fields can help you verify AMI charges on your bill: +The following properties can help you verify AMI charges on your bill: @@ -22 +18 @@ The following fields can help you verify AMI charges on your bill: -## Find AMI billing information (console) +Console @@ -24 +19,0 @@ The following fields can help you verify AMI charges on your bill: -Follow these steps to view AMI billing information in the Amazon EC2 console: @@ -26 +21 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: -###### Look up AMI billing information from the **AMIs** page +###### To find the AMI billing information for an AMI @@ -30 +25 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: - 2. In the navigation pane, choose **AMIs** , and then select an AMI. + 2. In the navigation pane, choose **AMIs**. @@ -32 +27 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: - 3. On the **Details** tab, check the values for **Platform details** and **Usage operation**. + 3. Select the AMI. @@ -33,0 +29 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: + 4. On the **Details** tab, find **Platform details** and **Usage operation**. @@ -37 +33,2 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: -###### Look up AMI billing information from the **Instances** page + +###### To find the AMI billing information for an instance @@ -41 +38 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: - 2. In the navigation pane, choose **Instances** , and then select an instance. + 2. In the navigation pane, choose **Instances**. @@ -43 +40 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: - 3. On the **Details** tab (or the **Description** tab if you are using the prior version of the console), check the values for **Platform details** and **Usage operation**. + 3. Select the instance. @@ -44,0 +42 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: + 4. On the **Details** tab, expand **Instance details** and find **Platform details** and **Usage operation**. @@ -48 +45,0 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: -## Find AMI billing information (AWS CLI) @@ -50 +47 @@ Follow these steps to view AMI billing information in the Amazon EC2 console: -To find the AMI billing information using the AWS CLI, you need to know the AMI ID. If you don't know the AMI ID, you can get it from the instance using the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instances.html) command. +AWS CLI @@ -52 +48,0 @@ To find the AMI billing information using the AWS CLI, you need to know the AMI -###### To find the AMI ID @@ -54 +50 @@ To find the AMI billing information using the AWS CLI, you need to know the AMI -If you know the instance ID, you can get the AMI ID for the instance by using the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instances.html) command. The `--query` option displays only the value of `ImageId` in the output. +###### To find the AMI billing information for an AMI @@ -55,0 +52 @@ If you know the instance ID, you can get the AMI ID for the instance by using th +Use the [describe-images](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-images.html) command. @@ -57,3 +53,0 @@ If you know the instance ID, you can get the AMI ID for the instance by using th - aws ec2 describe-instances \ - --instance-ids i-1234567890abcdef0 \ - --query Reservations[*].Instances[].ImageId @@ -61 +55,5 @@ If you know the instance ID, you can get the AMI ID for the instance by using th -The following is example output. + aws ec2 describe-images \ + --image-ids ami-0abcdef1234567890 \ + --query "Images[].{PlatformDetails:PlatformDetails,UsageOperation:UsageOperation}" + +The following is example output for a Linux AMI. @@ -65 +63,4 @@ The following is example output. - "ami-0abcdef1234567890" + { + "PlatformDetails": "Linux/UNIX", + "UsageOperation": "RunInstances" + } @@ -68 +69 @@ The following is example output. -###### To find the AMI billing information +###### To find the AMI billing information for an instance @@ -70 +71 @@ The following is example output. -If you know the AMI ID, you can use the [describe-images](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-images.html) command to get the AMI platform and usage operation details. +Use the [describe-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-instances.html) command. @@ -73 +74,3 @@ If you know the AMI ID, you can use the [describe-images](https://awscli.amazona - $ aws ec2 describe-images --image-ids ami-0abcdef1234567890 + aws ec2 describe-instances \ + --instance-ids i-1234567890abcdef0 \ + --query "Reservations[].Instances[].{PlatformDetails:PlatformDetails,UsageOperation:UsageOperation}" @@ -75 +78 @@ If you know the AMI ID, you can use the [describe-images](https://awscli.amazona -The following example output shows the `PlatformDetails` and `UsageOperation` fields. In this example, the ami-0123456789EXAMPLE platform is `Red Hat Enterprise Linux` and the usage operation and billing code is `RunInstances:0010`. +The following is example output for a Windows instance. @@ -77,0 +81 @@ The following example output shows the `PlatformDetails` and `UsageOperation` fi + [ @@ -79,32 +83,2 @@ The following example output shows the `PlatformDetails` and `UsageOperation` fi - "Images": [ - { - "VirtualizationType": "hvm", - "Description": "Provided by Red Hat, Inc.", - "Hypervisor": "xen", - "EnaSupport": true, - "SriovNetSupport": "simple", - "ImageId": "ami-0abcdef1234567890", - "State": "available", - "BlockDeviceMappings": [ - { - "DeviceName": "/dev/sda1", - "Ebs": { - "SnapshotId": "snap-111222333444aaabb", - "DeleteOnTermination": true, - "VolumeType": "gp2", - "VolumeSize": 10, - "Encrypted": false - } - } - ], - "Architecture": "x86_64", - "ImageLocation": "123456789012/RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2", - "RootDeviceType": "ebs", - "OwnerId": "123456789012", - "PlatformDetails": "Red Hat Enterprise Linux", - "UsageOperation": "RunInstances:0010", - "RootDeviceName": "/dev/sda1", - "CreationDate": "2019-05-10T13:17:12.000Z", - "Public": true, - "ImageType": "machine", - "Name": "RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2" + "PlatformDetails": "Windows", + "UsageOperation": "RunInstances:0002" @@ -113 +87,33 @@ The following example output shows the `PlatformDetails` and `UsageOperation` fi - } + +PowerShell + + +###### To find the AMI billing information for an AMI + +Use the [Get-EC2Image](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Image.html) cmdlet. + + + Get-EC2Image ` + -ImageId ami-0abcdef1234567890 | ` + Format-List PlatformDetails, UsageOperation + +The following is example output for a Linux AMI. + + + PlatformDetails : Linux/UNIX + UsageOperation : RunInstances + +###### To find the AMI billing information for an instance + +Use the [Get-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html) cmdlet. + + + (Get-EC2Instance ` + -InstanceId i-1234567890abcdef0).Instances | ` + Format-List PlatformDetails, UsageOperation + +The following is example output for a Windows instance. + + + PlatformDetails : Windows + UsageOperation : RunInstances:0002