Skip to content

Commit a758f93

Browse files
authored
Enable encryption at rest (#11)
Enable encryption
1 parent 85af5db commit a758f93

File tree

7 files changed

+33
-28
lines changed

7 files changed

+33
-28
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.5.4
2+
current_version = 1.5.5
33
commit = False
44
tag = False
55

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
repos:
55
# General
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v3.2.0
7+
rev: v3.4.0
88
hooks:
99
- id: check-case-conflict
1010
- id: detect-private-key
@@ -35,16 +35,15 @@ repos:
3535

3636
# CloudFormation
3737
- repo: https://github.com/aws-cloudformation/cfn-python-lint
38-
rev: v0.37.1
38+
rev: v0.44.7
3939
hooks:
4040
- id: cfn-python-lint
4141
name: AWS CloudFormation Linter
4242
files: \.(template)$
4343
args: [--ignore-checks=W4002]
4444

45-
# The bug creates circular checks with end-of-file-fixer.
4645
- repo: https://github.com/aws-cloudformation/rain
47-
rev: 46a8f63541d848c8b57c129babdd124f324fdd78
46+
rev: v1.1.1
4847
hooks:
4948
- id: cfn-format
5049
files: \.template$
@@ -58,11 +57,11 @@ repos:
5857
- --errors-only
5958

6059
- repo: https://github.com/PyCQA/isort
61-
rev: 5.5.4
60+
rev: 5.7.0
6261
hooks:
6362
- id: isort
6463

6564
- repo: https://github.com/psf/black
66-
rev: stable
65+
rev: 20.8b1
6766
hooks:
6867
- id: black

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ The database is migrated using AWS DMS. It continuously synchronises changes in
3030

3131
#### Summary
3232

33-
This sample will deploy the two SQL Server instances (one EC2 and one Amazon RDS) in their own VPCs.
34-
The SQL Server running in the EC2 instance represents the on-premises infrastructure and the Amazon RDS instance represents,
35-
then create a sample database in both. No tables will be created at this point - creating of tables inside the database is left to the user.
36-
A DMS migration task will also be created. Upon starting that task (eg; using console or aws cli), tables in the database will be continually replicated across from the EC2 instance to the Amazon RDS instance.
33+
This sample will deploy two SQL Server instances, one on EC2 and one on Amazon RDS, in their own VPCs.
34+
The SQL Server running on the EC2 instance represents the on-premises infrastructure, and the Amazon RDS instance represents AWS cloud.
35+
No tables will be created at this point - creating of tables inside the database is left to the user.
36+
AWS DMS migration task will also be created. Upon starting that task (eg; using console or aws cli), tables in the database will be continually replicated across from the EC2 instance to the Amazon RDS instance.
3737

3838
### Architecture
3939

@@ -83,6 +83,7 @@ template are pre-populated. Click the *Next* button at the bottom of the page.
8383
|---------------|-------|-----------|
8484
|Availability Zones|Requires input|The list of Availability Zones to use for the subnets in the VPCs. *Use two AZs*.|
8585
|On premise CIDR IP|Requires input|The CIDR Allowed RDP and SQL access to the EC2 and RDS host. CIDR block parameter must be in the form x.x.x.x/0-32.|
86+
|DMSInstanceClass|dms.t3.large|Instance class of DMS instance.|
8687
|EC2 instance type|m5.2xlarge|The EC2 instance type for Microsoft SQL server.|
8788
|Windows server AMI|/aws/service/ami-windows-latest/Windows_Server-2019-English-Full-SQL_2016_SP2_Standard|Query for the Latest Windows AMI Using Systems Manager Parameter Store https://aws.amazon.com/blogs/mt/query-for-the-latest-windows-ami-using-systems-manager-parameter-store/|
8889
|MSSQL Server version|13|MSSQL Server version. This is used to Change Auth mode from Windows only to SQL and Windows Auth. For MSSQL server 2017 use number 14, for MSSQL server 2016 use number 13.|
@@ -111,7 +112,7 @@ template are pre-populated. Click the *Next* button at the bottom of the page.
111112
[Database guide](docs/database/README.md)
112113

113114
### Limitations
114-
- MSSQL server 2017 doesnt support continues replication. The solution is using MSSQL server 2016 by default.
115+
- MSSQL server 2017 doesn't support continues replication. The solution is using MSSQL server 2016 by default.
115116

116117
## Local Development
117118
See [Local Development](docs/LOCAL_DEVELOPMENT.md) guide to get a copy of the project up and running on your local machine for development and testing purposes.
@@ -123,7 +124,7 @@ To remove the stack:
123124
1. Open the AWS CloudFormation Console
124125
1. Click the *aws-dms-sql-server* project, right-click and select "*Delete Stack*"
125126
1. Your stack will take some time to be deleted. You can track its progress in the "Events" tab.
126-
1. When it is done, the status will change from DELETE_IN_PROGRESS" to "DELETE_COMPLETE". It will then disappear from the list.
127+
1. When it is done, the status will change from "DELETE_IN_PROGRESS" to "DELETE_COMPLETE". It will then disappear from the list.
127128

128129
## Contributing
129130

cfn/dms.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Parameters:
3232
Description: RDS Security Group ID.
3333
Type: AWS::EC2::SecurityGroup::Id
3434

35+
DMSInstanceClass:
36+
Type: String
37+
3538
Resources:
3639
DMSSecurityGroup:
3740
Type: AWS::EC2::SecurityGroup
@@ -72,7 +75,7 @@ Resources:
7275
Type: AWS::DMS::ReplicationInstance
7376
Properties:
7477
PubliclyAccessible: false
75-
ReplicationInstanceClass: dms.t2.large
78+
ReplicationInstanceClass: !Ref DMSInstanceClass
7679
ReplicationSubnetGroupIdentifier: !Ref ReplicationSubnetGroup
7780
VpcSecurityGroupIds:
7881
- !Ref DMSSecurityGroup

cfn/ec2-sql.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ Resources:
260260
Ebs:
261261
VolumeSize: 100
262262
VolumeType: gp2
263+
Encrypted: true
264+
DeleteOnTermination: true
263265
ImageId: !Ref WindowsSQLAMI
264266
InstanceType: !Ref WindowsSQLInstanceType
265267
SecurityGroupIds:

cfn/main.template

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AWSTemplateFormatVersion: "2010-09-09"
33
Description: Creates AWS infrastructure to deploy DMS solution. (uksb-1ppahhhui)
44

55
Metadata:
6-
Version: 1.5.4
6+
Version: 1.5.5
77

88
AWS::CloudFormation::Interface:
99
ParameterGroups:
@@ -12,6 +12,10 @@ Metadata:
1212
Parameters:
1313
- AvailabilityZones
1414
- OnPremCidr
15+
- Label:
16+
default: AWS DMS configuration
17+
Parameters:
18+
- DMSInstanceClass
1519
- Label:
1620
default: EC2 SQL instance configuration
1721
Parameters:
@@ -35,6 +39,8 @@ Metadata:
3539
default: Availability Zones
3640
OnPremCidr:
3741
default: On premise CIDR IP
42+
DMSInstanceClass:
43+
default: DMS instance class
3844
WindowsSQLInstanceType:
3945
default: EC2 instance type
4046
WindowsSQLAMI:
@@ -66,6 +72,11 @@ Parameters:
6672
AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$
6773
ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/0-32
6874

75+
DMSInstanceClass:
76+
Description: Instance class of DMS instance
77+
Type: String
78+
Default: dms.t3.large
79+
6980
WindowsSQLAMI:
7081
Description: The latest Windows server 2019 with SQL 2016 Standard AMI
7182
Type: AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>
@@ -74,9 +85,6 @@ Parameters:
7485
WindowsSQLInstanceType:
7586
Description: The instance type for MS SQL server.
7687
Type: String
77-
AllowedValues:
78-
- t3.2xlarge
79-
- m5.2xlarge
8088
Default: m5.2xlarge
8189

8290
MSSQLVersion:
@@ -110,13 +118,6 @@ Parameters:
110118
DbInstanceclass:
111119
Description: Instance class of RDS instance
112120
Type: String
113-
AllowedValues:
114-
- db.m4.large
115-
- db.m4.16xlarge
116-
- db.r4.large
117-
- db.r4.16xlarge
118-
- db.m5.large
119-
- db.m5.24xlarge
120121
Default: db.m5.large
121122

122123
Engine:
@@ -145,8 +146,6 @@ Mappings:
145146
PublicSubnet1Cidr: 10.1.0.0/24
146147
PublicSubnet2Cidr: 10.1.1.0/24
147148

148-
Transform: AWS::Serverless-2016-10-31
149-
150149
Resources:
151150
DMSIAMRoles:
152151
Type: AWS::CloudFormation::Stack
@@ -258,6 +257,7 @@ Resources:
258257
Username: !Ref Username
259258
WindowsSQLSecurityGroup: !GetAtt EC2SQL.Outputs.WindowsSQLSecurityGroup
260259
RDSSecurityGroup: !GetAtt RDSSQL.Outputs.RDSSecurityGroup
260+
DMSInstanceClass: !Ref DMSInstanceClass
261261

262262
DmsTaskConf:
263263
Type: AWS::CloudFormation::Stack

cfn/rds-sql.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Resources:
4747
MasterUsername: !Ref DBUsername
4848
MultiAZ: false
4949
PubliclyAccessible: true
50-
StorageEncrypted: false
50+
StorageEncrypted: true
5151
StorageType: gp2
5252
VPCSecurityGroups:
5353
- !GetAtt RDSSecurityGroup.GroupId

0 commit comments

Comments
 (0)