AWS AWSEC2 documentation change
Summary
Restructured documentation to separate Linux/Windows AMI listing instructions, added PowerShell examples, and expanded launch instance guidance with parameter syntax details
Security assessment
The changes focus on improving documentation structure, adding PowerShell examples, and clarifying parameter usage. No security vulnerabilities, patches, or security-specific guidance were introduced. The mention of security groups in launch examples references existing parameters without new security context.
Diff
diff --git a/AWSEC2/latest/UserGuide/finding-an-ami-parameter-store.md b/AWSEC2/latest/UserGuide/finding-an-ami-parameter-store.md index 2d416d20c..abbf57a16 100644 --- a//AWSEC2/latest/UserGuide/finding-an-ami-parameter-store.md +++ b//AWSEC2/latest/UserGuide/finding-an-ami-parameter-store.md @@ -4,0 +5,2 @@ +List the Amazon Linux AMIsList the Windows AMIsLaunch an instance using a public parameter + @@ -18 +20,6 @@ The public parameters are available from the following paths: -###### To view a list of all the Linux or Windows AMIs in the current AWS Region +For more information, see [Working with public parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-public-parameters.html) in the _AWS Systems Manager User Guide_. + +## List the Amazon Linux AMIs + +AWS CLI + @@ -20 +27 @@ The public parameters are available from the following paths: -Use the following [get-parameters-by-path](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/get-parameters-by-path.html) command to view a list of all the Linux or Windows AMIs in the current AWS Region. The value for the `--path` parameter is different for Linux and Windows. +###### To list the Linux AMIs in the current AWS Region @@ -22 +29 @@ Use the following [get-parameters-by-path](https://awscli.amazonaws.com/v2/docum -For Linux: +Use the following [get-parameters-by-path](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/get-parameters-by-path.html) command. The value for the `--path` parameter is specific to Linux AMIs. @@ -29 +36,20 @@ For Linux: -For Windows: +PowerShell + + +###### To list the Linux AMIs in the current AWS Region + +Use the [Get-SSMParametersByPath](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-SSMParametersByPath.html) cmdlet. + + + Get-SSMParametersByPath ` + -Path "/aws/service/ami-amazon-linux-latest" | ` + Sort-Object Name | Format-Table Name + +## List the Windows AMIs + +AWS CLI + + +###### To list the Windows AMIs in the current AWS Region + +Use the following [get-parameters-by-path](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/get-parameters-by-path.html) command. The value for the `--path` parameter is specific to Windows AMIs. @@ -35,0 +62,19 @@ For Windows: +PowerShell + + +###### To list the Windows AMIs in the current AWS Region + +Use the [Get-SSMParametersByPath](https://docs.aws.amazon.com/powershell/latest/reference/items/Get-SSMParametersByPath.html) cmdlet. + + + Get-SSMParametersByPath ` + -Path "/aws/service/ami-windows-latest" | ` + Sort-Object Name | Format-Table Name + +## Launch an instance using a public parameter + +To specify the public parameter when launching an instance, use the following syntax: `resolve:ssm:`public-parameter``, where `resolve:ssm` is the standard prefix and ``public-parameter`` is the path and name of the public parameter. + +AWS CLI + + @@ -38 +83 @@ For Windows: -The following example specifies a Systems Manager public parameter for the image ID to launch an instance using the latest Amazon Linux 2023 AMI. +Use the [run-instances](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/run-instances.html) command with the `--image-id` option. This example specifies a Systems Manager public parameter for the image ID to launch an instance using the latest Amazon Linux 2023 AMI @@ -40 +84,0 @@ The following example specifies a Systems Manager public parameter for the image -To specify the parameter in the command, use the following syntax: `resolve:ssm:`public-parameter``, where `resolve:ssm` is the standard prefix and ``public-parameter`` is the path and name of the public parameter. @@ -42 +86 @@ To specify the parameter in the command, use the following syntax: `resolve:ssm: -In this example, the `--count` and `--security-group` parameters are not included. For `--count`, the default is 1. If you have a default VPC and a default security group, they are used. + --image-id resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 @@ -43,0 +88 @@ In this example, the `--count` and `--security-group` parameters are not include +PowerShell @@ -45,4 +89,0 @@ In this example, the `--count` and `--security-group` parameters are not include - aws ec2 run-instances \ - --image-id resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64 \ - --instance-type m5.xlarge \ - --key-name MyKeyPair @@ -50 +91,6 @@ In this example, the `--count` and `--security-group` parameters are not include -For more information, see [Working with public parameters](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-public-parameters.html) in the _AWS Systems Manager User Guide_. +###### To launch an instance using a public parameter + +Use the [New-EC2Instance](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2Instance.html) cmdlet with the `-ImageId` parameter. This example specifies a Systems Manager public parameter for the image ID to launch an instance using the latest AMI for Windows Server 2022. + + + -ImageId "resolve:ssm:/aws/service/ami-windows-latest/Windows_Server-2022-English-Full-Base" @@ -52 +98 @@ For more information, see [Working with public parameters](https://docs.aws.amaz -For examples that use Systems Manager parameters, see [Query for the latest Amazon Linux AMI IDs Using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/) and [Query for the Latest Windows AMI Using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/). +For more examples that use Systems Manager parameters, see [Query for the latest Amazon Linux AMI IDs Using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/compute/query-for-the-latest-amazon-linux-ami-ids-using-aws-systems-manager-parameter-store/) and [Query for the Latest Windows AMI Using AWS Systems Manager Parameter Store](https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/).