Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. Description: AWS CloudFormation template to create an RDS instance for the warehouse workers build
  2. Parameters:
  3. DBAllocatedStorage:
  4. Default: '5'
  5. Description: The size of the database (Gb)
  6. Type: Number
  7. DBClass:
  8. Default: db.t2.large
  9. Description: Database instance class
  10. Type: String
  11. DBSnapshotArn:
  12. Description: The ARN of the snapshot to restore
  13. Type: String
  14. Subnets:
  15. Description: List of subnetIds spanning 2 availability zones
  16. Type: List<AWS::EC2::Subnet::Id>
  17. VpcId:
  18. Description: VpcId of the VPC to deploy in
  19. Type: AWS::EC2::VPC::Id
  20. Resources:
  21. DBSubnetGroup:
  22. Type: AWS::RDS::DBSubnetGroup
  23. Properties:
  24. DBSubnetGroupDescription: Subnets for DB instance
  25. SubnetIds: !Ref 'Subnets'
  26. VpcSecurityGroup:
  27. Type: AWS::EC2::SecurityGroup
  28. Properties:
  29. GroupDescription: Security group for DB instances
  30. VpcId: !Ref 'VpcId'
  31. SecurityGroupIngress:
  32. -
  33. Description: "VPN traffic"
  34. CidrIp: '10.1.0.0/16'
  35. FromPort: 3306
  36. ToPort: 3306
  37. IpProtocol: 'tcp'
  38. SecurityGroupEgress:
  39. -
  40. Description: "All traffic"
  41. CidrIp: '0.0.0.0/0'
  42. FromPort: 3306
  43. ToPort: 3306
  44. IpProtocol: 'tcp'
  45. # Needed?
  46. # -
  47. # Description: "SageVpc - Private1"
  48. # CidrIp: '10.12.48.0/20'
  49. # FromPort: '3306'
  50. # ToPort: '3306'
  51. # IpProtocol: 'tcp'
  52. DB:
  53. Type: AWS::RDS::DBInstance
  54. Properties:
  55. AllocatedStorage: !Ref 'DBAllocatedStorage'
  56. DBInstanceClass: !Ref 'DBClass'
  57. DBSnapshotIdentifier: !Ref 'DBSnapshotArn'
  58. DBSubnetGroupName: !Ref 'DBSubnetGroup'
  59. Engine: MySQL
  60. EngineVersion: 5.6.34
  61. VPCSecurityGroups:
  62. - !Ref 'VpcSecurityGroup'
  63. Outputs:
  64. JDBCConnectionString:
  65. Description: JDBC connection string for database instance
  66. Value: !Join
  67. - ''
  68. - - jdbc:mysql://
  69. - !GetAtt 'DB.Endpoint.Address'
  70. - !GetAtt 'DB.Endpoint.Port'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement