-
Notifications
You must be signed in to change notification settings - Fork 17
/
CustomRuleProps.go
56 lines (53 loc) · 2.37 KB
/
CustomRuleProps.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
package awsconfig
import (
"github.com/aws/aws-cdk-go/awscdk/v2/awslambda"
)
// Construction properties for a CustomRule.
//
// Example:
// // Lambda function containing logic that evaluates compliance with the rule.
// evalComplianceFn := lambda.NewFunction(this, jsii.String("CustomFunction"), &FunctionProps{
// Code: lambda.AssetCode_FromInline(jsii.String("exports.handler = (event) => console.log(event);")),
// Handler: jsii.String("index.handler"),
// Runtime: lambda.Runtime_NODEJS_18_X(),
// })
//
// // A custom rule that runs on configuration changes of EC2 instances
// customRule := config.NewCustomRule(this, jsii.String("Custom"), &CustomRuleProps{
// ConfigurationChanges: jsii.Boolean(true),
// LambdaFunction: evalComplianceFn,
// RuleScope: config.RuleScope_FromResource(config.ResourceType_EC2_INSTANCE()),
// })
//
type CustomRuleProps struct {
// A name for the AWS Config rule.
// Default: - CloudFormation generated name.
//
ConfigRuleName *string `field:"optional" json:"configRuleName" yaml:"configRuleName"`
// A description about this AWS Config rule.
// Default: - No description.
//
Description *string `field:"optional" json:"description" yaml:"description"`
// Input parameter values that are passed to the AWS Config rule.
// Default: - No input parameters.
//
InputParameters *map[string]interface{} `field:"optional" json:"inputParameters" yaml:"inputParameters"`
// The maximum frequency at which the AWS Config rule runs evaluations.
// Default: MaximumExecutionFrequency.TWENTY_FOUR_HOURS
//
MaximumExecutionFrequency MaximumExecutionFrequency `field:"optional" json:"maximumExecutionFrequency" yaml:"maximumExecutionFrequency"`
// Defines which resources trigger an evaluation for an AWS Config rule.
// Default: - evaluations for the rule are triggered when any resource in the recording group changes.
//
RuleScope RuleScope `field:"optional" json:"ruleScope" yaml:"ruleScope"`
// The Lambda function to run.
LambdaFunction awslambda.IFunction `field:"required" json:"lambdaFunction" yaml:"lambdaFunction"`
// Whether to run the rule on configuration changes.
// Default: false.
//
ConfigurationChanges *bool `field:"optional" json:"configurationChanges" yaml:"configurationChanges"`
// Whether to run the rule on a fixed frequency.
// Default: false.
//
Periodic *bool `field:"optional" json:"periodic" yaml:"periodic"`
}