/
githubEnterpriseConfig.go
246 lines (209 loc) · 13.8 KB
/
githubEnterpriseConfig.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Create an association between a GCP project and a GitHub Enterprise server.
type GithubEnterpriseConfig struct {
pulumi.CustomResourceState
// The GitHub app id of the Cloud Build app on the GitHub Enterprise server.
AppId pulumi.StringOutput `pulumi:"appId"`
// Time when the installation was associated with the project.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Name to display for this config.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Optional. The ID to use for the GithubEnterpriseConfig, which will become the final component of the GithubEnterpriseConfig's resource name. ghe_config_id must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character
GheConfigId pulumi.StringPtrOutput `pulumi:"gheConfigId"`
// The URL of the github enterprise host the configuration is for.
HostUrl pulumi.StringOutput `pulumi:"hostUrl"`
Location pulumi.StringOutput `pulumi:"location"`
// Optional. The full resource name for the GitHubEnterpriseConfig For example: "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}"
Name pulumi.StringOutput `pulumi:"name"`
// Optional. The network to be used when reaching out to the GitHub Enterprise server. The VPC network must be enabled for private service connection. This should be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the GitHub Enterprise server will be made over the public internet. Must be in the format `projects/{project}/global/networks/{network}`, where {project} is a project number or id and {network} is the name of a VPC network in the project.
PeeredNetwork pulumi.StringOutput `pulumi:"peeredNetwork"`
Project pulumi.StringOutput `pulumi:"project"`
// ID of the project.
ProjectId pulumi.StringPtrOutput `pulumi:"projectId"`
// Names of secrets in Secret Manager.
Secrets GitHubEnterpriseSecretsResponseOutput `pulumi:"secrets"`
// Optional. SSL certificate to use for requests to GitHub Enterprise.
SslCa pulumi.StringOutput `pulumi:"sslCa"`
// The key that should be attached to webhook calls to the ReceiveWebhook endpoint.
WebhookKey pulumi.StringOutput `pulumi:"webhookKey"`
}
// NewGithubEnterpriseConfig registers a new resource with the given unique name, arguments, and options.
func NewGithubEnterpriseConfig(ctx *pulumi.Context,
name string, args *GithubEnterpriseConfigArgs, opts ...pulumi.ResourceOption) (*GithubEnterpriseConfig, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AppId == nil {
return nil, errors.New("invalid value for required argument 'AppId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource GithubEnterpriseConfig
err := ctx.RegisterResource("google-native:cloudbuild/v1:GithubEnterpriseConfig", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGithubEnterpriseConfig gets an existing GithubEnterpriseConfig resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetGithubEnterpriseConfig(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GithubEnterpriseConfigState, opts ...pulumi.ResourceOption) (*GithubEnterpriseConfig, error) {
var resource GithubEnterpriseConfig
err := ctx.ReadResource("google-native:cloudbuild/v1:GithubEnterpriseConfig", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GithubEnterpriseConfig resources.
type githubEnterpriseConfigState struct {
}
type GithubEnterpriseConfigState struct {
}
func (GithubEnterpriseConfigState) ElementType() reflect.Type {
return reflect.TypeOf((*githubEnterpriseConfigState)(nil)).Elem()
}
type githubEnterpriseConfigArgs struct {
// The GitHub app id of the Cloud Build app on the GitHub Enterprise server.
AppId string `pulumi:"appId"`
// Name to display for this config.
DisplayName *string `pulumi:"displayName"`
// Optional. The ID to use for the GithubEnterpriseConfig, which will become the final component of the GithubEnterpriseConfig's resource name. ghe_config_id must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character
GheConfigId *string `pulumi:"gheConfigId"`
// The URL of the github enterprise host the configuration is for.
HostUrl *string `pulumi:"hostUrl"`
Location *string `pulumi:"location"`
// Optional. The full resource name for the GitHubEnterpriseConfig For example: "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}"
Name *string `pulumi:"name"`
// Optional. The network to be used when reaching out to the GitHub Enterprise server. The VPC network must be enabled for private service connection. This should be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the GitHub Enterprise server will be made over the public internet. Must be in the format `projects/{project}/global/networks/{network}`, where {project} is a project number or id and {network} is the name of a VPC network in the project.
PeeredNetwork *string `pulumi:"peeredNetwork"`
Project *string `pulumi:"project"`
// ID of the project.
ProjectId *string `pulumi:"projectId"`
// Names of secrets in Secret Manager.
Secrets *GitHubEnterpriseSecrets `pulumi:"secrets"`
// Optional. SSL certificate to use for requests to GitHub Enterprise.
SslCa *string `pulumi:"sslCa"`
// The key that should be attached to webhook calls to the ReceiveWebhook endpoint.
WebhookKey *string `pulumi:"webhookKey"`
}
// The set of arguments for constructing a GithubEnterpriseConfig resource.
type GithubEnterpriseConfigArgs struct {
// The GitHub app id of the Cloud Build app on the GitHub Enterprise server.
AppId pulumi.StringInput
// Name to display for this config.
DisplayName pulumi.StringPtrInput
// Optional. The ID to use for the GithubEnterpriseConfig, which will become the final component of the GithubEnterpriseConfig's resource name. ghe_config_id must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character
GheConfigId pulumi.StringPtrInput
// The URL of the github enterprise host the configuration is for.
HostUrl pulumi.StringPtrInput
Location pulumi.StringPtrInput
// Optional. The full resource name for the GitHubEnterpriseConfig For example: "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}"
Name pulumi.StringPtrInput
// Optional. The network to be used when reaching out to the GitHub Enterprise server. The VPC network must be enabled for private service connection. This should be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the GitHub Enterprise server will be made over the public internet. Must be in the format `projects/{project}/global/networks/{network}`, where {project} is a project number or id and {network} is the name of a VPC network in the project.
PeeredNetwork pulumi.StringPtrInput
Project pulumi.StringPtrInput
// ID of the project.
ProjectId pulumi.StringPtrInput
// Names of secrets in Secret Manager.
Secrets GitHubEnterpriseSecretsPtrInput
// Optional. SSL certificate to use for requests to GitHub Enterprise.
SslCa pulumi.StringPtrInput
// The key that should be attached to webhook calls to the ReceiveWebhook endpoint.
WebhookKey pulumi.StringPtrInput
}
func (GithubEnterpriseConfigArgs) ElementType() reflect.Type {
return reflect.TypeOf((*githubEnterpriseConfigArgs)(nil)).Elem()
}
type GithubEnterpriseConfigInput interface {
pulumi.Input
ToGithubEnterpriseConfigOutput() GithubEnterpriseConfigOutput
ToGithubEnterpriseConfigOutputWithContext(ctx context.Context) GithubEnterpriseConfigOutput
}
func (*GithubEnterpriseConfig) ElementType() reflect.Type {
return reflect.TypeOf((**GithubEnterpriseConfig)(nil)).Elem()
}
func (i *GithubEnterpriseConfig) ToGithubEnterpriseConfigOutput() GithubEnterpriseConfigOutput {
return i.ToGithubEnterpriseConfigOutputWithContext(context.Background())
}
func (i *GithubEnterpriseConfig) ToGithubEnterpriseConfigOutputWithContext(ctx context.Context) GithubEnterpriseConfigOutput {
return pulumi.ToOutputWithContext(ctx, i).(GithubEnterpriseConfigOutput)
}
type GithubEnterpriseConfigOutput struct{ *pulumi.OutputState }
func (GithubEnterpriseConfigOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GithubEnterpriseConfig)(nil)).Elem()
}
func (o GithubEnterpriseConfigOutput) ToGithubEnterpriseConfigOutput() GithubEnterpriseConfigOutput {
return o
}
func (o GithubEnterpriseConfigOutput) ToGithubEnterpriseConfigOutputWithContext(ctx context.Context) GithubEnterpriseConfigOutput {
return o
}
// The GitHub app id of the Cloud Build app on the GitHub Enterprise server.
func (o GithubEnterpriseConfigOutput) AppId() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.AppId }).(pulumi.StringOutput)
}
// Time when the installation was associated with the project.
func (o GithubEnterpriseConfigOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Name to display for this config.
func (o GithubEnterpriseConfigOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Optional. The ID to use for the GithubEnterpriseConfig, which will become the final component of the GithubEnterpriseConfig's resource name. ghe_config_id must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character
func (o GithubEnterpriseConfigOutput) GheConfigId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringPtrOutput { return v.GheConfigId }).(pulumi.StringPtrOutput)
}
// The URL of the github enterprise host the configuration is for.
func (o GithubEnterpriseConfigOutput) HostUrl() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.HostUrl }).(pulumi.StringOutput)
}
func (o GithubEnterpriseConfigOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Optional. The full resource name for the GitHubEnterpriseConfig For example: "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}"
func (o GithubEnterpriseConfigOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Optional. The network to be used when reaching out to the GitHub Enterprise server. The VPC network must be enabled for private service connection. This should be set if the GitHub Enterprise server is hosted on-premises and not reachable by public internet. If this field is left empty, no network peering will occur and calls to the GitHub Enterprise server will be made over the public internet. Must be in the format `projects/{project}/global/networks/{network}`, where {project} is a project number or id and {network} is the name of a VPC network in the project.
func (o GithubEnterpriseConfigOutput) PeeredNetwork() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.PeeredNetwork }).(pulumi.StringOutput)
}
func (o GithubEnterpriseConfigOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// ID of the project.
func (o GithubEnterpriseConfigOutput) ProjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringPtrOutput { return v.ProjectId }).(pulumi.StringPtrOutput)
}
// Names of secrets in Secret Manager.
func (o GithubEnterpriseConfigOutput) Secrets() GitHubEnterpriseSecretsResponseOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) GitHubEnterpriseSecretsResponseOutput { return v.Secrets }).(GitHubEnterpriseSecretsResponseOutput)
}
// Optional. SSL certificate to use for requests to GitHub Enterprise.
func (o GithubEnterpriseConfigOutput) SslCa() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.SslCa }).(pulumi.StringOutput)
}
// The key that should be attached to webhook calls to the ReceiveWebhook endpoint.
func (o GithubEnterpriseConfigOutput) WebhookKey() pulumi.StringOutput {
return o.ApplyT(func(v *GithubEnterpriseConfig) pulumi.StringOutput { return v.WebhookKey }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GithubEnterpriseConfigInput)(nil)).Elem(), &GithubEnterpriseConfig{})
pulumi.RegisterOutputType(GithubEnterpriseConfigOutput{})
}