-
Notifications
You must be signed in to change notification settings - Fork 17
/
FunctionUrlCorsOptions.go
50 lines (47 loc) · 1.8 KB
/
FunctionUrlCorsOptions.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
package awslambda
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Specifies a cross-origin access property for a function URL.
//
// Example:
// var fn function
//
//
// fn.AddFunctionUrl(&FunctionUrlOptions{
// AuthType: lambda.FunctionUrlAuthType_NONE,
// Cors: &FunctionUrlCorsOptions{
// // Allow this to be called from websites on https://example.com.
// // Can also be ['*'] to allow all domain.
// AllowedOrigins: []*string{
// jsii.String("https://example.com"),
// },
// },
// })
//
type FunctionUrlCorsOptions struct {
// Whether to allow cookies or other credentials in requests to your function URL.
// Default: false.
//
AllowCredentials *bool `field:"optional" json:"allowCredentials" yaml:"allowCredentials"`
// Headers that are specified in the Access-Control-Request-Headers header.
// Default: - No headers allowed.
//
AllowedHeaders *[]*string `field:"optional" json:"allowedHeaders" yaml:"allowedHeaders"`
// An HTTP method that you allow the origin to execute.
// Default: - [HttpMethod.ALL]
//
AllowedMethods *[]HttpMethod `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
// One or more origins you want customers to be able to access the bucket from.
// Default: - No origins allowed.
//
AllowedOrigins *[]*string `field:"optional" json:"allowedOrigins" yaml:"allowedOrigins"`
// One or more headers in the response that you want customers to be able to access from their applications.
// Default: - No headers exposed.
//
ExposedHeaders *[]*string `field:"optional" json:"exposedHeaders" yaml:"exposedHeaders"`
// The time in seconds that your browser is to cache the preflight response for the specified resource.
// Default: - Browser default of 5 seconds.
//
MaxAge awscdk.Duration `field:"optional" json:"maxAge" yaml:"maxAge"`
}