Class GetAmi
Inheritance
System.Object
GetAmi
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws
Assembly: Pulumi.Aws.dll
Syntax
public static class GetAmi
Methods
View SourceInvokeAsync(GetAmiArgs, InvokeOptions)
Use this data source to get the ID of a registered AMI for use in other resources.
{{% examples %}}
Example Usage
{{% example %}}
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.GetAmi.InvokeAsync(new Aws.GetAmiArgs
{
ExecutableUsers =
{
"self",
},
Filters =
{
new Aws.Inputs.GetAmiFilterArgs
{
Name = "name",
Values =
{
"myami-*",
},
},
new Aws.Inputs.GetAmiFilterArgs
{
Name = "root-device-type",
Values =
{
"ebs",
},
},
new Aws.Inputs.GetAmiFilterArgs
{
Name = "virtualization-type",
Values =
{
"hvm",
},
},
},
MostRecent = true,
NameRegex = "^myami-\\d{3}",
Owners =
{
"self",
},
}));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetAmiResult> InvokeAsync(GetAmiArgs args, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAmiArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetAmiResult> |