Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunmenon95 committed Jul 22, 2024
1 parent 848a1ed commit 5c240de
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ecs-task.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@
end
end

# add ebs volumes
ebs_volumes = external_parameters.fetch(:ebs_volumes, [])
ebs_volumes.each do |ebs_volume|
EC2_Volume(ebs_volume['name']) do
Size 100
VolumeType "gp3"
end
mount_points << { ContainerPath: ebs_volume['container_path'], SourceVolume: Ref(:ebs_volume['name']), ReadOnly: false}
volumes << {Name: Ref(:ebs_volume['name']), ConfiguredAtLaunch: true }
task_def.merge!({MountPoints: mount_points })
task_def.merge!({Volumes: volumes })
end

# add port
if task.key?('ports')
port_mapppings = []
Expand Down Expand Up @@ -237,19 +250,6 @@
task_volumes << object
end

# add ebs volumes
ebs_volumes = external_parameters.fetch(:ebs_volumes, [])
ebs_volumes.each do |ebs_volume|
EC2_Volume(ebs_volume['name']) do
Size 100
VolumeType "gp3"
end
mount_points << { ContainerPath: ebs_volume['container_path'], SourceVolume: Ref(:ebs_volume['name']), ReadOnly: false}
volumes << {Name: Ref(:ebs_volume['name']), ConfiguredAtLaunch: true }
task_def.merge!({MountPoints: mount_points })
task_def.merge!({Volumes: volumes })
end

# add task placement constraints
task_constraints =[];
task_placement_constraints = external_parameters.fetch(:task_placement_constraints, [])
Expand Down

0 comments on commit 5c240de

Please sign in to comment.