#!/usr/bin/env ruby # Copyright 2013-2014 Bazaarvoice, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'bundler/setup' require 'cloudformation-ruby-dsl/cfntemplate' require 'cloudformation-ruby-dsl/table' # Note: this is only intended to demonstrate the cloudformation-ruby-dsl. It compiles # and validates correctly, but won't produce a viable CloudFormation stack. template do # Metadata may be embedded into the stack, as per http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html # The below definition produces CloudFormation interface metadata. metadata 'AWS::CloudFormation::Interface', { :ParameterGroups => [ { :Label => { :default => 'Instance options' }, :Parameters => [ 'InstanceType', 'ImageId', 'KeyPairName' ] }, { :Label => { :default => 'Other options' }, :Parameters => [ 'Label', 'EmailAddress' ] } ], :ParameterLabels => { :EmailAddress => { :default => "We value your privacy!" } } } parameter 'Label', :Description => 'The label to apply to the servers.', :Type => 'String', :MinLength => '2', :MaxLength => '25', :AllowedPattern => '[_a-zA-Z0-9]*', :ConstraintDescription => 'Maximum length of the Label parameter may not exceed 25 characters and may only contain letters, numbers and underscores.', # The :Immutable attribute is a Ruby CFN extension. It affects the behavior of the '