<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Fumiaki Ueno</title>
    <description>The latest articles on Forem by Fumiaki Ueno (@fu3ak1).</description>
    <link>https://forem.com/fu3ak1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F955470%2F91d93262-2a29-482f-814a-457eef613e19.jpg</url>
      <title>Forem: Fumiaki Ueno</title>
      <link>https://forem.com/fu3ak1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fu3ak1"/>
    <language>en</language>
    <item>
      <title>Highlights from AWS re:Invent 2022 Dr. Werner keynote</title>
      <dc:creator>Fumiaki Ueno</dc:creator>
      <pubDate>Mon, 26 Dec 2022 14:31:52 +0000</pubDate>
      <link>https://forem.com/aws-builders/highlights-from-aws-reinvent-2022-dr-werner-keynote-7al</link>
      <guid>https://forem.com/aws-builders/highlights-from-aws-reinvent-2022-dr-werner-keynote-7al</guid>
      <description>&lt;p&gt;&lt;a href="https://reinvent.awsevents.com/" rel="noopener noreferrer"&gt;re:Invent&lt;/a&gt;, the most exciting AWS event in a year has just ended in this December.&lt;/p&gt;

&lt;p&gt;I was very impressed with the keynote speech of Dr. Werner Vogels. Let's summarize it and think about what the software architecture should look like.&lt;/p&gt;

&lt;h2&gt;
  
  
  Imagine a world that is ordered, synchronized, one by one
&lt;/h2&gt;

&lt;p&gt;In a synchronized world you have to order one food at a time. when you want to eat a burger and fries, you say "Burger", and you have to wait for the waiter's "OK". You can't order like "Burger and Fries". The cook fries one potato stick at a time for fries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8k9qdefwryz76n7m05p9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8k9qdefwryz76n7m05p9.png"&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://www.youtube.com/watch?v=RfvL_423a-I" rel="noopener noreferrer"&gt;AWS re:Invent 2022 - Keynote with Dr. Werner Vogels&lt;/a&gt;
  &lt;/p&gt;

&lt;h2&gt;
  
  
  The world is asynchronous
&lt;/h2&gt;

&lt;p&gt;In a real world, you can order multiple foods at a time like "Burger and Fries". Of course the cook can fry multiple potato sticks at once. The world is also event-driven. In a restaurant, there are many events such as order, food is ready, finish eating, and waiters and cooks act triggered by these events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2usvwb3i23itlb9bpykg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2usvwb3i23itlb9bpykg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Software Architecture
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;synchronous&lt;/strong&gt; systems, components are tightly coupled. One component fail leads a fail of overall system. Therefore, it's difficult to add a new component and evolve systems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft41klkfdqk4nodlbnt2j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft41klkfdqk4nodlbnt2j.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the other hand, &lt;strong&gt;asynchronous&lt;/strong&gt; systems make it easy to add new components. Everything is loosely coupled and you cann add a new component without changing other components. This makes it easy for the entire system to evolve.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ycnx1vkhzv0dpoqvr1h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ycnx1vkhzv0dpoqvr1h.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we build asynchronous systems with AWS?
&lt;/h2&gt;

&lt;p&gt;This ia an example of asynchronous, AWS serverless architecture.　Each component is simple but can look complex when combined. You also need AWS knowledge to take advantage AWS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ufx66il53a5yujv2xf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ufx66il53a5yujv2xf2.png"&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://serverlessland.com/reinvent2021/serverlesspresso" rel="noopener noreferrer"&gt;Learn more about Serverlesspresso&lt;/a&gt;
  &lt;/p&gt;

&lt;p&gt;How do we start a serverless architecture? A new service, &lt;strong&gt;&lt;a href="https://aws.amazon.com/jp/application-composer/" rel="noopener noreferrer"&gt;AWS Application Composer (Preview)&lt;/a&gt;&lt;/strong&gt;, will help with this. By drawing an architecture diagram visually, Application Composer generate infrastructure as code (IaC). The code follows best practices such as S3 Bucket encryption. Code and architecture are synchronized, making them easy to manage and share among members.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygxfnxhfgg23uy6wsyzr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygxfnxhfgg23uy6wsyzr.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Many things to do when you build
&lt;/h2&gt;

