generated from pulumi/pulumi-component-provider-ts-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 4
/
website.go
234 lines (192 loc) · 7.96 KB
/
website.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
// Code generated by Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package awsstaticwebsite
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Website struct {
pulumi.ResourceState
// The name of the s3 bucket containing the website contents.
BucketName pulumi.StringOutput `pulumi:"bucketName"`
// The website URL for the s3 bucket.
BucketWebsiteURL pulumi.StringOutput `pulumi:"bucketWebsiteURL"`
// The domain name for the CDN.
CdnDomainName pulumi.StringPtrOutput `pulumi:"cdnDomainName"`
// The URL for the CDN
CdnURL pulumi.StringPtrOutput `pulumi:"cdnURL"`
// The name of the s3 bucket containing the access logs.
LogsBucketName pulumi.StringPtrOutput `pulumi:"logsBucketName"`
// The URL to access the website
WebsiteURL pulumi.StringOutput `pulumi:"websiteURL"`
}
// NewWebsite registers a new resource with the given unique name, arguments, and options.
func NewWebsite(ctx *pulumi.Context,
name string, args *WebsiteArgs, opts ...pulumi.ResourceOption) (*Website, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SitePath == nil {
return nil, errors.New("invalid value for required argument 'SitePath'")
}
var resource Website
err := ctx.RegisterRemoteComponentResource("aws-static-website:index:Website", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
type websiteArgs struct {
// Enable a cache control header to be attached to every request from an Cloudfront Function.
AddWebsiteVersionHeader *bool `pulumi:"addWebsiteVersionHeader"`
// Provision a new bucket on each deployment.
AtomicDeployments *bool `pulumi:"atomicDeployments"`
// TTL in seconds for cached objects.
CacheTTL *float64 `pulumi:"cacheTTL"`
// The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
CertificateARN *string `pulumi:"certificateARN"`
// default 404 page
Error404 *string `pulumi:"error404"`
// The default document for the site. Defaults to index.html
IndexHTML *string `pulumi:"indexHTML"`
// The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are `all`, `100`, and `200`
PriceClass *string `pulumi:"priceClass"`
// The root directory containing the website's contents.
SitePath string `pulumi:"sitePath"`
// The domain used to serve the content. A Route53 hosted zone must exist for this domain.
TargetDomain *string `pulumi:"targetDomain"`
// Provision CloudFront CDN to serve content.
WithCDN *bool `pulumi:"withCDN"`
// Provision a bucket to hold access logs.
WithLogs *bool `pulumi:"withLogs"`
}
// The set of arguments for constructing a Website resource.
type WebsiteArgs struct {
// Enable a cache control header to be attached to every request from an Cloudfront Function.
AddWebsiteVersionHeader pulumi.BoolPtrInput
// Provision a new bucket on each deployment.
AtomicDeployments pulumi.BoolPtrInput
// TTL in seconds for cached objects.
CacheTTL pulumi.Float64PtrInput
// The ARN of the ACM certificate to use for serving HTTPS. If one is not provided, a certificate will be created during the provisioning process.
CertificateARN pulumi.StringPtrInput
// default 404 page
Error404 pulumi.StringPtrInput
// The default document for the site. Defaults to index.html
IndexHTML pulumi.StringPtrInput
// The price class to use for the CloudFront configuration. Defaults to 100 if not specified. Valid values are `all`, `100`, and `200`
PriceClass pulumi.StringPtrInput
// The root directory containing the website's contents.
SitePath pulumi.StringInput
// The domain used to serve the content. A Route53 hosted zone must exist for this domain.
TargetDomain pulumi.StringPtrInput
// Provision CloudFront CDN to serve content.
WithCDN pulumi.BoolPtrInput
// Provision a bucket to hold access logs.
WithLogs pulumi.BoolPtrInput
}
func (WebsiteArgs) ElementType() reflect.Type {
return reflect.TypeOf((*websiteArgs)(nil)).Elem()
}
type WebsiteInput interface {
pulumi.Input
ToWebsiteOutput() WebsiteOutput
ToWebsiteOutputWithContext(ctx context.Context) WebsiteOutput
}
func (*Website) ElementType() reflect.Type {
return reflect.TypeOf((**Website)(nil)).Elem()
}
func (i *Website) ToWebsiteOutput() WebsiteOutput {
return i.ToWebsiteOutputWithContext(context.Background())
}
func (i *Website) ToWebsiteOutputWithContext(ctx context.Context) WebsiteOutput {
return pulumi.ToOutputWithContext(ctx, i).(WebsiteOutput)
}
// WebsiteArrayInput is an input type that accepts WebsiteArray and WebsiteArrayOutput values.
// You can construct a concrete instance of `WebsiteArrayInput` via:
//
// WebsiteArray{ WebsiteArgs{...} }
type WebsiteArrayInput interface {
pulumi.Input
ToWebsiteArrayOutput() WebsiteArrayOutput
ToWebsiteArrayOutputWithContext(context.Context) WebsiteArrayOutput
}
type WebsiteArray []WebsiteInput
func (WebsiteArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Website)(nil)).Elem()
}
func (i WebsiteArray) ToWebsiteArrayOutput() WebsiteArrayOutput {
return i.ToWebsiteArrayOutputWithContext(context.Background())
}
func (i WebsiteArray) ToWebsiteArrayOutputWithContext(ctx context.Context) WebsiteArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(WebsiteArrayOutput)
}
// WebsiteMapInput is an input type that accepts WebsiteMap and WebsiteMapOutput values.
// You can construct a concrete instance of `WebsiteMapInput` via:
//
// WebsiteMap{ "key": WebsiteArgs{...} }
type WebsiteMapInput interface {
pulumi.Input
ToWebsiteMapOutput() WebsiteMapOutput
ToWebsiteMapOutputWithContext(context.Context) WebsiteMapOutput
}
type WebsiteMap map[string]WebsiteInput
func (WebsiteMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Website)(nil)).Elem()
}
func (i WebsiteMap) ToWebsiteMapOutput() WebsiteMapOutput {
return i.ToWebsiteMapOutputWithContext(context.Background())
}
func (i WebsiteMap) ToWebsiteMapOutputWithContext(ctx context.Context) WebsiteMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(WebsiteMapOutput)
}
type WebsiteOutput struct{ *pulumi.OutputState }
func (WebsiteOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Website)(nil)).Elem()
}
func (o WebsiteOutput) ToWebsiteOutput() WebsiteOutput {
return o
}
func (o WebsiteOutput) ToWebsiteOutputWithContext(ctx context.Context) WebsiteOutput {
return o
}
type WebsiteArrayOutput struct{ *pulumi.OutputState }
func (WebsiteArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Website)(nil)).Elem()
}
func (o WebsiteArrayOutput) ToWebsiteArrayOutput() WebsiteArrayOutput {
return o
}
func (o WebsiteArrayOutput) ToWebsiteArrayOutputWithContext(ctx context.Context) WebsiteArrayOutput {
return o
}
func (o WebsiteArrayOutput) Index(i pulumi.IntInput) WebsiteOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Website {
return vs[0].([]*Website)[vs[1].(int)]
}).(WebsiteOutput)
}
type WebsiteMapOutput struct{ *pulumi.OutputState }
func (WebsiteMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Website)(nil)).Elem()
}
func (o WebsiteMapOutput) ToWebsiteMapOutput() WebsiteMapOutput {
return o
}
func (o WebsiteMapOutput) ToWebsiteMapOutputWithContext(ctx context.Context) WebsiteMapOutput {
return o
}
func (o WebsiteMapOutput) MapIndex(k pulumi.StringInput) WebsiteOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Website {
return vs[0].(map[string]*Website)[vs[1].(string)]
}).(WebsiteOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WebsiteInput)(nil)).Elem(), &Website{})
pulumi.RegisterInputType(reflect.TypeOf((*WebsiteArrayInput)(nil)).Elem(), WebsiteArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WebsiteMapInput)(nil)).Elem(), WebsiteMap{})
pulumi.RegisterOutputType(WebsiteOutput{})
pulumi.RegisterOutputType(WebsiteArrayOutput{})
pulumi.RegisterOutputType(WebsiteMapOutput{})
}