Skip to content

Instantly share code, notes, and snippets.

@tkhk
Last active November 18, 2021 21:16
Show Gist options
  • Save tkhk/6b1bc6e61bb4209ac95b1cee4cf8c652 to your computer and use it in GitHub Desktop.
Save tkhk/6b1bc6e61bb4209ac95b1cee4cf8c652 to your computer and use it in GitHub Desktop.
5.7 互換の aurora serverless は CloudFormation で作成できないため、この yaml は使えない。作成できるようになった時用。
AWSTemplateFormatVersion: 2010-09-09
Parameters:
VpcId:
Type: AWS::EC2::VPC::Id
PrivateSubnetIds:
Type: List<AWS::EC2::Subnet::Id>
RdsAdminName:
Type: String
Default: admin
RdsAdminPassword:
Type: String
Resources:
RdsClusterParameterGroup:
Type: AWS::RDS::DBClusterParameterGroup
Properties:
Description: sample aurora serverless
Family: aurora-mysql5.7
Parameters:
character_set_client: utf8mb4
character_set_connection: utf8mb4
character_set_database: utf8mb4
character_set_filesystem: utf8mb4
character_set_results: utf8mb4
character_set_server: utf8mb4
innodb_large_prefix: 1
innodb_file_format: Barracuda
RdsSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: sample aurora serverless
SubnetIds: !Ref PrivateSubnetIds
RdsSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: sample aurora serverless
Rds:
Type: AWS::RDS::DBCluster
Properties:
BackupRetentionPeriod: 1
DBClusterParameterGroupName: !Ref 'RdsClusterParameterGroup'
DBSubnetGroupName: !Ref 'RdsSubnetGroup'
DeletionProtection: false
Engine: aurora
EngineMode: serverless
# 5.7 互換の serverless はまだ作れない
EngineVersion: 2.07.1
MasterUsername: !Ref 'RdsAdminName'
MasterUserPassword: !Ref 'RdsAdminPassword'
PreferredBackupWindow: 18:00-18:30
PreferredMaintenanceWindow: Tue:06:00-Tue:06:30
ScalingConfiguration:
MinCapacity: 1
AutoPause: true
MaxCapacity: 1
SecondsUntilAutoPause: 1800
VpcSecurityGroupIds:
- !Ref 'RdsSecurityGroup'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment