简体   繁体   English

如何使用适用于Powershell的AWS工具获得自己的AMI?

[英]How do I get my own AMIs with AWS Tools for Powershell?

I am trying out AWS Powershell tool. 我正在试用AWS Powershell工具。 What is the command to load AMI image I created in my environment? 加载我在环境中创建的AMI映像的命令是什么? Apparently get-ec2image command loads all the available image on the market, which is not what I want. 显然,get-ec2image命令加载了市场上所有可用的图像,这不是我想要的。

Get-EC2Image is what you need, you just need to set the -Owner parameter to 'self', like so: GET-EC2Image是你需要什么,你只需要在设置-Owner参数为“自我”,像这样:

PS C:/> Get-EC2Image -owner self

Here's an example where you can select your own AMIs, filtered by AMI Name (the AMI name given during image creation, not the re-assignable tag "name" ): 在下面的示例中,您可以选择自己的AMI,并按AMI名称(图像创建期间给出的AMI名称,而不是可重新分配的标签“ name” )过滤:

PS C:/> Get-EC2Image -Owners self -Filters @{ Name='name'; Values='amiName' }

From the documentation: 从文档中:

In this context, [self] refers to the user who corresponds to the credentials with which the cmdlet is invoked. 在这种情况下,[self]是指与调用cmdlet的凭据相对应的用户。

More info available at the documentation for Get-EC2Image. Get-EC2Image 文档中提供了更多信息。

The detailed syntax of the Get-EC2Image is Get-EC2Image的详细语法为

Get-EC2Image-ImageId <String[]>-Owner <String[]>-ExecutableUser <String[]>-Filter <Filter[]>

So in your case it would workout to be, assuming 123456789 being your AWS Account Number. 因此,在您的情况下,假设123456789是您的AWS帐号,就可以尝试一下。

Get-EC2Image -Owner '123456789'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让我自己的 PowerShell 脚本运行? 不断报错 - How do I get my own PowerShell script to run? Keep getting an error AWS Powershell:如何检索NextToken - AWS Powershell: How do I retrieve the NextToken 如何获取要在PowerShell脚本中使用的文件的位置? - How do I get the location of a file to use in my PowerShell script? 如何通过 AWS 工具使用来自 AzureDevops 的 Powershell 7 - How to use Powershell 7 from AzureDevops with AWS Tools 如何在 powershell Pro Tools 中为 LogonName 组合 FirstName 和 LastName? - How Do I combine FirstName and LastName for LogonName in powershell Pro Tools? 如何在Powershell中使用端口号访问自己的本地主机? - How can I access to my own localhost with port number in powershell? 如何使用 powershell 中的 AWS 工具编写 S3 Object 并使用 md5checksum 进行验证 - How do you Write an S3 Object using AWS Tools in powershell and verify using an md5checksum 如何在 AWS CLI 命令中使用 powershell 变量 - how do I use powershell variable in AWS CLI command 如何在Powershell中断开网络驱动器? - How do I get disconnected networkdrives in Powershell? 如何获取由另一个 Powershell 进程打开的 Powershell 进程? - How do I get a Powershell process that was opened by another Powershell process?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM