Last active
July 18, 2017 15:23
-
-
Save star3am/d5c84ba4a6a00f6abdb57d1d0a50fac3 to your computer and use it in GitHub Desktop.
Cloudformation Template Aurora, MySQL, Redshift, Memcache and Redis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Database Stack by riaan@riaannolan.com", | |
"Parameters": { | |
"InboundTraffic": { | |
"Description": "Allow inbound traffic to the cluster from this CIDR range.", | |
"Type": "String", | |
"MinLength": "9", | |
"MaxLength": "18", | |
"Default": "0.0.0.0/0", | |
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})", | |
"ConstraintDescription": "must be a valid CIDR range of the form x.x.x.x/x." | |
}, | |
"Username": { | |
"Description": "The user name that is associated with the master user account for the cluster that is being created", | |
"Type": "String", | |
"Default": "root", | |
"AllowedPattern": "([a-z])([a-z]|[0-9])*" | |
}, | |
"Password": { | |
"Description": "The password that is associated with the master user account for the cluster that is being created.", | |
"Type": "String", | |
"Default": "TaeJ2eez", | |
"NoEcho": "true" | |
}, | |
"RdsMysqlInstanceType": { | |
"Description": "RdsMysqlInstanceType", | |
"Type": "String", | |
"Default": "db.t2.large", | |
"ConstraintDescription": "Must be a valid instance type" | |
}, | |
"RdsAuroraPrimaryInstanceType": { | |
"Description": "RdsAuroraPrimaryInstanceType", | |
"Type": "String", | |
"Default": "db.r3.large", | |
"ConstraintDescription": "Must be a valid instance type" | |
}, | |
"RdsAuroraSecondaryInstanceType": { | |
"Description": "RdsAuroraSecondaryInstanceType", | |
"Type": "String", | |
"Default": "db.t2.medium", | |
"ConstraintDescription": "Must be a valid instance type" | |
}, | |
"RedshiftDatabaseName": { | |
"Description": "The name of the first database to be created when the cluster is created", | |
"Type": "String", | |
"Default": "company", | |
"AllowedPattern": "([a-z]|[0-9])+" | |
}, | |
"RedshiftClusterType": { | |
"Description": "The type of cluster", | |
"Type": "String", | |
"Default": "single-node", | |
"AllowedValues": [ "single-node", "multi-node" ] | |
}, | |
"RedshiftNumberOfNodes": { | |
"Description": "The number of compute nodes in the cluster. For multi-node clusters, the NumberOfNodes parameter must be greater than 1", | |
"Type": "Number", | |
"Default": "1" | |
}, | |
"RedshiftNodeType": { | |
"Description": "The type of node to be provisioned", | |
"Type": "String", | |
"Default": "ds2.xlarge" | |
}, | |
"RedshiftPortNumber": { | |
"Description": "The port number on which the cluster accepts incoming connections.", | |
"Type": "Number", | |
"Default": "5439" | |
} | |
}, | |
"Mappings": { | |
}, | |
"Conditions": { | |
"IsMultiNodeCluster": { | |
"Fn::Equals": [{ "Ref": "RedshiftClusterType" }, "multi-node" ] | |
} | |
}, | |
"Resources": { | |
"VPCId": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.1.0.0/16", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "true", | |
"Tags": [ | |
{ "Key": "Name", "Value": { "Ref": "AWS::StackName" } }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"VPCRouteTable": { | |
"Type": "AWS::EC2::RouteTable", | |
"Properties": { | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": { "Ref": "AWS::StackName" } }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"VPCInternetGateway": { | |
"Type": "AWS::EC2::InternetGateway", | |
"Properties": { | |
"Tags": [ | |
{ "Key": "Name", "Value": { "Ref": "AWS::StackName" } }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"VPCInternetGatewayAttachment": { | |
"Type": "AWS::EC2::VPCGatewayAttachment", | |
"Properties": { | |
"VpcId": { "Ref" : "VPCId" }, | |
"InternetGatewayId": { "Ref" : "VPCInternetGateway" } | |
} | |
}, | |
"VPCInternetRoute": { | |
"DependsOn" : "VPCInternetGatewayAttachment", | |
"Type": "AWS::EC2::Route", | |
"Properties": { | |
"RouteTableId": { "Ref": "VPCRouteTable" }, | |
"DestinationCidrBlock": "0.0.0.0/0", | |
"GatewayId": { "Ref": "VPCInternetGateway" } | |
} | |
}, | |
"RdsSubnet5": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.105.0/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsSubnet532": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.105.32/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RedshiftSubnet7": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.107.0/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RedshiftSubnet732": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.107.32/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"ElasticacheSubnet6": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "0", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.106.0/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"ElasticacheSubnet632": { | |
"Type": "AWS::EC2::Subnet", | |
"Properties": { | |
"AvailabilityZone": { "Fn::Select": [ "1", { "Fn::GetAZs": { "Ref": "AWS::Region" } } ] }, | |
"CidrBlock": "10.1.106.32/27", | |
"VpcId": { "Ref": "VPCId" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsSubnet5RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "RdsSubnet5" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"RdsSubnet532RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "RdsSubnet532" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"RedshiftSubnet7RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "RedshiftSubnet7" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"RedshiftSubnet732RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "RedshiftSubnet732" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"ElasticacheSubnet6RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "ElasticacheSubnet6" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"ElasticacheSubnet632RouteTableAssociation": { | |
"Type": "AWS::EC2::SubnetRouteTableAssociation", | |
"Properties": { | |
"SubnetId": { "Ref": "ElasticacheSubnet632" }, | |
"RouteTableId": { "Ref": "VPCRouteTable" } | |
} | |
}, | |
"RdsSubnetGroup": { | |
"Type": "AWS::RDS::DBSubnetGroup", | |
"Properties": { | |
"DBSubnetGroupDescription": "RdsSubnetGroup", | |
"SubnetIds": [ | |
{ "Ref": "RdsSubnet5" }, | |
{ "Ref": "RdsSubnet532" } | |
], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RedshiftSubnetGroup" : { | |
"Type" : "AWS::Redshift::ClusterSubnetGroup", | |
"Properties" : { | |
"Description" : "RedshiftSubnetGroup", | |
"SubnetIds": [ | |
{ "Ref": "RedshiftSubnet7" }, | |
{ "Ref": "RedshiftSubnet732" } | |
], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsSecurityGroup" : { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "RdsSecurityGroup", | |
"VpcId": { "Ref": "VPCId" }, | |
"SecurityGroupEgress": [], | |
"SecurityGroupIngress": [ | |
{ "IpProtocol": "tcp", "FromPort": "3306", "ToPort": "3306", "CidrIp": { "Ref": "InboundTraffic" } } | |
], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsMysqlParameterGroup" : { | |
"Type" : "AWS::RDS::DBParameterGroup", | |
"Properties" : { | |
"Description" : "Rds ParameterGroup", | |
"Family" : "MySQL5.6", | |
"Parameters" : { | |
"binlog_format": "ROW", | |
"character_set_server": "utf8", | |
"interactive_timeout": "180", | |
"log_bin_trust_function_creators": "1", | |
"log_queries_not_using_indexes": "0", | |
"long_query_time": "8", | |
"slow_query_log": "1", | |
"wait_timeout": "180", | |
"innodb_print_all_deadlocks": "1" | |
} | |
} | |
}, | |
"RdsMysqlInstance": { | |
"Type": "AWS::RDS::DBInstance", | |
"Properties": { | |
"Engine": "MySQL", | |
"EngineVersion": "5.6", | |
"DBInstanceIdentifier": "company-stack-environment-role", | |
"DBParameterGroupName": { "Ref": "RdsMysqlParameterGroup" }, | |
"DBSubnetGroupName": { "Ref" : "RdsSubnetGroup" }, | |
"VPCSecurityGroups": [ { "Ref": "RdsSecurityGroup" } ], | |
"MasterUsername": { "Ref": "Username" }, | |
"DBInstanceClass": { "Ref": "RdsMysqlInstanceType" }, | |
"AllocatedStorage": "100", | |
"MasterUserPassword": { "Ref": "Password" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
}, | |
"DeletionPolicy": "Delete" | |
}, | |
"RdsAuroraCluster": { | |
"Type": "AWS::RDS::DBCluster", | |
"Properties": { | |
"Engine": "aurora", | |
"DBSubnetGroupName": { "Ref": "RdsSubnetGroup" }, | |
"DBClusterParameterGroupName": { "Ref": "RdsAuroraClusterParameterGroup" }, | |
"MasterUsername": { "Ref": "Username" }, | |
"MasterUserPassword": { "Ref": "Password" } | |
}, | |
"DeletionPolicy": "Delete" | |
}, | |
"RdsAuroraPrimaryInstance": { | |
"Type": "AWS::RDS::DBInstance", | |
"Properties": { | |
"DBSubnetGroupName": { "Ref": "RdsSubnetGroup" }, | |
"DBParameterGroupName": { "Ref": "RdsAuroraParameterGroup" }, | |
"Engine": "aurora", | |
"DBClusterIdentifier": { "Ref": "RdsAuroraCluster" }, | |
"PubliclyAccessible": "false", | |
"AvailabilityZone": { "Fn::GetAtt": [ "RdsSubnet5", "AvailabilityZone" ] }, | |
"DBInstanceClass": { "Ref": "RdsAuroraPrimaryInstanceType" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsAuroraSecondaryInstance": { | |
"Type": "AWS::RDS::DBInstance", | |
"Properties": { | |
"DBSubnetGroupName": { "Ref": "RdsSubnetGroup" }, | |
"DBParameterGroupName": { "Ref": "RdsAuroraParameterGroup" }, | |
"Engine": "aurora", | |
"DBClusterIdentifier": { "Ref": "RdsAuroraCluster" }, | |
"PubliclyAccessible": "false", | |
"AvailabilityZone": { "Fn::GetAtt": [ "RdsSubnet532", "AvailabilityZone" ] }, | |
"DBInstanceClass": { "Ref": "RdsAuroraSecondaryInstanceType" }, | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RdsAuroraClusterParameterGroup": { | |
"Type": "AWS::RDS::DBClusterParameterGroup", | |
"Properties": { | |
"Description": "RdsAuroraClusterParameterGroup", | |
"Family": "aurora5.6", | |
"Parameters": { | |
"time_zone": "UTC" | |
} | |
} | |
}, | |
"RdsAuroraParameterGroup": { | |
"Type": "AWS::RDS::DBParameterGroup", | |
"Properties": { | |
"Description": "RdsAuroraParameterGroup", | |
"Family": "aurora5.6", | |
"Parameters": { | |
"sql_mode": "IGNORE_SPACE", | |
"performance_schema": "1", | |
"interactive_timeout": "180", | |
"log_bin_trust_function_creators": "1", | |
"log_queries_not_using_indexes": "0", | |
"long_query_time": "1", | |
"slow_query_log": "1", | |
"wait_timeout": "180", | |
"innodb_print_all_deadlocks": "1", | |
"max_connect_errors": "10000" | |
} | |
} | |
}, | |
"RedshiftClusterSecurityGroup" : { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "RedshiftClusterSecurityGroup", | |
"VpcId": { "Ref": "VPCId" }, | |
"SecurityGroupEgress": [], | |
"SecurityGroupIngress": [ | |
{ "IpProtocol": "tcp", "FromPort": "5439", "ToPort": "5439", "CidrIp": { "Ref": "InboundTraffic" } } | |
], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"RedshiftCluster": { | |
"Type": "AWS::Redshift::Cluster", | |
"DeletionPolicy": "Delete", | |
"Properties": { | |
"ClusterType": { "Ref": "RedshiftClusterType" }, | |
"NumberOfNodes": { "Fn::If": [ "IsMultiNodeCluster", { "Ref": "RedshiftNumberOfNodes" }, { "Ref": "AWS::NoValue" }]}, | |
"NodeType": { "Ref": "RedshiftNodeType" }, | |
"DBName": { "Ref": "RedshiftDatabaseName" }, | |
"MasterUsername": { "Ref": "Username" }, | |
"MasterUserPassword": { "Ref": "Password" }, | |
"ClusterParameterGroupName": { "Ref": "RedshiftClusterParameterGroup" }, | |
"ClusterSubnetGroupName": { "Ref": "RedshiftSubnetGroup" }, | |
"VpcSecurityGroupIds": [ { "Ref": "RedshiftClusterSecurityGroup" } ], | |
"PubliclyAccessible": "true", | |
"Port": { "Ref": "RedshiftPortNumber" }, | |
"AllowVersionUpgrade": "true", | |
"AutomatedSnapshotRetentionPeriod": "14" | |
} | |
}, | |
"RedshiftClusterParameterGroup": { | |
"Type": "AWS::Redshift::ClusterParameterGroup", | |
"Properties": { | |
"Description": "Cluster parameter group", | |
"ParameterGroupFamily": "redshift-1.0", | |
"Parameters": [{ | |
"ParameterName": "enable_user_activity_logging", | |
"ParameterValue": "true" | |
}] | |
} | |
}, | |
"ElasticacheSubnetGroup": { | |
"Type": "AWS::ElastiCache::SubnetGroup", | |
"Properties": { | |
"Description": "Elasticache Subnet Group", | |
"SubnetIds": [ | |
{ "Ref": "ElasticacheSubnet6" }, | |
{ "Ref": "ElasticacheSubnet632" } | |
] | |
} | |
}, | |
"ElasticacheSecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "ElasticacheSecurityGroup", | |
"VpcId": { "Ref": "VPCId" }, | |
"SecurityGroupIngress": [ | |
{ "IpProtocol": "tcp", "FromPort": "11211", "ToPort": "11211", "CidrIp": { "Ref": "InboundTraffic" } }, | |
{ "IpProtocol": "tcp", "FromPort": "6379", "ToPort": "6379", "CidrIp": { "Ref": "InboundTraffic" } } | |
], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"ElasticacheMemcacheCluster": { | |
"Type": "AWS::ElastiCache::CacheCluster", | |
"Properties": { | |
"AutoMinorVersionUpgrade": "true", | |
"Engine": "memcached", | |
"CacheNodeType": "cache.t2.micro", | |
"NumCacheNodes": "1", | |
"CacheSubnetGroupName": { "Ref": "ElasticacheSubnetGroup" }, | |
"VpcSecurityGroupIds": [{"Fn::GetAtt": [ "ElasticacheSecurityGroup", "GroupId"]}], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
}, | |
"ElasticacheRedisCluster": { | |
"Type": "AWS::ElastiCache::CacheCluster", | |
"Properties": { | |
"CacheNodeType": "cache.t2.micro", | |
"Engine": "redis", | |
"NumCacheNodes": "1", | |
"CacheSubnetGroupName": { "Ref": "ElasticacheSubnetGroup" }, | |
"VpcSecurityGroupIds": [{"Fn::GetAtt": [ "ElasticacheSecurityGroup", "GroupId"]}], | |
"Tags": [ | |
{ "Key": "Name", "Value": "name" }, | |
{ "Key": "Fleet", "Value": "fleet" }, | |
{ "Key": "Company", "Value": "company" }, | |
{ "Key": "Stack", "Value": "stack" }, | |
{ "Key": "Environment", "Value": "environment" }, | |
{ "Key": "Role", "Value": "role" }, | |
{ "Key": "CloudformationStack", "Value": { "Ref": "AWS::StackName" } } | |
] | |
} | |
} | |
}, | |
"Outputs": { | |
"RdsAuroraCluster": { | |
"Description": "RdsAuroraCluster", | |
"Value": { "Fn::Join": [ "", [ "jdbc:mysql://", { "Fn::GetAtt": [ "RdsAuroraCluster", "Endpoint.Address" ] }, ":", { "Fn::GetAtt": [ "RdsAuroraCluster", "Endpoint.Port" ] }, "/", { "Ref": "RdsAuroraCluster" }]]} | |
}, | |
"RdsMysqlInstance": { | |
"Description": "RdsMysqlInstance", | |
"Value": { "Fn::Join": [ "", [ "jdbc:mysql://", { "Fn::GetAtt": [ "RdsMysqlInstance", "Endpoint.Address" ] }, ":", { "Fn::GetAtt": [ "RdsMysqlInstance", "Endpoint.Port" ] }, "/", { "Ref": "RdsMysqlInstance" }]]} | |
}, | |
"RedshiftCluster": { | |
"Description": "RedshiftCluster", | |
"Value": { "Fn::Join": [ ":", [ { "Fn::GetAtt": [ "RedshiftCluster", "Endpoint.Address" ] }, { "Fn::GetAtt": [ "RedshiftCluster", "Endpoint.Port" ] } ] ] } | |
}, | |
"ElasticacheMemcacheCluster": { | |
"Description": "ElasticacheMemcacheCluster", | |
"Value": { | |
"Fn::GetAtt": [ "ElasticacheMemcacheCluster", "ConfigurationEndpoint.Address" ] | |
} | |
}, | |
"ElasticacheRedisCluster": { | |
"Description": "ElasticacheRedisCluster", | |
"Value": { | |
"Fn::GetAtt": [ "ElasticacheRedisCluster", "ConfigurationEndpoint.Address" ] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment