/
getAppService.go
252 lines (217 loc) · 11.5 KB
/
getAppService.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
247
248
249
250
251
252
// 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 appservice
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing App Service.
//
// !> **Note:** The `appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxWebApp` data sources instead.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := appservice.LookupAppService(ctx, &appservice.LookupAppServiceArgs{
// Name: "search-app-service",
// ResourceGroupName: "search-service",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("appServiceId", example.Id)
// return nil
// })
// }
//
// ```
func LookupAppService(ctx *pulumi.Context, args *LookupAppServiceArgs, opts ...pulumi.InvokeOption) (*LookupAppServiceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupAppServiceResult
err := ctx.Invoke("azure:appservice/getAppService:getAppService", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAppService.
type LookupAppServiceArgs struct {
// The name of the App Service.
Name string `pulumi:"name"`
// The Name of the Resource Group where the App Service exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getAppService.
type LookupAppServiceResult struct {
// The ID of the App Service Plan within which the App Service exists.
AppServicePlanId string `pulumi:"appServicePlanId"`
// A key-value pair of App Settings for the App Service.
AppSettings map[string]string `pulumi:"appSettings"`
// Does the App Service send session affinity cookies, which route client requests in the same session to the same instance?
ClientAffinityEnabled bool `pulumi:"clientAffinityEnabled"`
// Does the App Service require client certificates for incoming requests?
ClientCertEnabled bool `pulumi:"clientCertEnabled"`
// An `connectionString` block as defined below.
ConnectionStrings []GetAppServiceConnectionString `pulumi:"connectionStrings"`
// An identifier used by App Service to perform domain ownership verification via DNS TXT record.
CustomDomainVerificationId string `pulumi:"customDomainVerificationId"`
// The Default Hostname associated with the App Service - such as `mysite.azurewebsites.net`
DefaultSiteHostname string `pulumi:"defaultSiteHostname"`
// Is the App Service Enabled?
Enabled bool `pulumi:"enabled"`
// Can the App Service only be accessed via HTTPS?
HttpsOnly bool `pulumi:"httpsOnly"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The Azure location where the App Service exists.
Location string `pulumi:"location"`
// The name for this IP Restriction.
Name string `pulumi:"name"`
// A list of outbound IP addresses - such as `["52.23.25.3", "52.143.43.12"]`
OutboundIpAddressLists []string `pulumi:"outboundIpAddressLists"`
// A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
OutboundIpAddresses string `pulumi:"outboundIpAddresses"`
// A list of outbound IP addresses - such as `["52.23.25.3", "52.143.43.12", "52.143.43.17"]` - not all of which are necessarily in use. Superset of `outboundIpAddressList`.
PossibleOutboundIpAddressLists []string `pulumi:"possibleOutboundIpAddressLists"`
// A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outboundIpAddresses`.
PossibleOutboundIpAddresses string `pulumi:"possibleOutboundIpAddresses"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `siteConfig` block as defined below.
SiteConfigs []GetAppServiceSiteConfig `pulumi:"siteConfigs"`
SiteCredentials []GetAppServiceSiteCredential `pulumi:"siteCredentials"`
// A `sourceControl` block as defined below.
SourceControls []GetAppServiceSourceControl `pulumi:"sourceControls"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
func LookupAppServiceOutput(ctx *pulumi.Context, args LookupAppServiceOutputArgs, opts ...pulumi.InvokeOption) LookupAppServiceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupAppServiceResult, error) {
args := v.(LookupAppServiceArgs)
r, err := LookupAppService(ctx, &args, opts...)
var s LookupAppServiceResult
if r != nil {
s = *r
}
return s, err
}).(LookupAppServiceResultOutput)
}
// A collection of arguments for invoking getAppService.
type LookupAppServiceOutputArgs struct {
// The name of the App Service.
Name pulumi.StringInput `pulumi:"name"`
// The Name of the Resource Group where the App Service exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupAppServiceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAppServiceArgs)(nil)).Elem()
}
// A collection of values returned by getAppService.
type LookupAppServiceResultOutput struct{ *pulumi.OutputState }
func (LookupAppServiceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupAppServiceResult)(nil)).Elem()
}
func (o LookupAppServiceResultOutput) ToLookupAppServiceResultOutput() LookupAppServiceResultOutput {
return o
}
func (o LookupAppServiceResultOutput) ToLookupAppServiceResultOutputWithContext(ctx context.Context) LookupAppServiceResultOutput {
return o
}
// The ID of the App Service Plan within which the App Service exists.
func (o LookupAppServiceResultOutput) AppServicePlanId() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.AppServicePlanId }).(pulumi.StringOutput)
}
// A key-value pair of App Settings for the App Service.
func (o LookupAppServiceResultOutput) AppSettings() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupAppServiceResult) map[string]string { return v.AppSettings }).(pulumi.StringMapOutput)
}
// Does the App Service send session affinity cookies, which route client requests in the same session to the same instance?
func (o LookupAppServiceResultOutput) ClientAffinityEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAppServiceResult) bool { return v.ClientAffinityEnabled }).(pulumi.BoolOutput)
}
// Does the App Service require client certificates for incoming requests?
func (o LookupAppServiceResultOutput) ClientCertEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAppServiceResult) bool { return v.ClientCertEnabled }).(pulumi.BoolOutput)
}
// An `connectionString` block as defined below.
func (o LookupAppServiceResultOutput) ConnectionStrings() GetAppServiceConnectionStringArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []GetAppServiceConnectionString { return v.ConnectionStrings }).(GetAppServiceConnectionStringArrayOutput)
}
// An identifier used by App Service to perform domain ownership verification via DNS TXT record.
func (o LookupAppServiceResultOutput) CustomDomainVerificationId() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.CustomDomainVerificationId }).(pulumi.StringOutput)
}
// The Default Hostname associated with the App Service - such as `mysite.azurewebsites.net`
func (o LookupAppServiceResultOutput) DefaultSiteHostname() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.DefaultSiteHostname }).(pulumi.StringOutput)
}
// Is the App Service Enabled?
func (o LookupAppServiceResultOutput) Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAppServiceResult) bool { return v.Enabled }).(pulumi.BoolOutput)
}
// Can the App Service only be accessed via HTTPS?
func (o LookupAppServiceResultOutput) HttpsOnly() pulumi.BoolOutput {
return o.ApplyT(func(v LookupAppServiceResult) bool { return v.HttpsOnly }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupAppServiceResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Azure location where the App Service exists.
func (o LookupAppServiceResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.Location }).(pulumi.StringOutput)
}
// The name for this IP Restriction.
func (o LookupAppServiceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.Name }).(pulumi.StringOutput)
}
// A list of outbound IP addresses - such as `["52.23.25.3", "52.143.43.12"]`
func (o LookupAppServiceResultOutput) OutboundIpAddressLists() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []string { return v.OutboundIpAddressLists }).(pulumi.StringArrayOutput)
}
// A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
func (o LookupAppServiceResultOutput) OutboundIpAddresses() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.OutboundIpAddresses }).(pulumi.StringOutput)
}
// A list of outbound IP addresses - such as `["52.23.25.3", "52.143.43.12", "52.143.43.17"]` - not all of which are necessarily in use. Superset of `outboundIpAddressList`.
func (o LookupAppServiceResultOutput) PossibleOutboundIpAddressLists() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []string { return v.PossibleOutboundIpAddressLists }).(pulumi.StringArrayOutput)
}
// A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outboundIpAddresses`.
func (o LookupAppServiceResultOutput) PossibleOutboundIpAddresses() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.PossibleOutboundIpAddresses }).(pulumi.StringOutput)
}
func (o LookupAppServiceResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupAppServiceResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// A `siteConfig` block as defined below.
func (o LookupAppServiceResultOutput) SiteConfigs() GetAppServiceSiteConfigArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []GetAppServiceSiteConfig { return v.SiteConfigs }).(GetAppServiceSiteConfigArrayOutput)
}
func (o LookupAppServiceResultOutput) SiteCredentials() GetAppServiceSiteCredentialArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []GetAppServiceSiteCredential { return v.SiteCredentials }).(GetAppServiceSiteCredentialArrayOutput)
}
// A `sourceControl` block as defined below.
func (o LookupAppServiceResultOutput) SourceControls() GetAppServiceSourceControlArrayOutput {
return o.ApplyT(func(v LookupAppServiceResult) []GetAppServiceSourceControl { return v.SourceControls }).(GetAppServiceSourceControlArrayOutput)
}
// A mapping of tags to assign to the resource.
func (o LookupAppServiceResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupAppServiceResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupAppServiceResultOutput{})
}