&lt;p&gt;When you build on AWS, you have to manage lot more than just building. For example, managing issues, building pipelines, setting up IDE, creating git repository etc. &lt;a href="https://aws.amazon.com/codecatalyst/" rel="noopener noreferrer"&gt;Amazon CodeCatalyst (Preview)&lt;/a&gt; launch new project and sample codes, CI/CD pipeline, issue management tool, member management tool, etc. You can manage all of these things from CodeCatalyst console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F094sv852mq6lkmfn42do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F094sv852mq6lkmfn42do.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The power of composing
&lt;/h2&gt;

&lt;p&gt;In UNIX, pipes(|) make it easy to compose small components with a standard interface and format. you can build bigger application with composing many small components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;example of pipes
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;access.log | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"/gateway/allapi"&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; 500"&lt;/span&gt; | rev | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt; &lt;span class="nt"&gt;-f4&lt;/span&gt; | rev | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can we do this with AWS Services? Yes, we can do this with &lt;a href="https://aws.amazon.com/eventbridge/pipes/" rel="noopener noreferrer"&gt;Amazon EventBridge Pipes&lt;/a&gt;. It makes it easy to build event-driven applications. Before this service was available, you need to integrate code to connect AWS services. Now you can connect services without integration code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6eirrj4fe5t3vh224n4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6eirrj4fe5t3vh224n4r.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbhh9kt8j9a9z7co7yi9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbhh9kt8j9a9z7co7yi9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Listen, learn, improve
&lt;/h2&gt;

&lt;p&gt;AWS always develops services based on customer feedback. Some customers would like to do Map Reduce with Step Functions, not Kafka and EMR. AWS built &lt;a href="https://aws.amazon.com/jp/blogs/aws/step-functions-distributed-map-a-serverless-solution-for-large-scale-parallel-data-processing/" rel="noopener noreferrer"&gt;AWS Step Functions Distributed Map&lt;/a&gt; This allow you to process very large amount of data and support a maximum concurrency of up to 10,000 executions in parallel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9d9vanakczghxqc5pg6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9d9vanakczghxqc5pg6.png"&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://www.youtube.com/watch?v=RfvL_423a-I" rel="noopener noreferrer"&gt;AWS re:Invent 2022 - Keynote with Dr. Werner Vogels&lt;/a&gt;
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Simulate everything
&lt;/h2&gt;

&lt;p&gt;Simulations makes the impossible possible in a digital system. you can experiment safely and at low cost because simulations don't impact the real world. &lt;a href="https://aws.amazon.com/simspaceweaver/" rel="noopener noreferrer"&gt;AWS SimSpace Weaver&lt;/a&gt; were announced in Keynote with Adam Selipsky. It make you easy to simulate spaces without managing infrastructure. Using simulation improve your system.&lt;/p&gt;

&lt;p&gt;The world is asynchronous. The world and the universe are fragile and fault-tolerant, resilient, robust. We can learn a lot from the real world and apply the principles of nature to the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The world is asynchronous and the system should be asynchronous too&lt;/li&gt;
&lt;li&gt;New services are announced

&lt;ul&gt;
&lt;li&gt;AWS Application Composer&lt;/li&gt;
&lt;li&gt;Amazon CodeCatalyst&lt;/li&gt;
&lt;li&gt;Amazon EventBridge Pipes&lt;/li&gt;
&lt;li&gt;AWS Step Functions Distributed Map&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;When we build on AWS especially when using serverless services, we need to prepare a lot and there is a learning curve. Many new services will reduce our management and learning cost.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>reinvent</category>
    </item>
    <item>
      <title>Easy setup for EC2 stop jobs with Amazon EventBridge Scheduler</title>
      <dc:creator>Fumiaki Ueno</dc:creator>
      <pubDate>Mon, 14 Nov 2022 15:20:06 +0000</pubDate>
      <link>https://forem.com/aws-builders/easy-setup-for-ec2-stop-jobs-with-amazon-eventbridge-scheduler-4lpg</link>
      <guid>https://forem.com/aws-builders/easy-setup-for-ec2-stop-jobs-with-amazon-eventbridge-scheduler-4lpg</guid>
      <description>&lt;p&gt;A great update &lt;strong&gt;Amazon EventBridge Scheduler&lt;/strong&gt; announced!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/jp/blogs/compute/introducing-amazon-eventbridge-scheduler/" rel="noopener noreferrer"&gt;https://aws.amazon.com/jp/blogs/compute/introducing-amazon-eventbridge-scheduler/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Amazon EventBridge Scheduler?
