/
getPackerIteration.go
186 lines (160 loc) · 7.13 KB
/
getPackerIteration.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package hcp
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Packer Image data source iteration gets the most recent iteration (or build) of an image, given a channel.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/grapl-security/pulumi-hcp/sdk/go/hcp"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := hcp.GetPackerIteration(ctx, &GetPackerIterationArgs{
// BucketName: "hardened-ubuntu-16-04",
// Channel: "megan-test",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetPackerIteration(ctx *pulumi.Context, args *GetPackerIterationArgs, opts ...pulumi.InvokeOption) (*GetPackerIterationResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetPackerIterationResult
err := ctx.Invoke("hcp:index/getPackerIteration:getPackerIteration", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getPackerIteration.
type GetPackerIterationArgs struct {
// The slug of the HCP Packer Registry image bucket to pull from.
BucketName string `pulumi:"bucketName"`
// The channel that points to the version of the image you want.
Channel string `pulumi:"channel"`
}
// A collection of values returned by getPackerIteration.
type GetPackerIterationResult struct {
// The name of the person who created this iteration.
AuthorId string `pulumi:"authorId"`
// The slug of the HCP Packer Registry image bucket to pull from.
BucketName string `pulumi:"bucketName"`
// The channel that points to the version of the image you want.
Channel string `pulumi:"channel"`
// Creation time of this iteration
CreatedAt string `pulumi:"createdAt"`
// The unique fingerprint associated with this iteration; often a git sha.
Fingerprint string `pulumi:"fingerprint"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Incremental version of this iteration
IncrementalVersion int `pulumi:"incrementalVersion"`
// The ID of the organization this HCP Packer registry is located in.
OrganizationId string `pulumi:"organizationId"`
// The ID of the project this HCP Packer registry is located in.
ProjectId string `pulumi:"projectId"`
// The revocation time of this iteration. This field will be null for any iteration that has not been revoked or scheduled for revocation.
RevokeAt string `pulumi:"revokeAt"`
// The ULID of this iteration.
Ulid string `pulumi:"ulid"`
// Time this build was last updated.
UpdatedAt string `pulumi:"updatedAt"`
}
func GetPackerIterationOutput(ctx *pulumi.Context, args GetPackerIterationOutputArgs, opts ...pulumi.InvokeOption) GetPackerIterationResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetPackerIterationResult, error) {
args := v.(GetPackerIterationArgs)
r, err := GetPackerIteration(ctx, &args, opts...)
var s GetPackerIterationResult
if r != nil {
s = *r
}
return s, err
}).(GetPackerIterationResultOutput)
}
// A collection of arguments for invoking getPackerIteration.
type GetPackerIterationOutputArgs struct {
// The slug of the HCP Packer Registry image bucket to pull from.
BucketName pulumi.StringInput `pulumi:"bucketName"`
// The channel that points to the version of the image you want.
Channel pulumi.StringInput `pulumi:"channel"`
}
func (GetPackerIterationOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetPackerIterationArgs)(nil)).Elem()
}
// A collection of values returned by getPackerIteration.
type GetPackerIterationResultOutput struct{ *pulumi.OutputState }
func (GetPackerIterationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetPackerIterationResult)(nil)).Elem()
}
func (o GetPackerIterationResultOutput) ToGetPackerIterationResultOutput() GetPackerIterationResultOutput {
return o
}
func (o GetPackerIterationResultOutput) ToGetPackerIterationResultOutputWithContext(ctx context.Context) GetPackerIterationResultOutput {
return o
}
// The name of the person who created this iteration.
func (o GetPackerIterationResultOutput) AuthorId() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.AuthorId }).(pulumi.StringOutput)
}
// The slug of the HCP Packer Registry image bucket to pull from.
func (o GetPackerIterationResultOutput) BucketName() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.BucketName }).(pulumi.StringOutput)
}
// The channel that points to the version of the image you want.
func (o GetPackerIterationResultOutput) Channel() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.Channel }).(pulumi.StringOutput)
}
// Creation time of this iteration
func (o GetPackerIterationResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// The unique fingerprint associated with this iteration; often a git sha.
func (o GetPackerIterationResultOutput) Fingerprint() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.Fingerprint }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetPackerIterationResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.Id }).(pulumi.StringOutput)
}
// Incremental version of this iteration
func (o GetPackerIterationResultOutput) IncrementalVersion() pulumi.IntOutput {
return o.ApplyT(func(v GetPackerIterationResult) int { return v.IncrementalVersion }).(pulumi.IntOutput)
}
// The ID of the organization this HCP Packer registry is located in.
func (o GetPackerIterationResultOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.OrganizationId }).(pulumi.StringOutput)
}
// The ID of the project this HCP Packer registry is located in.
func (o GetPackerIterationResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.ProjectId }).(pulumi.StringOutput)
}
// The revocation time of this iteration. This field will be null for any iteration that has not been revoked or scheduled for revocation.
func (o GetPackerIterationResultOutput) RevokeAt() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.RevokeAt }).(pulumi.StringOutput)
}
// The ULID of this iteration.
func (o GetPackerIterationResultOutput) Ulid() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.Ulid }).(pulumi.StringOutput)
}
// Time this build was last updated.
func (o GetPackerIterationResultOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v GetPackerIterationResult) string { return v.UpdatedAt }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetPackerIterationResultOutput{})
}