gammarers.aws-rds-database-running-schedule-stack 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gammarers.aws-rds-database-running-schedule-stack might be problematic. Click here for more details.
- gammarers/aws_rds_database_running_scheduler/__init__.py +638 -0
- gammarers/aws_rds_database_running_scheduler/_jsii/__init__.py +30 -0
- gammarers/aws_rds_database_running_scheduler/_jsii/aws-rds-database-running-schedule-stack@1.2.0.jsii.tgz +0 -0
- gammarers/aws_rds_database_running_scheduler/py.typed +1 -0
- gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/LICENSE +202 -0
- gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/METADATA +108 -0
- gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/RECORD +9 -0
- gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/WHEEL +5 -0
- gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
r'''
|
|
2
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/blob/main/LICENSE)
|
|
3
|
+
[](https://www.npmjs.com/package/@gammarer/aws-rds-database-running-schedule-stack)
|
|
4
|
+
[](https://pypi.org/project/gammarer.aws-rds-database-running-schedule-stack/)
|
|
5
|
+
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.RdsDatabaseRunningScheduler/)
|
|
6
|
+
[](https://s01.oss.sonatype.org/content/repositories/releases/com/gammarer/aws-rds-database-running-schedule-stack/)
|
|
7
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/actions/workflows/release.yml)
|
|
8
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/releases)
|
|
9
|
+
|
|
10
|
+
# AWS RDS Database Running Scheduler
|
|
11
|
+
|
|
12
|
+
This is an AWS CDK Construct to make RDS Database running schedule (only running while working hours(start/stop)).
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
* RDS Aurora Cluster
|
|
17
|
+
* RDS Instance
|
|
18
|
+
|
|
19
|
+
## Resources
|
|
20
|
+
|
|
21
|
+
This construct creating resource list.
|
|
22
|
+
|
|
23
|
+
* EventBridge Scheduler execution role
|
|
24
|
+
* EventBridge Scheduler
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
### TypeScript
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
npm install @gammarers/aws-rds-database-running-schedule-stack
|
|
32
|
+
# or
|
|
33
|
+
yarn add @gammarers/aws-rds-database-running-schedule-stack
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Python
|
|
37
|
+
|
|
38
|
+
```shell
|
|
39
|
+
pip install gammarers.aws-rds-database-running-schedule-stack
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### C# / .NET
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
dotnet add package Gammarers.CDK.AWS.RdsDatabaseRunningScheduleStack
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import { RdsDatabaseRunningScheduler, DatabaseType } from '@gammarer/aws-rds-database-running-schedule-stack';
|
|
52
|
+
|
|
53
|
+
new RdsDatabaseRunningScheduleStack(stack, 'RdsDatabaseRunningScheduleStack', {
|
|
54
|
+
targets: [
|
|
55
|
+
{
|
|
56
|
+
type: DatabaseType.CLUSTER,
|
|
57
|
+
identifiers: ['db-cluster-1a'],
|
|
58
|
+
startSchedule: {
|
|
59
|
+
timezone: 'UTC',
|
|
60
|
+
},
|
|
61
|
+
stopSchedule: {
|
|
62
|
+
timezone: 'UTC',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: DatabaseType.INSTANCE,
|
|
67
|
+
identifiers: ['db-instance-1a'],
|
|
68
|
+
startSchedule: {
|
|
69
|
+
timezone: 'UTC',
|
|
70
|
+
},
|
|
71
|
+
stopSchedule: {
|
|
72
|
+
timezone: 'UTC',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
This project is licensed under the Apache-2.0 License.
|
|
82
|
+
'''
|
|
83
|
+
from pkgutil import extend_path
|
|
84
|
+
__path__ = extend_path(__path__, __name__)
|
|
85
|
+
|
|
86
|
+
import abc
|
|
87
|
+
import builtins
|
|
88
|
+
import datetime
|
|
89
|
+
import enum
|
|
90
|
+
import typing
|
|
91
|
+
|
|
92
|
+
import jsii
|
|
93
|
+
import publication
|
|
94
|
+
import typing_extensions
|
|
95
|
+
|
|
96
|
+
from typeguard import check_type
|
|
97
|
+
|
|
98
|
+
from ._jsii import *
|
|
99
|
+
|
|
100
|
+
import aws_cdk as _aws_cdk_ceddda9d
|
|
101
|
+
import constructs as _constructs_77d1e7e8
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@jsii.enum(jsii_type="@gammarers/aws-rds-database-running-schedule-stack.DatabaseType")
|
|
105
|
+
class DatabaseType(enum.Enum):
|
|
106
|
+
CLUSTER = "CLUSTER"
|
|
107
|
+
INSTANCE = "INSTANCE"
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class RdsDatabaseRunningScheduleStack(
|
|
111
|
+
_aws_cdk_ceddda9d.Stack,
|
|
112
|
+
metaclass=jsii.JSIIMeta,
|
|
113
|
+
jsii_type="@gammarers/aws-rds-database-running-schedule-stack.RdsDatabaseRunningScheduleStack",
|
|
114
|
+
):
|
|
115
|
+
def __init__(
|
|
116
|
+
self,
|
|
117
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
118
|
+
id: builtins.str,
|
|
119
|
+
*,
|
|
120
|
+
targets: typing.Sequence[typing.Union["TargetProperty", typing.Dict[builtins.str, typing.Any]]],
|
|
121
|
+
analytics_reporting: typing.Optional[builtins.bool] = None,
|
|
122
|
+
cross_region_references: typing.Optional[builtins.bool] = None,
|
|
123
|
+
description: typing.Optional[builtins.str] = None,
|
|
124
|
+
env: typing.Optional[typing.Union[_aws_cdk_ceddda9d.Environment, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
125
|
+
permissions_boundary: typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary] = None,
|
|
126
|
+
stack_name: typing.Optional[builtins.str] = None,
|
|
127
|
+
synthesizer: typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer] = None,
|
|
128
|
+
tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
|
|
129
|
+
termination_protection: typing.Optional[builtins.bool] = None,
|
|
130
|
+
) -> None:
|
|
131
|
+
'''
|
|
132
|
+
:param scope: -
|
|
133
|
+
:param id: -
|
|
134
|
+
:param targets:
|
|
135
|
+
:param analytics_reporting: Include runtime versioning information in this Stack. Default: ``analyticsReporting`` setting of containing ``App``, or value of 'aws:cdk:version-reporting' context key
|
|
136
|
+
:param cross_region_references: Enable this flag to allow native cross region stack references. Enabling this will create a CloudFormation custom resource in both the producing stack and consuming stack in order to perform the export/import This feature is currently experimental Default: false
|
|
137
|
+
:param description: A description of the stack. Default: - No description.
|
|
138
|
+
:param env: The AWS environment (account/region) where this stack will be deployed. Set the ``region``/``account`` fields of ``env`` to either a concrete value to select the indicated environment (recommended for production stacks), or to the values of environment variables ``CDK_DEFAULT_REGION``/``CDK_DEFAULT_ACCOUNT`` to let the target environment depend on the AWS credentials/configuration that the CDK CLI is executed under (recommended for development stacks). If the ``Stack`` is instantiated inside a ``Stage``, any undefined ``region``/``account`` fields from ``env`` will default to the same field on the encompassing ``Stage``, if configured there. If either ``region`` or ``account`` are not set nor inherited from ``Stage``, the Stack will be considered "*environment-agnostic*"". Environment-agnostic stacks can be deployed to any environment but may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups such as ``ec2.Vpc.fromLookup`` and will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements. Default: - The environment of the containing ``Stage`` if available, otherwise create the stack will be environment-agnostic.
|
|
139
|
+
:param permissions_boundary: Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. Default: - no permissions boundary is applied
|
|
140
|
+
:param stack_name: Name to deploy the stack with. Default: - Derived from construct path.
|
|
141
|
+
:param synthesizer: Synthesis method to use while deploying this stack. The Stack Synthesizer controls aspects of synthesis and deployment, like how assets are referenced and what IAM roles to use. For more information, see the README of the main CDK package. If not specified, the ``defaultStackSynthesizer`` from ``App`` will be used. If that is not specified, ``DefaultStackSynthesizer`` is used if ``@aws-cdk/core:newStyleStackSynthesis`` is set to ``true`` or the CDK major version is v2. In CDK v1 ``LegacyStackSynthesizer`` is the default if no other synthesizer is specified. Default: - The synthesizer specified on ``App``, or ``DefaultStackSynthesizer`` otherwise.
|
|
142
|
+
:param tags: Stack tags that will be applied to all the taggable resources and the stack itself. Default: {}
|
|
143
|
+
:param termination_protection: Whether to enable termination protection for this stack. Default: false
|
|
144
|
+
'''
|
|
145
|
+
if __debug__:
|
|
146
|
+
type_hints = typing.get_type_hints(_typecheckingstub__6fffbb5d99d9dae64eeda4fe6ceb7a65d991f000e6cc360aa27fa2514e4bf73f)
|
|
147
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
148
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
149
|
+
props = RdsDatabaseRunningScheduleStackProps(
|
|
150
|
+
targets=targets,
|
|
151
|
+
analytics_reporting=analytics_reporting,
|
|
152
|
+
cross_region_references=cross_region_references,
|
|
153
|
+
description=description,
|
|
154
|
+
env=env,
|
|
155
|
+
permissions_boundary=permissions_boundary,
|
|
156
|
+
stack_name=stack_name,
|
|
157
|
+
synthesizer=synthesizer,
|
|
158
|
+
tags=tags,
|
|
159
|
+
termination_protection=termination_protection,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@jsii.data_type(
|
|
166
|
+
jsii_type="@gammarers/aws-rds-database-running-schedule-stack.RdsDatabaseRunningScheduleStackProps",
|
|
167
|
+
jsii_struct_bases=[_aws_cdk_ceddda9d.StackProps],
|
|
168
|
+
name_mapping={
|
|
169
|
+
"analytics_reporting": "analyticsReporting",
|
|
170
|
+
"cross_region_references": "crossRegionReferences",
|
|
171
|
+
"description": "description",
|
|
172
|
+
"env": "env",
|
|
173
|
+
"permissions_boundary": "permissionsBoundary",
|
|
174
|
+
"stack_name": "stackName",
|
|
175
|
+
"synthesizer": "synthesizer",
|
|
176
|
+
"tags": "tags",
|
|
177
|
+
"termination_protection": "terminationProtection",
|
|
178
|
+
"targets": "targets",
|
|
179
|
+
},
|
|
180
|
+
)
|
|
181
|
+
class RdsDatabaseRunningScheduleStackProps(_aws_cdk_ceddda9d.StackProps):
|
|
182
|
+
def __init__(
|
|
183
|
+
self,
|
|
184
|
+
*,
|
|
185
|
+
analytics_reporting: typing.Optional[builtins.bool] = None,
|
|
186
|
+
cross_region_references: typing.Optional[builtins.bool] = None,
|
|
187
|
+
description: typing.Optional[builtins.str] = None,
|
|
188
|
+
env: typing.Optional[typing.Union[_aws_cdk_ceddda9d.Environment, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
189
|
+
permissions_boundary: typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary] = None,
|
|
190
|
+
stack_name: typing.Optional[builtins.str] = None,
|
|
191
|
+
synthesizer: typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer] = None,
|
|
192
|
+
tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
|
|
193
|
+
termination_protection: typing.Optional[builtins.bool] = None,
|
|
194
|
+
targets: typing.Sequence[typing.Union["TargetProperty", typing.Dict[builtins.str, typing.Any]]],
|
|
195
|
+
) -> None:
|
|
196
|
+
'''
|
|
197
|
+
:param analytics_reporting: Include runtime versioning information in this Stack. Default: ``analyticsReporting`` setting of containing ``App``, or value of 'aws:cdk:version-reporting' context key
|
|
198
|
+
:param cross_region_references: Enable this flag to allow native cross region stack references. Enabling this will create a CloudFormation custom resource in both the producing stack and consuming stack in order to perform the export/import This feature is currently experimental Default: false
|
|
199
|
+
:param description: A description of the stack. Default: - No description.
|
|
200
|
+
:param env: The AWS environment (account/region) where this stack will be deployed. Set the ``region``/``account`` fields of ``env`` to either a concrete value to select the indicated environment (recommended for production stacks), or to the values of environment variables ``CDK_DEFAULT_REGION``/``CDK_DEFAULT_ACCOUNT`` to let the target environment depend on the AWS credentials/configuration that the CDK CLI is executed under (recommended for development stacks). If the ``Stack`` is instantiated inside a ``Stage``, any undefined ``region``/``account`` fields from ``env`` will default to the same field on the encompassing ``Stage``, if configured there. If either ``region`` or ``account`` are not set nor inherited from ``Stage``, the Stack will be considered "*environment-agnostic*"". Environment-agnostic stacks can be deployed to any environment but may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups such as ``ec2.Vpc.fromLookup`` and will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements. Default: - The environment of the containing ``Stage`` if available, otherwise create the stack will be environment-agnostic.
|
|
201
|
+
:param permissions_boundary: Options for applying a permissions boundary to all IAM Roles and Users created within this Stage. Default: - no permissions boundary is applied
|
|
202
|
+
:param stack_name: Name to deploy the stack with. Default: - Derived from construct path.
|
|
203
|
+
:param synthesizer: Synthesis method to use while deploying this stack. The Stack Synthesizer controls aspects of synthesis and deployment, like how assets are referenced and what IAM roles to use. For more information, see the README of the main CDK package. If not specified, the ``defaultStackSynthesizer`` from ``App`` will be used. If that is not specified, ``DefaultStackSynthesizer`` is used if ``@aws-cdk/core:newStyleStackSynthesis`` is set to ``true`` or the CDK major version is v2. In CDK v1 ``LegacyStackSynthesizer`` is the default if no other synthesizer is specified. Default: - The synthesizer specified on ``App``, or ``DefaultStackSynthesizer`` otherwise.
|
|
204
|
+
:param tags: Stack tags that will be applied to all the taggable resources and the stack itself. Default: {}
|
|
205
|
+
:param termination_protection: Whether to enable termination protection for this stack. Default: false
|
|
206
|
+
:param targets:
|
|
207
|
+
'''
|
|
208
|
+
if isinstance(env, dict):
|
|
209
|
+
env = _aws_cdk_ceddda9d.Environment(**env)
|
|
210
|
+
if __debug__:
|
|
211
|
+
type_hints = typing.get_type_hints(_typecheckingstub__8f71acba171212e7096d4e05bc27262d7d2c04637e38863513660ca9289e5599)
|
|
212
|
+
check_type(argname="argument analytics_reporting", value=analytics_reporting, expected_type=type_hints["analytics_reporting"])
|
|
213
|
+
check_type(argname="argument cross_region_references", value=cross_region_references, expected_type=type_hints["cross_region_references"])
|
|
214
|
+
check_type(argname="argument description", value=description, expected_type=type_hints["description"])
|
|
215
|
+
check_type(argname="argument env", value=env, expected_type=type_hints["env"])
|
|
216
|
+
check_type(argname="argument permissions_boundary", value=permissions_boundary, expected_type=type_hints["permissions_boundary"])
|
|
217
|
+
check_type(argname="argument stack_name", value=stack_name, expected_type=type_hints["stack_name"])
|
|
218
|
+
check_type(argname="argument synthesizer", value=synthesizer, expected_type=type_hints["synthesizer"])
|
|
219
|
+
check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
|
|
220
|
+
check_type(argname="argument termination_protection", value=termination_protection, expected_type=type_hints["termination_protection"])
|
|
221
|
+
check_type(argname="argument targets", value=targets, expected_type=type_hints["targets"])
|
|
222
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
223
|
+
"targets": targets,
|
|
224
|
+
}
|
|
225
|
+
if analytics_reporting is not None:
|
|
226
|
+
self._values["analytics_reporting"] = analytics_reporting
|
|
227
|
+
if cross_region_references is not None:
|
|
228
|
+
self._values["cross_region_references"] = cross_region_references
|
|
229
|
+
if description is not None:
|
|
230
|
+
self._values["description"] = description
|
|
231
|
+
if env is not None:
|
|
232
|
+
self._values["env"] = env
|
|
233
|
+
if permissions_boundary is not None:
|
|
234
|
+
self._values["permissions_boundary"] = permissions_boundary
|
|
235
|
+
if stack_name is not None:
|
|
236
|
+
self._values["stack_name"] = stack_name
|
|
237
|
+
if synthesizer is not None:
|
|
238
|
+
self._values["synthesizer"] = synthesizer
|
|
239
|
+
if tags is not None:
|
|
240
|
+
self._values["tags"] = tags
|
|
241
|
+
if termination_protection is not None:
|
|
242
|
+
self._values["termination_protection"] = termination_protection
|
|
243
|
+
|
|
244
|
+
@builtins.property
|
|
245
|
+
def analytics_reporting(self) -> typing.Optional[builtins.bool]:
|
|
246
|
+
'''Include runtime versioning information in this Stack.
|
|
247
|
+
|
|
248
|
+
:default:
|
|
249
|
+
|
|
250
|
+
``analyticsReporting`` setting of containing ``App``, or value of
|
|
251
|
+
'aws:cdk:version-reporting' context key
|
|
252
|
+
'''
|
|
253
|
+
result = self._values.get("analytics_reporting")
|
|
254
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
255
|
+
|
|
256
|
+
@builtins.property
|
|
257
|
+
def cross_region_references(self) -> typing.Optional[builtins.bool]:
|
|
258
|
+
'''Enable this flag to allow native cross region stack references.
|
|
259
|
+
|
|
260
|
+
Enabling this will create a CloudFormation custom resource
|
|
261
|
+
in both the producing stack and consuming stack in order to perform the export/import
|
|
262
|
+
|
|
263
|
+
This feature is currently experimental
|
|
264
|
+
|
|
265
|
+
:default: false
|
|
266
|
+
'''
|
|
267
|
+
result = self._values.get("cross_region_references")
|
|
268
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
269
|
+
|
|
270
|
+
@builtins.property
|
|
271
|
+
def description(self) -> typing.Optional[builtins.str]:
|
|
272
|
+
'''A description of the stack.
|
|
273
|
+
|
|
274
|
+
:default: - No description.
|
|
275
|
+
'''
|
|
276
|
+
result = self._values.get("description")
|
|
277
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
278
|
+
|
|
279
|
+
@builtins.property
|
|
280
|
+
def env(self) -> typing.Optional[_aws_cdk_ceddda9d.Environment]:
|
|
281
|
+
'''The AWS environment (account/region) where this stack will be deployed.
|
|
282
|
+
|
|
283
|
+
Set the ``region``/``account`` fields of ``env`` to either a concrete value to
|
|
284
|
+
select the indicated environment (recommended for production stacks), or to
|
|
285
|
+
the values of environment variables
|
|
286
|
+
``CDK_DEFAULT_REGION``/``CDK_DEFAULT_ACCOUNT`` to let the target environment
|
|
287
|
+
depend on the AWS credentials/configuration that the CDK CLI is executed
|
|
288
|
+
under (recommended for development stacks).
|
|
289
|
+
|
|
290
|
+
If the ``Stack`` is instantiated inside a ``Stage``, any undefined
|
|
291
|
+
``region``/``account`` fields from ``env`` will default to the same field on the
|
|
292
|
+
encompassing ``Stage``, if configured there.
|
|
293
|
+
|
|
294
|
+
If either ``region`` or ``account`` are not set nor inherited from ``Stage``, the
|
|
295
|
+
Stack will be considered "*environment-agnostic*"". Environment-agnostic
|
|
296
|
+
stacks can be deployed to any environment but may not be able to take
|
|
297
|
+
advantage of all features of the CDK. For example, they will not be able to
|
|
298
|
+
use environmental context lookups such as ``ec2.Vpc.fromLookup`` and will not
|
|
299
|
+
automatically translate Service Principals to the right format based on the
|
|
300
|
+
environment's AWS partition, and other such enhancements.
|
|
301
|
+
|
|
302
|
+
:default:
|
|
303
|
+
|
|
304
|
+
- The environment of the containing ``Stage`` if available,
|
|
305
|
+
otherwise create the stack will be environment-agnostic.
|
|
306
|
+
|
|
307
|
+
Example::
|
|
308
|
+
|
|
309
|
+
// Use a concrete account and region to deploy this stack to:
|
|
310
|
+
// `.account` and `.region` will simply return these values.
|
|
311
|
+
new Stack(app, 'Stack1', {
|
|
312
|
+
env: {
|
|
313
|
+
account: '123456789012',
|
|
314
|
+
region: 'us-east-1'
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
// Use the CLI's current credentials to determine the target environment:
|
|
319
|
+
// `.account` and `.region` will reflect the account+region the CLI
|
|
320
|
+
// is configured to use (based on the user CLI credentials)
|
|
321
|
+
new Stack(app, 'Stack2', {
|
|
322
|
+
env: {
|
|
323
|
+
account: process.env.CDK_DEFAULT_ACCOUNT,
|
|
324
|
+
region: process.env.CDK_DEFAULT_REGION
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// Define multiple stacks stage associated with an environment
|
|
329
|
+
const myStage = new Stage(app, 'MyStage', {
|
|
330
|
+
env: {
|
|
331
|
+
account: '123456789012',
|
|
332
|
+
region: 'us-east-1'
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
// both of these stacks will use the stage's account/region:
|
|
337
|
+
// `.account` and `.region` will resolve to the concrete values as above
|
|
338
|
+
new MyStack(myStage, 'Stack1');
|
|
339
|
+
new YourStack(myStage, 'Stack2');
|
|
340
|
+
|
|
341
|
+
// Define an environment-agnostic stack:
|
|
342
|
+
// `.account` and `.region` will resolve to `{ "Ref": "AWS::AccountId" }` and `{ "Ref": "AWS::Region" }` respectively.
|
|
343
|
+
// which will only resolve to actual values by CloudFormation during deployment.
|
|
344
|
+
new MyStack(app, 'Stack1');
|
|
345
|
+
'''
|
|
346
|
+
result = self._values.get("env")
|
|
347
|
+
return typing.cast(typing.Optional[_aws_cdk_ceddda9d.Environment], result)
|
|
348
|
+
|
|
349
|
+
@builtins.property
|
|
350
|
+
def permissions_boundary(
|
|
351
|
+
self,
|
|
352
|
+
) -> typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary]:
|
|
353
|
+
'''Options for applying a permissions boundary to all IAM Roles and Users created within this Stage.
|
|
354
|
+
|
|
355
|
+
:default: - no permissions boundary is applied
|
|
356
|
+
'''
|
|
357
|
+
result = self._values.get("permissions_boundary")
|
|
358
|
+
return typing.cast(typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary], result)
|
|
359
|
+
|
|
360
|
+
@builtins.property
|
|
361
|
+
def stack_name(self) -> typing.Optional[builtins.str]:
|
|
362
|
+
'''Name to deploy the stack with.
|
|
363
|
+
|
|
364
|
+
:default: - Derived from construct path.
|
|
365
|
+
'''
|
|
366
|
+
result = self._values.get("stack_name")
|
|
367
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
368
|
+
|
|
369
|
+
@builtins.property
|
|
370
|
+
def synthesizer(self) -> typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer]:
|
|
371
|
+
'''Synthesis method to use while deploying this stack.
|
|
372
|
+
|
|
373
|
+
The Stack Synthesizer controls aspects of synthesis and deployment,
|
|
374
|
+
like how assets are referenced and what IAM roles to use. For more
|
|
375
|
+
information, see the README of the main CDK package.
|
|
376
|
+
|
|
377
|
+
If not specified, the ``defaultStackSynthesizer`` from ``App`` will be used.
|
|
378
|
+
If that is not specified, ``DefaultStackSynthesizer`` is used if
|
|
379
|
+
``@aws-cdk/core:newStyleStackSynthesis`` is set to ``true`` or the CDK major
|
|
380
|
+
version is v2. In CDK v1 ``LegacyStackSynthesizer`` is the default if no
|
|
381
|
+
other synthesizer is specified.
|
|
382
|
+
|
|
383
|
+
:default: - The synthesizer specified on ``App``, or ``DefaultStackSynthesizer`` otherwise.
|
|
384
|
+
'''
|
|
385
|
+
result = self._values.get("synthesizer")
|
|
386
|
+
return typing.cast(typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer], result)
|
|
387
|
+
|
|
388
|
+
@builtins.property
|
|
389
|
+
def tags(self) -> typing.Optional[typing.Mapping[builtins.str, builtins.str]]:
|
|
390
|
+
'''Stack tags that will be applied to all the taggable resources and the stack itself.
|
|
391
|
+
|
|
392
|
+
:default: {}
|
|
393
|
+
'''
|
|
394
|
+
result = self._values.get("tags")
|
|
395
|
+
return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
|
|
396
|
+
|
|
397
|
+
@builtins.property
|
|
398
|
+
def termination_protection(self) -> typing.Optional[builtins.bool]:
|
|
399
|
+
'''Whether to enable termination protection for this stack.
|
|
400
|
+
|
|
401
|
+
:default: false
|
|
402
|
+
'''
|
|
403
|
+
result = self._values.get("termination_protection")
|
|
404
|
+
return typing.cast(typing.Optional[builtins.bool], result)
|
|
405
|
+
|
|
406
|
+
@builtins.property
|
|
407
|
+
def targets(self) -> typing.List["TargetProperty"]:
|
|
408
|
+
result = self._values.get("targets")
|
|
409
|
+
assert result is not None, "Required property 'targets' is missing"
|
|
410
|
+
return typing.cast(typing.List["TargetProperty"], result)
|
|
411
|
+
|
|
412
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
413
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
414
|
+
|
|
415
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
416
|
+
return not (rhs == self)
|
|
417
|
+
|
|
418
|
+
def __repr__(self) -> str:
|
|
419
|
+
return "RdsDatabaseRunningScheduleStackProps(%s)" % ", ".join(
|
|
420
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
@jsii.data_type(
|
|
425
|
+
jsii_type="@gammarers/aws-rds-database-running-schedule-stack.ScheduleProperty",
|
|
426
|
+
jsii_struct_bases=[],
|
|
427
|
+
name_mapping={
|
|
428
|
+
"timezone": "timezone",
|
|
429
|
+
"hour": "hour",
|
|
430
|
+
"minute": "minute",
|
|
431
|
+
"week": "week",
|
|
432
|
+
},
|
|
433
|
+
)
|
|
434
|
+
class ScheduleProperty:
|
|
435
|
+
def __init__(
|
|
436
|
+
self,
|
|
437
|
+
*,
|
|
438
|
+
timezone: builtins.str,
|
|
439
|
+
hour: typing.Optional[builtins.str] = None,
|
|
440
|
+
minute: typing.Optional[builtins.str] = None,
|
|
441
|
+
week: typing.Optional[builtins.str] = None,
|
|
442
|
+
) -> None:
|
|
443
|
+
'''
|
|
444
|
+
:param timezone:
|
|
445
|
+
:param hour:
|
|
446
|
+
:param minute:
|
|
447
|
+
:param week:
|
|
448
|
+
'''
|
|
449
|
+
if __debug__:
|
|
450
|
+
type_hints = typing.get_type_hints(_typecheckingstub__698ada8cebb0f29cf7aa1b64e0b10a701ff87508b556665b4c2bae69b2799be8)
|
|
451
|
+
check_type(argname="argument timezone", value=timezone, expected_type=type_hints["timezone"])
|
|
452
|
+
check_type(argname="argument hour", value=hour, expected_type=type_hints["hour"])
|
|
453
|
+
check_type(argname="argument minute", value=minute, expected_type=type_hints["minute"])
|
|
454
|
+
check_type(argname="argument week", value=week, expected_type=type_hints["week"])
|
|
455
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
456
|
+
"timezone": timezone,
|
|
457
|
+
}
|
|
458
|
+
if hour is not None:
|
|
459
|
+
self._values["hour"] = hour
|
|
460
|
+
if minute is not None:
|
|
461
|
+
self._values["minute"] = minute
|
|
462
|
+
if week is not None:
|
|
463
|
+
self._values["week"] = week
|
|
464
|
+
|
|
465
|
+
@builtins.property
|
|
466
|
+
def timezone(self) -> builtins.str:
|
|
467
|
+
result = self._values.get("timezone")
|
|
468
|
+
assert result is not None, "Required property 'timezone' is missing"
|
|
469
|
+
return typing.cast(builtins.str, result)
|
|
470
|
+
|
|
471
|
+
@builtins.property
|
|
472
|
+
def hour(self) -> typing.Optional[builtins.str]:
|
|
473
|
+
result = self._values.get("hour")
|
|
474
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
475
|
+
|
|
476
|
+
@builtins.property
|
|
477
|
+
def minute(self) -> typing.Optional[builtins.str]:
|
|
478
|
+
result = self._values.get("minute")
|
|
479
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
480
|
+
|
|
481
|
+
@builtins.property
|
|
482
|
+
def week(self) -> typing.Optional[builtins.str]:
|
|
483
|
+
result = self._values.get("week")
|
|
484
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
485
|
+
|
|
486
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
487
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
488
|
+
|
|
489
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
490
|
+
return not (rhs == self)
|
|
491
|
+
|
|
492
|
+
def __repr__(self) -> str:
|
|
493
|
+
return "ScheduleProperty(%s)" % ", ".join(
|
|
494
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
495
|
+
)
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
@jsii.data_type(
|
|
499
|
+
jsii_type="@gammarers/aws-rds-database-running-schedule-stack.TargetProperty",
|
|
500
|
+
jsii_struct_bases=[],
|
|
501
|
+
name_mapping={
|
|
502
|
+
"identifiers": "identifiers",
|
|
503
|
+
"start_schedule": "startSchedule",
|
|
504
|
+
"stop_schedule": "stopSchedule",
|
|
505
|
+
"type": "type",
|
|
506
|
+
},
|
|
507
|
+
)
|
|
508
|
+
class TargetProperty:
|
|
509
|
+
def __init__(
|
|
510
|
+
self,
|
|
511
|
+
*,
|
|
512
|
+
identifiers: typing.Sequence[builtins.str],
|
|
513
|
+
start_schedule: typing.Union[ScheduleProperty, typing.Dict[builtins.str, typing.Any]],
|
|
514
|
+
stop_schedule: typing.Union[ScheduleProperty, typing.Dict[builtins.str, typing.Any]],
|
|
515
|
+
type: DatabaseType,
|
|
516
|
+
) -> None:
|
|
517
|
+
'''
|
|
518
|
+
:param identifiers:
|
|
519
|
+
:param start_schedule:
|
|
520
|
+
:param stop_schedule:
|
|
521
|
+
:param type:
|
|
522
|
+
'''
|
|
523
|
+
if isinstance(start_schedule, dict):
|
|
524
|
+
start_schedule = ScheduleProperty(**start_schedule)
|
|
525
|
+
if isinstance(stop_schedule, dict):
|
|
526
|
+
stop_schedule = ScheduleProperty(**stop_schedule)
|
|
527
|
+
if __debug__:
|
|
528
|
+
type_hints = typing.get_type_hints(_typecheckingstub__5cc55631b35a38a71d11cd70266d4b21b303a65a2b27449fa603a94b5e117dcd)
|
|
529
|
+
check_type(argname="argument identifiers", value=identifiers, expected_type=type_hints["identifiers"])
|
|
530
|
+
check_type(argname="argument start_schedule", value=start_schedule, expected_type=type_hints["start_schedule"])
|
|
531
|
+
check_type(argname="argument stop_schedule", value=stop_schedule, expected_type=type_hints["stop_schedule"])
|
|
532
|
+
check_type(argname="argument type", value=type, expected_type=type_hints["type"])
|
|
533
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
534
|
+
"identifiers": identifiers,
|
|
535
|
+
"start_schedule": start_schedule,
|
|
536
|
+
"stop_schedule": stop_schedule,
|
|
537
|
+
"type": type,
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
@builtins.property
|
|
541
|
+
def identifiers(self) -> typing.List[builtins.str]:
|
|
542
|
+
result = self._values.get("identifiers")
|
|
543
|
+
assert result is not None, "Required property 'identifiers' is missing"
|
|
544
|
+
return typing.cast(typing.List[builtins.str], result)
|
|
545
|
+
|
|
546
|
+
@builtins.property
|
|
547
|
+
def start_schedule(self) -> ScheduleProperty:
|
|
548
|
+
result = self._values.get("start_schedule")
|
|
549
|
+
assert result is not None, "Required property 'start_schedule' is missing"
|
|
550
|
+
return typing.cast(ScheduleProperty, result)
|
|
551
|
+
|
|
552
|
+
@builtins.property
|
|
553
|
+
def stop_schedule(self) -> ScheduleProperty:
|
|
554
|
+
result = self._values.get("stop_schedule")
|
|
555
|
+
assert result is not None, "Required property 'stop_schedule' is missing"
|
|
556
|
+
return typing.cast(ScheduleProperty, result)
|
|
557
|
+
|
|
558
|
+
@builtins.property
|
|
559
|
+
def type(self) -> DatabaseType:
|
|
560
|
+
result = self._values.get("type")
|
|
561
|
+
assert result is not None, "Required property 'type' is missing"
|
|
562
|
+
return typing.cast(DatabaseType, result)
|
|
563
|
+
|
|
564
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
565
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
566
|
+
|
|
567
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
568
|
+
return not (rhs == self)
|
|
569
|
+
|
|
570
|
+
def __repr__(self) -> str:
|
|
571
|
+
return "TargetProperty(%s)" % ", ".join(
|
|
572
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
__all__ = [
|
|
577
|
+
"DatabaseType",
|
|
578
|
+
"RdsDatabaseRunningScheduleStack",
|
|
579
|
+
"RdsDatabaseRunningScheduleStackProps",
|
|
580
|
+
"ScheduleProperty",
|
|
581
|
+
"TargetProperty",
|
|
582
|
+
]
|
|
583
|
+
|
|
584
|
+
publication.publish()
|
|
585
|
+
|
|
586
|
+
def _typecheckingstub__6fffbb5d99d9dae64eeda4fe6ceb7a65d991f000e6cc360aa27fa2514e4bf73f(
|
|
587
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
588
|
+
id: builtins.str,
|
|
589
|
+
*,
|
|
590
|
+
targets: typing.Sequence[typing.Union[TargetProperty, typing.Dict[builtins.str, typing.Any]]],
|
|
591
|
+
analytics_reporting: typing.Optional[builtins.bool] = None,
|
|
592
|
+
cross_region_references: typing.Optional[builtins.bool] = None,
|
|
593
|
+
description: typing.Optional[builtins.str] = None,
|
|
594
|
+
env: typing.Optional[typing.Union[_aws_cdk_ceddda9d.Environment, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
595
|
+
permissions_boundary: typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary] = None,
|
|
596
|
+
stack_name: typing.Optional[builtins.str] = None,
|
|
597
|
+
synthesizer: typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer] = None,
|
|
598
|
+
tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
|
|
599
|
+
termination_protection: typing.Optional[builtins.bool] = None,
|
|
600
|
+
) -> None:
|
|
601
|
+
"""Type checking stubs"""
|
|
602
|
+
pass
|
|
603
|
+
|
|
604
|
+
def _typecheckingstub__8f71acba171212e7096d4e05bc27262d7d2c04637e38863513660ca9289e5599(
|
|
605
|
+
*,
|
|
606
|
+
analytics_reporting: typing.Optional[builtins.bool] = None,
|
|
607
|
+
cross_region_references: typing.Optional[builtins.bool] = None,
|
|
608
|
+
description: typing.Optional[builtins.str] = None,
|
|
609
|
+
env: typing.Optional[typing.Union[_aws_cdk_ceddda9d.Environment, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
610
|
+
permissions_boundary: typing.Optional[_aws_cdk_ceddda9d.PermissionsBoundary] = None,
|
|
611
|
+
stack_name: typing.Optional[builtins.str] = None,
|
|
612
|
+
synthesizer: typing.Optional[_aws_cdk_ceddda9d.IStackSynthesizer] = None,
|
|
613
|
+
tags: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
|
|
614
|
+
termination_protection: typing.Optional[builtins.bool] = None,
|
|
615
|
+
targets: typing.Sequence[typing.Union[TargetProperty, typing.Dict[builtins.str, typing.Any]]],
|
|
616
|
+
) -> None:
|
|
617
|
+
"""Type checking stubs"""
|
|
618
|
+
pass
|
|
619
|
+
|
|
620
|
+
def _typecheckingstub__698ada8cebb0f29cf7aa1b64e0b10a701ff87508b556665b4c2bae69b2799be8(
|
|
621
|
+
*,
|
|
622
|
+
timezone: builtins.str,
|
|
623
|
+
hour: typing.Optional[builtins.str] = None,
|
|
624
|
+
minute: typing.Optional[builtins.str] = None,
|
|
625
|
+
week: typing.Optional[builtins.str] = None,
|
|
626
|
+
) -> None:
|
|
627
|
+
"""Type checking stubs"""
|
|
628
|
+
pass
|
|
629
|
+
|
|
630
|
+
def _typecheckingstub__5cc55631b35a38a71d11cd70266d4b21b303a65a2b27449fa603a94b5e117dcd(
|
|
631
|
+
*,
|
|
632
|
+
identifiers: typing.Sequence[builtins.str],
|
|
633
|
+
start_schedule: typing.Union[ScheduleProperty, typing.Dict[builtins.str, typing.Any]],
|
|
634
|
+
stop_schedule: typing.Union[ScheduleProperty, typing.Dict[builtins.str, typing.Any]],
|
|
635
|
+
type: DatabaseType,
|
|
636
|
+
) -> None:
|
|
637
|
+
"""Type checking stubs"""
|
|
638
|
+
pass
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from pkgutil import extend_path
|
|
2
|
+
__path__ = extend_path(__path__, __name__)
|
|
3
|
+
|
|
4
|
+
import abc
|
|
5
|
+
import builtins
|
|
6
|
+
import datetime
|
|
7
|
+
import enum
|
|
8
|
+
import typing
|
|
9
|
+
|
|
10
|
+
import jsii
|
|
11
|
+
import publication
|
|
12
|
+
import typing_extensions
|
|
13
|
+
|
|
14
|
+
from typeguard import check_type
|
|
15
|
+
|
|
16
|
+
import aws_cdk._jsii
|
|
17
|
+
import constructs._jsii
|
|
18
|
+
|
|
19
|
+
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
20
|
+
"@gammarers/aws-rds-database-running-schedule-stack",
|
|
21
|
+
"1.2.0",
|
|
22
|
+
__name__[0:-6],
|
|
23
|
+
"aws-rds-database-running-schedule-stack@1.2.0.jsii.tgz",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
__all__ = [
|
|
27
|
+
"__jsii_assembly__",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
publication.publish()
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: gammarers.aws-rds-database-running-schedule-stack
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: AWS RDS Database Running Scheduler
|
|
5
|
+
Home-page: https://github.com/gammarers/aws-rds-database-running-schedule-stack.git
|
|
6
|
+
Author: yicr<yicr@users.noreply.github.com>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Source, https://github.com/gammarers/aws-rds-database-running-schedule-stack.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
19
|
+
Classifier: License :: OSI Approved
|
|
20
|
+
Requires-Python: ~=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.80.0
|
|
24
|
+
Requires-Dist: constructs<11.0.0,>=10.0.5
|
|
25
|
+
Requires-Dist: jsii<2.0.0,>=1.102.0
|
|
26
|
+
Requires-Dist: publication>=0.0.3
|
|
27
|
+
Requires-Dist: typeguard~=2.13.3
|
|
28
|
+
|
|
29
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/blob/main/LICENSE)
|
|
30
|
+
[](https://www.npmjs.com/package/@gammarer/aws-rds-database-running-schedule-stack)
|
|
31
|
+
[](https://pypi.org/project/gammarer.aws-rds-database-running-schedule-stack/)
|
|
32
|
+
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.RdsDatabaseRunningScheduler/)
|
|
33
|
+
[](https://s01.oss.sonatype.org/content/repositories/releases/com/gammarer/aws-rds-database-running-schedule-stack/)
|
|
34
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/actions/workflows/release.yml)
|
|
35
|
+
[](https://github.com/gammarers/aws-rds-database-running-schedule-stack/releases)
|
|
36
|
+
|
|
37
|
+
# AWS RDS Database Running Scheduler
|
|
38
|
+
|
|
39
|
+
This is an AWS CDK Construct to make RDS Database running schedule (only running while working hours(start/stop)).
|
|
40
|
+
|
|
41
|
+
## Fixed
|
|
42
|
+
|
|
43
|
+
* RDS Aurora Cluster
|
|
44
|
+
* RDS Instance
|
|
45
|
+
|
|
46
|
+
## Resources
|
|
47
|
+
|
|
48
|
+
This construct creating resource list.
|
|
49
|
+
|
|
50
|
+
* EventBridge Scheduler execution role
|
|
51
|
+
* EventBridge Scheduler
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
### TypeScript
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
npm install @gammarers/aws-rds-database-running-schedule-stack
|
|
59
|
+
# or
|
|
60
|
+
yarn add @gammarers/aws-rds-database-running-schedule-stack
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Python
|
|
64
|
+
|
|
65
|
+
```shell
|
|
66
|
+
pip install gammarers.aws-rds-database-running-schedule-stack
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### C# / .NET
|
|
70
|
+
|
|
71
|
+
```shell
|
|
72
|
+
dotnet add package Gammarers.CDK.AWS.RdsDatabaseRunningScheduleStack
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Example
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import { RdsDatabaseRunningScheduler, DatabaseType } from '@gammarer/aws-rds-database-running-schedule-stack';
|
|
79
|
+
|
|
80
|
+
new RdsDatabaseRunningScheduleStack(stack, 'RdsDatabaseRunningScheduleStack', {
|
|
81
|
+
targets: [
|
|
82
|
+
{
|
|
83
|
+
type: DatabaseType.CLUSTER,
|
|
84
|
+
identifiers: ['db-cluster-1a'],
|
|
85
|
+
startSchedule: {
|
|
86
|
+
timezone: 'UTC',
|
|
87
|
+
},
|
|
88
|
+
stopSchedule: {
|
|
89
|
+
timezone: 'UTC',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: DatabaseType.INSTANCE,
|
|
94
|
+
identifiers: ['db-instance-1a'],
|
|
95
|
+
startSchedule: {
|
|
96
|
+
timezone: 'UTC',
|
|
97
|
+
},
|
|
98
|
+
stopSchedule: {
|
|
99
|
+
timezone: 'UTC',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
This project is licensed under the Apache-2.0 License.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
gammarers/aws_rds_database_running_scheduler/__init__.py,sha256=XLJ7p9OvtNK1gCp3jvfdbA3fq8vAXJ7yFfwzUr7iY7s,32342
|
|
2
|
+
gammarers/aws_rds_database_running_scheduler/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
+
gammarers/aws_rds_database_running_scheduler/_jsii/__init__.py,sha256=k2kGRzAvS-Puii1lcm5-ERUBmXR53gYQKiaqQsbCj1c,545
|
|
4
|
+
gammarers/aws_rds_database_running_scheduler/_jsii/aws-rds-database-running-schedule-stack@1.2.0.jsii.tgz,sha256=O5bZNlAC-cVa6LFeorhQge1trmFJmm8gVkDyn-YjErc,30905
|
|
5
|
+
gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
6
|
+
gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/METADATA,sha256=-G7YYtLqHIPoo4EZ0De8A8vkNodQ8BTAiA110h8LAbs,4154
|
|
7
|
+
gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
8
|
+
gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/top_level.txt,sha256=aYHffMrt-8dtQoLeNk0M8OeqbA0a5gMcnNm5hL7OMHk,10
|
|
9
|
+
gammarers.aws_rds_database_running_schedule_stack-1.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gammarers
|