sample/ecs.rb in cfndsl-0.4.4 vs sample/ecs.rb in cfndsl-0.5.0.pre
- old
+ new
@@ -1,51 +1,51 @@
-CloudFormation {
- DESCRIPTION ||= "ecs description"
+CloudFormation do
+ DESCRIPTION ||= 'ecs description'.freeze
Description DESCRIPTION
- Resource('MyECSCluster') {
+ Resource('MyECSCluster') do
Type 'AWS::ECS::Cluster'
- }
+ end
- Resource('MyTaskDef') {
+ Resource('MyTaskDef') do
Type 'AWS::ECS::Service'
- Property('ContainerDefinitions', [
- {
- Command: ['echo hello'],
- Cpu: 300,
- EntryPoint: ['/bin/bash'],
- Environment: [{
- Name: 'test',
- Value: 'testvalue'
- }],
- Essential: true,
- Image: 'ubuntu:latest',
- Links: ['myothercontainer'],
- Memory: 1024,
- MountPoints: [{
- ContainerPath: '/var/log',
- SourceVolume: 'log_volume',
- ReadOnly: false
- }],
- Name: 'MyTaskDef',
- PortMappings: [{
- ContainerPort: 80,
- HostPort: 8080
- }],
- VolumesFrom: [{
- SourceContainer: 'myothercontainer',
- ReadOnly: true
- }]
+ Property('ContainerDefinitions',
+ [
+ {
+ Command: ['echo hello'],
+ Cpu: 300,
+ EntryPoint: ['/bin/bash'],
+ Environment: [{
+ Name: 'test',
+ Value: 'testvalue'
+ }],
+ Essential: true,
+ Image: 'ubuntu:latest',
+ Links: ['myothercontainer'],
+ Memory: 1024,
+ MountPoints: [{
+ ContainerPath: '/var/log',
+ SourceVolume: 'log_volume',
+ ReadOnly: false
+ }],
+ Name: 'MyTaskDef',
+ PortMappings: [{
+ ContainerPort: 80,
+ HostPort: 8080
+ }],
+ VolumesFrom: [{
+ SourceContainer: 'myothercontainer',
+ ReadOnly: true
+ }]
+ }
+ ])
+ end
- }
- ])
- }
-
- Resource('MyECSService') {
+ Resource('MyECSService') do
Type 'AWS::ECS::Service'
Property('Cluster', Ref('MyECSCluster'))
Property('DesiredCount', 10)
Property('Role', 'ecsServiceRole')
Property('TaskDefinition', 'MyTask:1')
- }
-}
+ end
+end