From 347446f8410564b160beb2f88d1a58517dbbb56e Mon Sep 17 00:00:00 2001 From: Javier Ros Date: Fri, 20 May 2016 10:25:54 +0000 Subject: [PATCH] CloudFormation template issue with Beanstalk solved --- lib/aws_common.rb | 4 ---- reservedinstances.cform | 12 +++++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/aws_common.rb b/lib/aws_common.rb index 6abc3a1..1a6045f 100644 --- a/lib/aws_common.rb +++ b/lib/aws_common.rb @@ -5,10 +5,6 @@ module AwsCommon METADATA_ENDPOINT = 'http://169.254.169.254/latest/meta-data/' PLATFORMS = {'RunInstances:000g' => 'SUSE Linux', 'RunInstances:0006' => 'Windows with SQL Server Standard', 'RunInstances:0202' => 'Windows with SQL Server Web', 'RunInstances:0010' => 'Red Hat Enterprise Linux', 'RunInstances:0102' => 'Windows with SQL Server Enterprise'} - def get_regions - return ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'] - end - def get_current_account_id Rails.cache.fetch("current_account_id", expires_in: 24.hours) do iam_data = Net::HTTP.get( URI.parse( METADATA_ENDPOINT + 'iam/info' ) ) diff --git a/reservedinstances.cform b/reservedinstances.cform index c266311..c23276a 100644 --- a/reservedinstances.cform +++ b/reservedinstances.cform @@ -81,6 +81,11 @@ "m4.xlarge" ], "Description": "Increase the instance type for the worker if you have a big DBR file and you're going to use it." + }, + "BeanstalkStackName": { + "Description": "Name of the beankstalk Stack (Ruby 2.2 with Passenger): http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html#concepts.platforms.ruby", + "Type": "String", + "Default": "64bit Amazon Linux 2016.03 v2.1.2 running Ruby 2.2 (Passenger Standalone)" } }, "Resources": { @@ -183,7 +188,7 @@ "Ref": "RIApplication" }, "Description": "Reserved Instances Tool Application Web Server", - "SolutionStackName": "64bit Amazon Linux 2015.09 v2.0.4 running Ruby 2.2 (Passenger Standalone)", + "SolutionStackName": { "Ref": "BeanstalkStackName" }, "VersionLabel": { "Ref": "RIApplicationVersion" }, @@ -331,14 +336,14 @@ "Ref": "RIApplication" }, "Description": "Reserved Instances Tool Worker to apply the recommendations automatically", - "SolutionStackName": "64bit Amazon Linux 2015.09 v2.0.4 running Ruby 2.2 (Passenger Standalone)", + "SolutionStackName": { "Ref": "BeanstalkStackName" }, "VersionLabel": { "Ref": "RIApplicationVersion" }, "Tier": { "Type": "SQS/HTTP", "Name": "Worker", - "Version": "2.0" + "Version": " " }, "OptionSettings": [ { @@ -492,3 +497,4 @@ } } } +