{"id":3884,"date":"2024-05-27T05:32:15","date_gmt":"2024-05-27T04:32:15","guid":{"rendered":"https:\/\/www.easydeploy.io\/blog\/?p=3884"},"modified":"2024-05-27T05:35:03","modified_gmt":"2024-05-27T04:35:03","slug":"how-to-schedule-ecs-stop-and-start-automatically-using-lambda","status":"publish","type":"post","link":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/","title":{"rendered":"How to schedule ecs stop and start automatically using Lambda"},"content":{"rendered":"<p>In this article, we are going to cover a<strong> schedule ECS stop and start automatically using Lambda.<\/strong><\/p>\n<p><strong>ECS &#8211; <\/strong>ECS\u00a0is a fully managed container orchestration service provided by\u00a0Amazon Web Services. It enables you to run, stop, and manage Docker containers on a cluster of virtual machines that are managed by AWS.\u00a0ECS\u00a0simplifies the process of deploying, managing, and scaling containerized applications.<\/p>\n<p><strong>Eventbridge &#8211; <\/strong>Amazon EventBridge is a serverless service that helps you connect different parts of your applications and services together using events. In other words, it&#8217;s an event bus that lets various components communicate by emitting (sending) and responding to events.<\/p>\n<p><strong>Lambda<\/strong> &#8211; AWS Lambda is a serverless computing service offered by AWS that allows you to run code without provisioning or managing servers. That enables developers to build and deploy applications and services quickly and efficiently by focusing on writing code, without the need to manage infrastructure.<\/p>\n<p>If you would like to follow a video tutorial please use our YouTube video.<\/p>\n<div class=\"wpex-responsive-embed\"><iframe loading=\"lazy\" title=\"Save AWS cost on DEV, QA by scheduling ECS automatically start and stop using Lambda | Event bridge\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/ShYSJ_SE800?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p><span class=\"yt-core-attributed-string yt-core-attributed-string--white-space-pre-wrap\"><span class=\"yt-core-attributed-string--link-inherit-color\">The IAM policy and the lambda code are available in the <a href=\"https:\/\/github.com\/easydeploy-cloud\/ecs-auto-start-stop\">https:\/\/github.com\/easydeploy-cloud\/ecs-auto-start-stop<\/a>\u00a0 <\/span><span class=\"yt-core-attributed-string--link-inherit-color\"><\/span><span class=\"yt-core-attributed-string--link-inherit-color\">repository. <\/span><\/span><\/p>\n<h1>Create policy<\/h1>\n<p>Go to &gt;&gt; <strong>IAM services<\/strong>, click &gt;&gt; <strong>policies<\/strong>, click &gt;&gt;<strong> create policy<\/strong>.<\/p>\n<p>Choose &gt;&gt; <strong>lambda in service<\/strong>, click &gt;&gt; <strong>json<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/1e-1.png\" alt=\"IAM policies\" width=\"1909\" height=\"880\" class=\"aligncenter wp-image-3943 size-full\" title=\"IAM policies\" \/><\/p>\n<p>Add scripts in the policy, and click &gt;&gt; <strong>next<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/2e.png\" alt=\"IAM policies\" width=\"1695\" height=\"787\" class=\"aligncenter wp-image-3944 size-full\" title=\"IAM policies\" \/><\/p>\n<p>Type &gt;&gt;<strong> policy name<\/strong>, (I am giving &#8220;ECSservicestart-stop&#8221;), click &gt;&gt; <strong>create<\/strong> <strong>policy<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/3e.png\" alt=\"IAM policies\" width=\"1696\" height=\"790\" class=\"aligncenter wp-image-3945 size-full\" title=\"IAM policies\" \/><\/p>\n<p>we successfully created a policy, now we want to attach the policy to the role<\/p>\n<p>click &gt;&gt; <strong>roles<\/strong>, click &gt;&gt; <strong>create roles<\/strong>, choose &gt;&gt; <strong>aws service<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/4e.png\" alt=\"IAM roles\" width=\"1702\" height=\"795\" class=\"aligncenter wp-image-3946 size-full\" title=\"IAM roles\" \/><\/p>\n<p>In service or use case, choose &gt;&gt; <strong>lambda<\/strong> and click &gt;&gt; <strong>next.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/5e.png\" alt=\"IAM roles\" width=\"1702\" height=\"742\" class=\"aligncenter wp-image-3947 size-full\" title=\"IAM roles\" \/><\/p>\n<p>In permission, add the created policy and click &gt;&gt; <strong>next<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/6e.png\" alt=\"IAM roles\" width=\"1683\" height=\"790\" class=\"aligncenter wp-image-3948 size-full\" title=\"IAM roles\" \/><\/p>\n<p>Give a name to the role, I am giving &#8220;<strong>ECS<\/strong>&#8220;, click &gt;&gt; create role<\/p>\n<h1>Create lambda<\/h1>\n<p>Go to lambda service, click &gt;&gt; <strong>create<\/strong> <strong>function<\/strong>, and give a function name (i am giving &#8220;<strong>ECSservicestart-stop<\/strong>&#8220;).<\/p>\n<p>In language , choose &gt;&gt; <strong>python<\/strong>, click &gt;&gt; <strong>change default execution role<\/strong>, click &gt;&gt;<strong> use an existing role<\/strong>, choose your role that we already created.<\/p>\n<p>Click &gt;&gt; <strong>create<\/strong> <strong>function<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/7e.png\" alt=\"Lambda function\" width=\"1696\" height=\"793\" class=\"aligncenter wp-image-3949 size-full\" title=\"Lambda function\" \/><\/p>\n<p>Now we successfully created the lambda function, erase the default code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/8e.png\" alt=\"Lambda function\" width=\"1698\" height=\"852\" class=\"aligncenter wp-image-3950 size-full\" title=\"Lambda function\" \/><\/p>\n<p>Add the new lambda code here.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/9e.png\" alt=\"Lambda function\" width=\"1708\" height=\"792\" class=\"aligncenter wp-image-3951 size-full\" title=\"Lambda function\" \/><\/p>\n<p>You have to change the <strong data-renderer-mark=\"true\">cluster_name <\/strong>and <strong data-renderer-mark=\"true\">service_name <\/strong>with your values. after you added the values, click &gt;&gt; <strong>deploy button<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/10e.png\" alt=\"Lambda function\" width=\"1708\" height=\"802\" class=\"aligncenter wp-image-3952 size-full\" title=\"Lambda function\" \/><\/p>\n<h1>Create event bridge<\/h1>\n<p>Navigate to<strong data-renderer-mark=\"true\"> Amazon EventBridge<\/strong> section and Click &gt;&gt; <strong data-renderer-mark=\"true\">Rules <\/strong>under the <strong data-renderer-mark=\"true\">Buses <\/strong>section and click <strong data-renderer-mark=\"true\">Create &gt;&gt; Rule<\/strong>.<\/p>\n<p>In name,type &gt;&gt; <strong>ECSService-stop,<\/strong> In rule type, click &gt;&gt; <strong>schedule<\/strong>, click &gt;&gt; <strong>continue to create rule<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/11E.png\" alt=\"Eventbridge\" width=\"1698\" height=\"792\" class=\"aligncenter wp-image-3953 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Provide the<strong data-renderer-mark=\"true\"> Cron expression <\/strong>for when to trigger to lambda for stop the services. For example<strong data-renderer-mark=\"true\"> (45 9 * * ? *) <\/strong>\u2192 It refers to \u2018<strong data-renderer-mark=\"true\">every day at 3.15pm<\/strong>\u2019 in our time(<strong data-renderer-mark=\"true\">IST<\/strong>). Click &gt;&gt; next<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/12e.png\" alt=\"Cron expression\" width=\"1708\" height=\"792\" class=\"aligncenter wp-image-3954 size-full\" title=\"Cron expression\" \/><\/p>\n<p>Select &gt;&gt; <strong>AWS service<\/strong> in the target type, select &gt;&gt;<strong> lambda function<\/strong> in a target, and select your created lambda function.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/13e.png\" alt=\"lambda in Eventbridge\" width=\"1690\" height=\"792\" class=\"aligncenter wp-image-3955 size-full\" title=\"lambda in Eventbridge\" \/><\/p>\n<p>Click &gt;&gt; <strong>additional<\/strong> <strong>settings<\/strong>, In configure target input, select &gt;&gt; <strong>constant (JSON text)<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/14e.png\" alt=\"Eventbridge\" width=\"1711\" height=\"793\" class=\"aligncenter wp-image-3956 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Add these lines in the constant JSON, and click &gt;&gt; <strong>next<\/strong> and click &gt;&gt; <strong>create<\/strong> <strong>rule<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/15e.png\" alt=\"\" width=\"1704\" height=\"784\" class=\"aligncenter wp-image-3957 size-full\" \/><\/p>\n<p>we successfully created a role for the stop event, now we want to create another rule for the start event<\/p>\n<p>Click &gt;&gt; <strong>create<\/strong> <strong>rule<\/strong>, In name,type &gt;&gt; <strong>ECSService<\/strong>&#8211;<strong>start<\/strong>, In rule type, click &gt;&gt; <strong>schedule<\/strong>, click &gt;&gt; <strong>continue to create rule<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/16e.png\" alt=\"Eventbridge\" width=\"1708\" height=\"846\" class=\"aligncenter wp-image-3958 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Provide the<strong data-renderer-mark=\"true\"> Cron expression <\/strong>for when to trigger to lambda for stop the services. For example<strong data-renderer-mark=\"true\"> (35 9 * * ? *) <\/strong>\u2192 It refers to \u2018<strong data-renderer-mark=\"true\">every day at 3.05 pm<\/strong>\u2019 in our time(<strong data-renderer-mark=\"true\">IST<\/strong>). Click &gt;&gt; next<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/17e.png\" alt=\"Eventbridge\" width=\"1645\" height=\"819\" class=\"aligncenter wp-image-3959 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Select &gt;&gt; <strong>AWS service<\/strong> in the target type, select &gt;&gt; <strong>lambda function<\/strong> in a target, and <strong>select your created lambda function.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/18e.png\" alt=\"Eventbridge\" width=\"1692\" height=\"778\" class=\"aligncenter wp-image-3960 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Click &gt;&gt;<strong> additional settings<\/strong>, In configure target input, select &gt;&gt; <strong>constant (JSON text)<\/strong><\/p>\n<p>Add these lines in the constant JSON, and click &gt;&gt; <strong>next<\/strong> and click &gt;&gt; <strong>create rule<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/19e.png\" alt=\"Eventbridge\" width=\"1681\" height=\"784\" class=\"aligncenter wp-image-3961 size-full\" title=\"Eventbridge\" \/><\/p>\n<p>Now we successfully created two rule.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/20e.png\" alt=\"EventBridge\" width=\"1707\" height=\"796\" class=\"aligncenter wp-image-3962 size-full\" title=\"EventBridge\" \/><\/p>\n<h1>Check lambda function<\/h1>\n<p>Go to lambda services, click your created function, click &gt;&gt; <strong>triggers<\/strong> and click &gt;&gt; <strong>configuration<\/strong>.<\/p>\n<p>The event rules are successfully attached<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/21e.png\" alt=\"Lambda function\" width=\"1702\" height=\"844\" class=\"aligncenter wp-image-3963 size-full\" title=\"Lambda function\" \/><\/p>\n<h1>Check lambda log<\/h1>\n<p>Now we want to check if the event was successfully executed or not, Go to Cloudwatch services<\/p>\n<p>Click &gt;&gt; <strong>log groups<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/22e.png\" alt=\"Cloudwatch\" width=\"1705\" height=\"789\" class=\"aligncenter wp-image-3964 size-full\" title=\"Cloudwatch\" \/><\/p>\n<p>Here it will show the lambda function log group<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/23e.png\" alt=\"Cloudwatch\" width=\"1699\" height=\"793\" class=\"aligncenter wp-image-3965 size-full\" title=\"Cloudwatch\" \/><\/p>\n<p>Swipe down, click &gt;&gt; <strong>log streams<\/strong>, here we have two log events. the start event was executed at 3.05 pm<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/24e.png\" alt=\"Cloudwatch\" width=\"1698\" height=\"838\" class=\"aligncenter wp-image-3966 size-full\" title=\"Cloudwatch\" \/><\/p>\n<p>The stop event was executed at 3.15 pm.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/25e.png\" alt=\"Cloudwatch\" width=\"1698\" height=\"861\" class=\"aligncenter wp-image-3967 size-full\" title=\"Cloudwatch\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Automating the start and stop of Amazon ECS tasks using AWS Lambda and Events is an effective way to optimize resource usage and reduce costs. By scheduling these operations, businesses can ensure their ECS clusters run only during necessary periods, leading to significant savings. This automation not only streamlines operations but also allows for more efficient resource management, aligning cloud expenses with actual usage patterns.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to cover a schedule ECS stop and start automatically using Lambda. ECS &#8211; ECS\u00a0is a fully managed container orchestration service provided by\u00a0Amazon Web Services. It enables you to run, stop, and manage Docker containers on a cluster of virtual machines that are managed by AWS.\u00a0ECS\u00a0simplifies the process of deploying, [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":3969,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to schedule ecs stop and start automatically using Lambda | easydeploy.io<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to schedule ecs stop and start automatically using Lambda | easydeploy.io\" \/>\n<meta property=\"og:description\" content=\"In this article, we are going to cover a schedule ECS stop and start automatically using Lambda. ECS &#8211; ECS\u00a0is a fully managed container orchestration service provided by\u00a0Amazon Web Services. It enables you to run, stop, and manage Docker containers on a cluster of virtual machines that are managed by AWS.\u00a0ECS\u00a0simplifies the process of deploying, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\" \/>\n<meta property=\"og:site_name\" content=\"easydeploy.io\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-27T04:32:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-27T04:35:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1698\" \/>\n\t<meta property=\"og:image:height\" content=\"948\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Suryakumar KR\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Suryakumar KR\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\"},\"author\":{\"name\":\"Suryakumar KR\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/ddca6ab45d6281f710b0a73ec80b1aa2\"},\"headline\":\"How to schedule ecs stop and start automatically using Lambda\",\"datePublished\":\"2024-05-27T04:32:15+00:00\",\"dateModified\":\"2024-05-27T04:35:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\"},\"wordCount\":839,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png\",\"articleSection\":[\"Amazon Web Services\",\"News\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\",\"url\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\",\"name\":\"How to schedule ecs stop and start automatically using Lambda | easydeploy.io\",\"isPartOf\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png\",\"datePublished\":\"2024-05-27T04:32:15+00:00\",\"dateModified\":\"2024-05-27T04:35:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage\",\"url\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png\",\"contentUrl\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png\",\"width\":1698,\"height\":948},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.easydeploy.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to schedule ecs stop and start automatically using Lambda\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#website\",\"url\":\"https:\/\/www.easydeploy.io\/blog\/\",\"name\":\"easydeploy.io\",\"description\":\"A Cloud Architect Company\",\"publisher\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.easydeploy.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#organization\",\"name\":\"EasyDeploy Technologies Pvt Ltd\",\"url\":\"https:\/\/www.easydeploy.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2019\/02\/easydeploy.png\",\"contentUrl\":\"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2019\/02\/easydeploy.png\",\"width\":536,\"height\":100,\"caption\":\"EasyDeploy Technologies Pvt Ltd\"},\"image\":{\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/ddca6ab45d6281f710b0a73ec80b1aa2\",\"name\":\"Suryakumar KR\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2951decabd8b3bc440c7b230ae32eef8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2951decabd8b3bc440c7b230ae32eef8?s=96&d=mm&r=g\",\"caption\":\"Suryakumar KR\"},\"sameAs\":[\"https:\/\/easydeploy.io\"],\"url\":\"https:\/\/www.easydeploy.io\/blog\/author\/suryakumar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to schedule ecs stop and start automatically using Lambda | easydeploy.io","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/","og_locale":"en_GB","og_type":"article","og_title":"How to schedule ecs stop and start automatically using Lambda | easydeploy.io","og_description":"In this article, we are going to cover a schedule ECS stop and start automatically using Lambda. ECS &#8211; ECS\u00a0is a fully managed container orchestration service provided by\u00a0Amazon Web Services. It enables you to run, stop, and manage Docker containers on a cluster of virtual machines that are managed by AWS.\u00a0ECS\u00a0simplifies the process of deploying, [&hellip;]","og_url":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/","og_site_name":"easydeploy.io","article_published_time":"2024-05-27T04:32:15+00:00","article_modified_time":"2024-05-27T04:35:03+00:00","og_image":[{"width":1698,"height":948,"url":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png","type":"image\/png"}],"author":"Suryakumar KR","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Suryakumar KR","Estimated reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#article","isPartOf":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/"},"author":{"name":"Suryakumar KR","@id":"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/ddca6ab45d6281f710b0a73ec80b1aa2"},"headline":"How to schedule ecs stop and start automatically using Lambda","datePublished":"2024-05-27T04:32:15+00:00","dateModified":"2024-05-27T04:35:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/"},"wordCount":839,"commentCount":0,"publisher":{"@id":"https:\/\/www.easydeploy.io\/blog\/#organization"},"image":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage"},"thumbnailUrl":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png","articleSection":["Amazon Web Services","News"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/","url":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/","name":"How to schedule ecs stop and start automatically using Lambda | easydeploy.io","isPartOf":{"@id":"https:\/\/www.easydeploy.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage"},"image":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage"},"thumbnailUrl":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png","datePublished":"2024-05-27T04:32:15+00:00","dateModified":"2024-05-27T04:35:03+00:00","breadcrumb":{"@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#primaryimage","url":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png","contentUrl":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2024\/05\/main-1.png","width":1698,"height":948},{"@type":"BreadcrumbList","@id":"https:\/\/www.easydeploy.io\/blog\/how-to-schedule-ecs-stop-and-start-automatically-using-lambda\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.easydeploy.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How to schedule ecs stop and start automatically using Lambda"}]},{"@type":"WebSite","@id":"https:\/\/www.easydeploy.io\/blog\/#website","url":"https:\/\/www.easydeploy.io\/blog\/","name":"easydeploy.io","description":"A Cloud Architect Company","publisher":{"@id":"https:\/\/www.easydeploy.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.easydeploy.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.easydeploy.io\/blog\/#organization","name":"EasyDeploy Technologies Pvt Ltd","url":"https:\/\/www.easydeploy.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.easydeploy.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2019\/02\/easydeploy.png","contentUrl":"https:\/\/www.easydeploy.io\/blog\/wp-content\/uploads\/2019\/02\/easydeploy.png","width":536,"height":100,"caption":"EasyDeploy Technologies Pvt Ltd"},"image":{"@id":"https:\/\/www.easydeploy.io\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/ddca6ab45d6281f710b0a73ec80b1aa2","name":"Suryakumar KR","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.easydeploy.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2951decabd8b3bc440c7b230ae32eef8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2951decabd8b3bc440c7b230ae32eef8?s=96&d=mm&r=g","caption":"Suryakumar KR"},"sameAs":["https:\/\/easydeploy.io"],"url":"https:\/\/www.easydeploy.io\/blog\/author\/suryakumar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/posts\/3884"}],"collection":[{"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/comments?post=3884"}],"version-history":[{"count":3,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/posts\/3884\/revisions"}],"predecessor-version":[{"id":4053,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/posts\/3884\/revisions\/4053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/media\/3969"}],"wp:attachment":[{"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/media?parent=3884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/categories?post=3884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.easydeploy.io\/blog\/wp-json\/wp\/v2\/tags?post=3884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}