-
Notifications
You must be signed in to change notification settings - Fork 151
/
getAmiIds.go
84 lines (79 loc) · 2.83 KB
/
getAmiIds.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ec2
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get a list of AMI IDs matching the specified criteria.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ec2.GetAmiIds(ctx, &ec2.GetAmiIdsArgs{
// Filters: []ec2.GetAmiIdsFilter{
// ec2.GetAmiIdsFilter{
// Name: "name",
// Values: []string{
// "ubuntu/images/ubuntu-*-*-amd64-server-*",
// },
// },
// },
// Owners: []string{
// "099720109477",
// },
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetAmiIds(ctx *pulumi.Context, args *GetAmiIdsArgs, opts ...pulumi.InvokeOption) (*GetAmiIdsResult, error) {
var rv GetAmiIdsResult
err := ctx.Invoke("aws:ec2/getAmiIds:getAmiIds", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAmiIds.
type GetAmiIdsArgs struct {
// Limit search to users with *explicit* launch
// permission on the image. Valid items are the numeric account ID or `self`.
ExecutableUsers []string `pulumi:"executableUsers"`
// One or more name/value pairs to filter off of. There
// are several valid keys, for a full reference, check out
// [describe-images in the AWS CLI reference][1].
Filters []GetAmiIdsFilter `pulumi:"filters"`
// A regex string to apply to the AMI list returned
// by AWS. This allows more advanced filtering not supported from the AWS API.
// This filtering is done locally on what AWS returns, and could have a performance
// impact if the result is large. It is recommended to combine this with other
// options to narrow down the list AWS returns.
NameRegex *string `pulumi:"nameRegex"`
// List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`).
Owners []string `pulumi:"owners"`
// Used to sort AMIs by creation time.
SortAscending *bool `pulumi:"sortAscending"`
}
// A collection of values returned by getAmiIds.
type GetAmiIdsResult struct {
ExecutableUsers []string `pulumi:"executableUsers"`
Filters []GetAmiIdsFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Ids []string `pulumi:"ids"`
NameRegex *string `pulumi:"nameRegex"`
Owners []string `pulumi:"owners"`
SortAscending *bool `pulumi:"sortAscending"`
}