&lt;/h2&gt;

&lt;p&gt;EventBridge Scheduler is a more powerful scheduling feature than the previous EventBridge rules.EventBridge Scheduler has the following characteristics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can create up to 1 million schedules per account&lt;/li&gt;
&lt;li&gt;Support 1,000s of TPS&lt;/li&gt;
&lt;li&gt;Support many AWS Service APIs(Over 270 services and over 6,000 API Actions)&lt;/li&gt;
&lt;li&gt;You can create one-time schedules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Supporting many APIs means we can create many automated jobs without Lambda, code, etc, just with EventBridge Scheduler. &lt;/p&gt;

&lt;h2&gt;
  
  
  EC2 stop jobs with Amazon EventBridge Scheduler
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/jp/solutions/implementations/instance-scheduler-on-aws/" rel="noopener noreferrer"&gt;Instance Scheduler&lt;/a&gt; was commonly used for stopping EC2 instances.It consists of Lambda and EventBridge rules.&lt;/p&gt;

&lt;p&gt;Now it can be created only by EventBridge Scheduler. So let's create it.&lt;/p&gt;

&lt;p&gt;A running instance was prepared in advance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd5snwoagwl1twzbf7ie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd5snwoagwl1twzbf7ie.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create an IAM Role
&lt;/h3&gt;

&lt;p&gt;We need to create an IAM Role for EventBridge Scheduler. In this case, Scheduler only stop EC2 instances, so we grant &lt;code&gt;ec2:StopInstances&lt;/code&gt; action. Create the following IAM Role.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IAM Role Name: &lt;code&gt;SchedulerEC2Stop&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Trusted Policy:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Principal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"Service"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"scheduler.amazonaws.com"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sts:AssumeRole"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;IAM Policy:
```json
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;{&lt;br&gt;
    "Version": "2012-10-17",&lt;br&gt;
    "Statement": [&lt;br&gt;
        {&lt;br&gt;
            "Sid": "ec2Stop",&lt;br&gt;
            "Effect": "Allow",&lt;br&gt;
            "Action": "ec2:StopInstances",&lt;br&gt;
            "Resource": "*"&lt;br&gt;
        }&lt;br&gt;
    ]&lt;br&gt;
}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d54ho0tiwxpabpyn1ks5.png)

### 2. Create a Schedule

Moving to EventBridge Schedules page and create schedule. (Not a rules page.)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1gfojn6fsbve6af2vafr.png)

Set a schedule name and configure the schedule.If you want to stop instances daily 21:00, set as follows.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b95bjz134p0qch0u5z68.png)

You can optionally set Timezone, Start date, End date.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zh4a2yw2i2jmkz5lu0ng.png)

Select Amazon EC2 and select `stopInstances` action.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejnlzz3jw6couacl3wmx.png)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxaqbwk5pqm7il29mckb.png)


You only need to enter your instance ID. Multiple IDs can also be specified.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tesn79ik68zkimyhf2kq.png)

In the Settings phase, only an IAM role need to be set.　In this case, other settings are OK with default values.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdjhi6mvfxo5eaike6pi.png)

Review settings and create schedule.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mvvomtppmt18zeb9u49y.png)

### 3. Check EC2 instance is stopped.

Now it's ready. When the scheduled time comes, you can confirm that EC2 instance is stopped.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2bv0rs08eoxk81x3z7eq.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkqvrkc8lhe9noh5ssd5.png)

## conclusion

We could set up EC2 stopping job easily.　This feature can be applied to implement operational jobs such as ECS RunTask　and changing alarm configuration of CloudWatch without programming code.

If you want to know more detail of EventBridge Scheduler, Check the [AWS Documents](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html) and [AWS Blog post](https://aws.amazon.com/jp/blogs/compute/introducing-amazon-eventbridge-scheduler/).



















&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>aws</category>
      <category>eventbridge</category>
      <category>ec2</category>
    </item>
  </channel>
</rss>
