/
plan.go
185 lines (172 loc) · 10.4 KB
/
plan.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
// *** 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! ***
// nolint: lll
package appservice
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an App Service Plan component.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/app_service_plan.html.markdown.
type Plan struct {
pulumi.CustomResourceState
// The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
AppServiceEnvironmentId pulumi.StringPtrOutput `pulumi:"appServiceEnvironmentId"`
IsXenon pulumi.BoolPtrOutput `pulumi:"isXenon"`
// The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption) and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringOutput `pulumi:"location"`
// The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
MaximumElasticWorkerCount pulumi.IntOutput `pulumi:"maximumElasticWorkerCount"`
// The maximum number of workers supported with the App Service Plan's sku.
MaximumNumberOfWorkers pulumi.IntOutput `pulumi:"maximumNumberOfWorkers"`
// Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan. Defaults to `false`.
PerSiteScaling pulumi.BoolPtrOutput `pulumi:"perSiteScaling"`
// Is this App Service Plan `Reserved`. Defaults to `false`.
Reserved pulumi.BoolPtrOutput `pulumi:"reserved"`
// The name of the resource group in which to create the App Service Plan component.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// A `sku` block as documented below.
Sku PlanSkuOutput `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
}
// NewPlan registers a new resource with the given unique name, arguments, and options.
func NewPlan(ctx *pulumi.Context,
name string, args *PlanArgs, opts ...pulumi.ResourceOption) (*Plan, error) {
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.Sku == nil {
return nil, errors.New("missing required argument 'Sku'")
}
if args == nil {
args = &PlanArgs{}
}
var resource Plan
err := ctx.RegisterResource("azure:appservice/plan:Plan", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPlan gets an existing Plan 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 GetPlan(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PlanState, opts ...pulumi.ResourceOption) (*Plan, error) {
var resource Plan
err := ctx.ReadResource("azure:appservice/plan:Plan", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Plan resources.
type planState struct {
// The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
AppServiceEnvironmentId *string `pulumi:"appServiceEnvironmentId"`
IsXenon *bool `pulumi:"isXenon"`
// The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption) and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
Kind *string `pulumi:"kind"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
MaximumElasticWorkerCount *int `pulumi:"maximumElasticWorkerCount"`
// The maximum number of workers supported with the App Service Plan's sku.
MaximumNumberOfWorkers *int `pulumi:"maximumNumberOfWorkers"`
// Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan. Defaults to `false`.
PerSiteScaling *bool `pulumi:"perSiteScaling"`
// Is this App Service Plan `Reserved`. Defaults to `false`.
Reserved *bool `pulumi:"reserved"`
// The name of the resource group in which to create the App Service Plan component.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// A `sku` block as documented below.
Sku *PlanSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
type PlanState struct {
// The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
AppServiceEnvironmentId pulumi.StringPtrInput
IsXenon pulumi.BoolPtrInput
// The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption) and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
Kind pulumi.StringPtrInput
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
MaximumElasticWorkerCount pulumi.IntPtrInput
// The maximum number of workers supported with the App Service Plan's sku.
MaximumNumberOfWorkers pulumi.IntPtrInput
// Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan. Defaults to `false`.
PerSiteScaling pulumi.BoolPtrInput
// Is this App Service Plan `Reserved`. Defaults to `false`.
Reserved pulumi.BoolPtrInput
// The name of the resource group in which to create the App Service Plan component.
ResourceGroupName pulumi.StringPtrInput
// A `sku` block as documented below.
Sku PlanSkuPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (PlanState) ElementType() reflect.Type {
return reflect.TypeOf((*planState)(nil)).Elem()
}
type planArgs struct {
// The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
AppServiceEnvironmentId *string `pulumi:"appServiceEnvironmentId"`
IsXenon *bool `pulumi:"isXenon"`
// The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption) and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
Kind interface{} `pulumi:"kind"`
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location *string `pulumi:"location"`
// The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
MaximumElasticWorkerCount *int `pulumi:"maximumElasticWorkerCount"`
// Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan. Defaults to `false`.
PerSiteScaling *bool `pulumi:"perSiteScaling"`
// Is this App Service Plan `Reserved`. Defaults to `false`.
Reserved *bool `pulumi:"reserved"`
// The name of the resource group in which to create the App Service Plan component.
ResourceGroupName string `pulumi:"resourceGroupName"`
// A `sku` block as documented below.
Sku PlanSku `pulumi:"sku"`
// A mapping of tags to assign to the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Plan resource.
type PlanArgs struct {
// The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
AppServiceEnvironmentId pulumi.StringPtrInput
IsXenon pulumi.BoolPtrInput
// The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption) and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
Kind pulumi.Input
// Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
Location pulumi.StringPtrInput
// The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
MaximumElasticWorkerCount pulumi.IntPtrInput
// Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan. Defaults to `false`.
PerSiteScaling pulumi.BoolPtrInput
// Is this App Service Plan `Reserved`. Defaults to `false`.
Reserved pulumi.BoolPtrInput
// The name of the resource group in which to create the App Service Plan component.
ResourceGroupName pulumi.StringInput
// A `sku` block as documented below.
Sku PlanSkuInput
// A mapping of tags to assign to the resource.
Tags pulumi.StringMapInput
}
func (PlanArgs) ElementType() reflect.Type {
return reflect.TypeOf((*planArgs)(nil)).Elem()
}