-
Notifications
You must be signed in to change notification settings - Fork 17
/
BackupPlanRule.go
145 lines (113 loc) · 2.81 KB
/
BackupPlanRule.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
package awsbackup
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// A backup plan rule.
//
// Example:
// var plan backupPlan
//
// plan.AddRule(backup.NewBackupPlanRule(&BackupPlanRuleProps{
// EnableContinuousBackup: jsii.Boolean(true),
// DeleteAfter: awscdk.Duration_Days(jsii.Number(14)),
// }))
//
type BackupPlanRule interface {
// Properties of BackupPlanRule.
Props() *BackupPlanRuleProps
}
// The jsii proxy struct for BackupPlanRule
type jsiiProxy_BackupPlanRule struct {
_ byte // padding
}
func (j *jsiiProxy_BackupPlanRule) Props() *BackupPlanRuleProps {
var returns *BackupPlanRuleProps
_jsii_.Get(
j,
"props",
&returns,
)
return returns
}
func NewBackupPlanRule(props *BackupPlanRuleProps) BackupPlanRule {
_init_.Initialize()
if err := validateNewBackupPlanRuleParameters(props); err != nil {
panic(err)
}
j := jsiiProxy_BackupPlanRule{}
_jsii_.Create(
"aws-cdk-lib.aws_backup.BackupPlanRule",
[]interface{}{props},
&j,
)
return &j
}
func NewBackupPlanRule_Override(b BackupPlanRule, props *BackupPlanRuleProps) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.aws_backup.BackupPlanRule",
[]interface{}{props},
b,
)
}
// Daily with 35 days retention.
func BackupPlanRule_Daily(backupVault IBackupVault) BackupPlanRule {
_init_.Initialize()
var returns BackupPlanRule
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_backup.BackupPlanRule",
"daily",
[]interface{}{backupVault},
&returns,
)
return returns
}
// Monthly 1 year retention, move to cold storage after 1 month.
func BackupPlanRule_Monthly1Year(backupVault IBackupVault) BackupPlanRule {
_init_.Initialize()
var returns BackupPlanRule
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_backup.BackupPlanRule",
"monthly1Year",
[]interface{}{backupVault},
&returns,
)
return returns
}
// Monthly 5 year retention, move to cold storage after 3 months.
func BackupPlanRule_Monthly5Year(backupVault IBackupVault) BackupPlanRule {
_init_.Initialize()
var returns BackupPlanRule
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_backup.BackupPlanRule",
"monthly5Year",
[]interface{}{backupVault},
&returns,
)
return returns
}
// Monthly 7 year retention, move to cold storage after 3 months.
func BackupPlanRule_Monthly7Year(backupVault IBackupVault) BackupPlanRule {
_init_.Initialize()
var returns BackupPlanRule
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_backup.BackupPlanRule",
"monthly7Year",
[]interface{}{backupVault},
&returns,
)
return returns
}
// Weekly with 3 months retention.
func BackupPlanRule_Weekly(backupVault IBackupVault) BackupPlanRule {
_init_.Initialize()
var returns BackupPlanRule
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_backup.BackupPlanRule",
"weekly",
[]interface{}{backupVault},
&returns,
)
return returns
}