/
stage.go
270 lines (232 loc) · 13.9 KB
/
stage.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package apigateway
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws"
"github.com/pulumi/pulumi-aws-native/sdk/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The “AWS::ApiGateway::Stage“ resource creates a stage for a deployment.
type Stage struct {
pulumi.CustomResourceState
// Access log settings, including the access log format and access log destination ARN.
AccessLogSetting StageAccessLogSettingPtrOutput `pulumi:"accessLogSetting"`
// Specifies whether a cache cluster is enabled for the stage.
CacheClusterEnabled pulumi.BoolPtrOutput `pulumi:"cacheClusterEnabled"`
// The stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html).
CacheClusterSize pulumi.StringPtrOutput `pulumi:"cacheClusterSize"`
// Settings for the canary deployment in this stage.
CanarySetting StageCanarySettingPtrOutput `pulumi:"canarySetting"`
// The identifier of a client certificate for an API stage.
ClientCertificateId pulumi.StringPtrOutput `pulumi:"clientCertificateId"`
// The identifier of the Deployment that the stage points to.
DeploymentId pulumi.StringPtrOutput `pulumi:"deploymentId"`
// The stage's description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The version of the associated API documentation.
DocumentationVersion pulumi.StringPtrOutput `pulumi:"documentationVersion"`
// A map that defines the method settings for a Stage resource. Keys (designated as ``/{method_setting_key`` below) are method paths defined as ``{resource_path}/{http_method}`` for an individual method override, or ``/\*/\*`` for overriding all methods in the stage.
MethodSettings StageMethodSettingArrayOutput `pulumi:"methodSettings"`
// The string identifier of the associated RestApi.
RestApiId pulumi.StringOutput `pulumi:"restApiId"`
// The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
StageName pulumi.StringPtrOutput `pulumi:"stageName"`
// The collection of tags. Each tag element is associated with a given resource.
Tags aws.TagArrayOutput `pulumi:"tags"`
// Specifies whether active tracing with X-ray is enabled for the Stage.
TracingEnabled pulumi.BoolPtrOutput `pulumi:"tracingEnabled"`
// A map (string-to-string map) that defines the stage variables, where the variable name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``.
Variables pulumi.StringMapOutput `pulumi:"variables"`
}
// NewStage registers a new resource with the given unique name, arguments, and options.
func NewStage(ctx *pulumi.Context,
name string, args *StageArgs, opts ...pulumi.ResourceOption) (*Stage, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RestApiId == nil {
return nil, errors.New("invalid value for required argument 'RestApiId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"restApiId",
"stageName",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Stage
err := ctx.RegisterResource("aws-native:apigateway:Stage", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetStage gets an existing Stage 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 GetStage(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *StageState, opts ...pulumi.ResourceOption) (*Stage, error) {
var resource Stage
err := ctx.ReadResource("aws-native:apigateway:Stage", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Stage resources.
type stageState struct {
}
type StageState struct {
}
func (StageState) ElementType() reflect.Type {
return reflect.TypeOf((*stageState)(nil)).Elem()
}
type stageArgs struct {
// Access log settings, including the access log format and access log destination ARN.
AccessLogSetting *StageAccessLogSetting `pulumi:"accessLogSetting"`
// Specifies whether a cache cluster is enabled for the stage.
CacheClusterEnabled *bool `pulumi:"cacheClusterEnabled"`
// The stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html).
CacheClusterSize *string `pulumi:"cacheClusterSize"`
// Settings for the canary deployment in this stage.
CanarySetting *StageCanarySetting `pulumi:"canarySetting"`
// The identifier of a client certificate for an API stage.
ClientCertificateId *string `pulumi:"clientCertificateId"`
// The identifier of the Deployment that the stage points to.
DeploymentId *string `pulumi:"deploymentId"`
// The stage's description.
Description *string `pulumi:"description"`
// The version of the associated API documentation.
DocumentationVersion *string `pulumi:"documentationVersion"`
// A map that defines the method settings for a Stage resource. Keys (designated as ``/{method_setting_key`` below) are method paths defined as ``{resource_path}/{http_method}`` for an individual method override, or ``/\*/\*`` for overriding all methods in the stage.
MethodSettings []StageMethodSetting `pulumi:"methodSettings"`
// The string identifier of the associated RestApi.
RestApiId string `pulumi:"restApiId"`
// The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
StageName *string `pulumi:"stageName"`
// The collection of tags. Each tag element is associated with a given resource.
Tags []aws.Tag `pulumi:"tags"`
// Specifies whether active tracing with X-ray is enabled for the Stage.
TracingEnabled *bool `pulumi:"tracingEnabled"`
// A map (string-to-string map) that defines the stage variables, where the variable name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``.
Variables map[string]string `pulumi:"variables"`
}
// The set of arguments for constructing a Stage resource.
type StageArgs struct {
// Access log settings, including the access log format and access log destination ARN.
AccessLogSetting StageAccessLogSettingPtrInput
// Specifies whether a cache cluster is enabled for the stage.
CacheClusterEnabled pulumi.BoolPtrInput
// The stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html).
CacheClusterSize pulumi.StringPtrInput
// Settings for the canary deployment in this stage.
CanarySetting StageCanarySettingPtrInput
// The identifier of a client certificate for an API stage.
ClientCertificateId pulumi.StringPtrInput
// The identifier of the Deployment that the stage points to.
DeploymentId pulumi.StringPtrInput
// The stage's description.
Description pulumi.StringPtrInput
// The version of the associated API documentation.
DocumentationVersion pulumi.StringPtrInput
// A map that defines the method settings for a Stage resource. Keys (designated as ``/{method_setting_key`` below) are method paths defined as ``{resource_path}/{http_method}`` for an individual method override, or ``/\*/\*`` for overriding all methods in the stage.
MethodSettings StageMethodSettingArrayInput
// The string identifier of the associated RestApi.
RestApiId pulumi.StringInput
// The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
StageName pulumi.StringPtrInput
// The collection of tags. Each tag element is associated with a given resource.
Tags aws.TagArrayInput
// Specifies whether active tracing with X-ray is enabled for the Stage.
TracingEnabled pulumi.BoolPtrInput
// A map (string-to-string map) that defines the stage variables, where the variable name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. Values must match the following regular expression: ``[A-Za-z0-9-._~:/?#&=,]+``.
Variables pulumi.StringMapInput
}
func (StageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*stageArgs)(nil)).Elem()
}
type StageInput interface {
pulumi.Input
ToStageOutput() StageOutput
ToStageOutputWithContext(ctx context.Context) StageOutput
}
func (*Stage) ElementType() reflect.Type {
return reflect.TypeOf((**Stage)(nil)).Elem()
}
func (i *Stage) ToStageOutput() StageOutput {
return i.ToStageOutputWithContext(context.Background())
}
func (i *Stage) ToStageOutputWithContext(ctx context.Context) StageOutput {
return pulumi.ToOutputWithContext(ctx, i).(StageOutput)
}
type StageOutput struct{ *pulumi.OutputState }
func (StageOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Stage)(nil)).Elem()
}
func (o StageOutput) ToStageOutput() StageOutput {
return o
}
func (o StageOutput) ToStageOutputWithContext(ctx context.Context) StageOutput {
return o
}
// Access log settings, including the access log format and access log destination ARN.
func (o StageOutput) AccessLogSetting() StageAccessLogSettingPtrOutput {
return o.ApplyT(func(v *Stage) StageAccessLogSettingPtrOutput { return v.AccessLogSetting }).(StageAccessLogSettingPtrOutput)
}
// Specifies whether a cache cluster is enabled for the stage.
func (o StageOutput) CacheClusterEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.BoolPtrOutput { return v.CacheClusterEnabled }).(pulumi.BoolPtrOutput)
}
// The stage's cache capacity in GB. For more information about choosing a cache size, see [Enabling API caching to enhance responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html).
func (o StageOutput) CacheClusterSize() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.CacheClusterSize }).(pulumi.StringPtrOutput)
}
// Settings for the canary deployment in this stage.
func (o StageOutput) CanarySetting() StageCanarySettingPtrOutput {
return o.ApplyT(func(v *Stage) StageCanarySettingPtrOutput { return v.CanarySetting }).(StageCanarySettingPtrOutput)
}
// The identifier of a client certificate for an API stage.
func (o StageOutput) ClientCertificateId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.ClientCertificateId }).(pulumi.StringPtrOutput)
}
// The identifier of the Deployment that the stage points to.
func (o StageOutput) DeploymentId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.DeploymentId }).(pulumi.StringPtrOutput)
}
// The stage's description.
func (o StageOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The version of the associated API documentation.
func (o StageOutput) DocumentationVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.DocumentationVersion }).(pulumi.StringPtrOutput)
}
// A map that defines the method settings for a Stage resource. Keys (designated as “/{method_setting_key“ below) are method paths defined as “{resource_path}/{http_method}“ for an individual method override, or “/\*/\*“ for overriding all methods in the stage.
func (o StageOutput) MethodSettings() StageMethodSettingArrayOutput {
return o.ApplyT(func(v *Stage) StageMethodSettingArrayOutput { return v.MethodSettings }).(StageMethodSettingArrayOutput)
}
// The string identifier of the associated RestApi.
func (o StageOutput) RestApiId() pulumi.StringOutput {
return o.ApplyT(func(v *Stage) pulumi.StringOutput { return v.RestApiId }).(pulumi.StringOutput)
}
// The name of the stage is the first path segment in the Uniform Resource Identifier (URI) of a call to API Gateway. Stage names can only contain alphanumeric characters, hyphens, and underscores. Maximum length is 128 characters.
func (o StageOutput) StageName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.StringPtrOutput { return v.StageName }).(pulumi.StringPtrOutput)
}
// The collection of tags. Each tag element is associated with a given resource.
func (o StageOutput) Tags() aws.TagArrayOutput {
return o.ApplyT(func(v *Stage) aws.TagArrayOutput { return v.Tags }).(aws.TagArrayOutput)
}
// Specifies whether active tracing with X-ray is enabled for the Stage.
func (o StageOutput) TracingEnabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Stage) pulumi.BoolPtrOutput { return v.TracingEnabled }).(pulumi.BoolPtrOutput)
}
// A map (string-to-string map) that defines the stage variables, where the variable name is the key and the variable value is the value. Variable names are limited to alphanumeric characters. Values must match the following regular expression: “[A-Za-z0-9-._~:/?#&=,]+“.
func (o StageOutput) Variables() pulumi.StringMapOutput {
return o.ApplyT(func(v *Stage) pulumi.StringMapOutput { return v.Variables }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*StageInput)(nil)).Elem(), &Stage{})
pulumi.RegisterOutputType(StageOutput{})
}