-
Notifications
You must be signed in to change notification settings - Fork 17
/
CustomResourceProviderProps.go
70 lines (67 loc) · 2.92 KB
/
CustomResourceProviderProps.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
package awscdk
// Initialization properties for `CustomResourceProvider`.
//
// Example:
// provider := awscdk.CustomResourceProvider_GetOrCreateProvider(this, jsii.String("Custom::MyCustomResourceType"), &CustomResourceProviderProps{
// CodeDirectory: fmt.Sprintf("%v/my-handler", __dirname),
// Runtime: awscdk.CustomResourceProviderRuntime_NODEJS_18_X,
// })
// provider.AddToRolePolicy(map[string]*string{
// "Effect": jsii.String("Allow"),
// "Action": jsii.String("s3:GetObject"),
// "Resource": jsii.String("*"),
// })
//
type CustomResourceProviderProps struct {
// A description of the function.
// Default: - No description.
//
Description *string `field:"optional" json:"description" yaml:"description"`
// Key-value pairs that are passed to Lambda as Environment.
// Default: - No environment variables.
//
Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"`
// The amount of memory that your function has access to.
//
// Increasing the
// function's memory also increases its CPU allocation.
// Default: Size.mebibytes(128)
//
MemorySize Size `field:"optional" json:"memorySize" yaml:"memorySize"`
// A set of IAM policy statements to include in the inline policy of the provider's lambda function.
//
// **Please note**: these are direct IAM JSON policy blobs, *not* `iam.PolicyStatement`
// objects like you will see in the rest of the CDK.
//
// Example:
// const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', {
// codeDirectory: `${__dirname}/my-handler`,
// runtime: CustomResourceProviderRuntime.NODEJS_18_X,
// policyStatements: [
// {
// Effect: 'Allow',
// Action: 's3:PutObject*',
// Resource: '*',
// }
// ],
// });
//
// Default: - no additional inline policy.
//
PolicyStatements *[]interface{} `field:"optional" json:"policyStatements" yaml:"policyStatements"`
// AWS Lambda timeout for the provider.
// Default: Duration.minutes(15)
//
Timeout Duration `field:"optional" json:"timeout" yaml:"timeout"`
// Whether or not the cloudformation response wrapper (`nodejs-entrypoint.ts`) is used. If set to `true`, `nodejs-entrypoint.js` is bundled in the same asset as the custom resource and set as the entrypoint. If set to `false`, the custom resource provided is the entrypoint.
// Default: - `true` if `inlineCode: false` and `false` otherwise.
//
UseCfnResponseWrapper *bool `field:"optional" json:"useCfnResponseWrapper" yaml:"useCfnResponseWrapper"`
// A local file system directory with the provider's code.
//
// The code will be
// bundled into a zip asset and wired to the provider's AWS Lambda function.
CodeDirectory *string `field:"required" json:"codeDirectory" yaml:"codeDirectory"`
// The AWS Lambda runtime and version to use for the provider.
Runtime CustomResourceProviderRuntime `field:"required" json:"runtime" yaml:"runtime"`
}