Evil  David

Evil David

1597190370

Creating a Instance Scheduler using AWS CDK

The AWS CDK is a software development framework used to define cloud infrastructure as code and provision it through CloudFormation. The CDK integrates fully with AWS services and allows developers to use a high-level construct to define cloud infrastructure in code.

In this article, we will build a CDK version of AWS EC2 Instance Scheduler solution that enables us to easily configure custom start and stop schedules for our Amazon EC2 and Amazon RDS instances.

The Architecture

By the end of this article, we will have a pipeline to deploy a serverless solution that starts and stops Amazon EC2 instances in an autoscaling group and Amazon RDS instances based on a schedule.

Here’s the architecture diagram:

Image for post

Through the article we will be covering the following actions:

  • Deploying an AWS Step Function with two parallel tasks.
  • Creating an SNS topic to send notifications.
  • Creating a Cloudeatch event rule which will trigger Step Function based on a schedule.
  • Creating a CI/CD pipeline with CodeBuild and CodePipeline.

Prerequisites

To deploy the CDK application, there are a few prerequisites that need to be met:

  • Setup an AWS account.
  • Install the latest aws-cli.
  • Install AWS CDK CLI.
  • Deploy a multi-AZ WordPress website with RDS (optional).

#aws #step-functions #serverless #cdk

What is GEEK

Buddha Community

Creating a Instance Scheduler using AWS CDK
Rory  West

Rory West

1622206030

AWS Instance Scheduler Ultimate Cheat Sheet For Devs

AWS Instance Scheduler is a popular option for saving up a large portion of the cost of computing services in situations where there are predictable planned times for operating compute services. In other words, since no clients are accessing particular environments during the period, it’s normal for development environments or workloads to be shut down during non-working times.

By evaluating when the instances are more widely used, you can implement more complex schedules, or even apply an always-stopped schedule and then start up the instances when you need them.

In this article, we will cover a step-by-step guide to create an AWS schedule and apply it to several instances.

Solution Overview

This CloudFormation template creates an environment for the AWS Instance Scheduler. The solution uses the following AWS services:

#aws #aws-cost-optimization #aws-instance-scheduler #aws-savings #aws-guide

Rory  West

Rory West

1621745280

Create EC2 instance from AWS Console

What is EC2 Instance?

Secure and resizable compute capacity in the cloud.

Amazon Elastic Compute Cloud ( Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

In this article let us see how to create On-demand EC2 instance from Console.

#create-ec2-instance #aws-ec2-instance #ec2-instance #amazon-web-services #aws

Evil  David

Evil David

1597190370

Creating a Instance Scheduler using AWS CDK

The AWS CDK is a software development framework used to define cloud infrastructure as code and provision it through CloudFormation. The CDK integrates fully with AWS services and allows developers to use a high-level construct to define cloud infrastructure in code.

In this article, we will build a CDK version of AWS EC2 Instance Scheduler solution that enables us to easily configure custom start and stop schedules for our Amazon EC2 and Amazon RDS instances.

The Architecture

By the end of this article, we will have a pipeline to deploy a serverless solution that starts and stops Amazon EC2 instances in an autoscaling group and Amazon RDS instances based on a schedule.

Here’s the architecture diagram:

Image for post

Through the article we will be covering the following actions:

  • Deploying an AWS Step Function with two parallel tasks.
  • Creating an SNS topic to send notifications.
  • Creating a Cloudeatch event rule which will trigger Step Function based on a schedule.
  • Creating a CI/CD pipeline with CodeBuild and CodePipeline.

Prerequisites

To deploy the CDK application, there are a few prerequisites that need to be met:

  • Setup an AWS account.
  • Install the latest aws-cli.
  • Install AWS CDK CLI.
  • Deploy a multi-AZ WordPress website with RDS (optional).

#aws #step-functions #serverless #cdk

Cross-account access to invoke AWS lambda using AWS CDK

If you are here, you may have a pretty good knowledge of how to use AWS CDK for defining cloud infrastructure in code and provisioning it through AWS. So let’s get started on how to grant permission to your lambda function to access the resources in another AWS account.

Let’s say you have two accounts called Account A and Account B, and you need to give permission to lambda function in Account A (ex: 11111111)to access the resources in Account B(22222222). You can easily do this by assuming an IAM Role in Account B and then uses the returned credentials to invoke AWS resources in Account B.

#acces #account #aws #lambda #aws lambda #aws cdk

Seamus  Quitzon

Seamus Quitzon

1601341562

AWS Cost Allocation Tags and Cost Reduction

Bob had just arrived in the office for his first day of work as the newly hired chief technical officer when he was called into a conference room by the president, Martha, who immediately introduced him to the head of accounting, Amanda. They exchanged pleasantries, and then Martha got right down to business:

“Bob, we have several teams here developing software applications on Amazon and our bill is very high. We think it’s unnecessarily high, and we’d like you to look into it and bring it under control.”

Martha placed a screenshot of the Amazon Web Services (AWS) billing report on the table and pointed to it.

“This is a problem for us: We don’t know what we’re spending this money on, and we need to see more detail.”

Amanda chimed in, “Bob, look, we have financial dimensions that we use for reporting purposes, and I can provide you with some guidance regarding some information we’d really like to see such that the reports that are ultimately produced mirror these dimensions — if you can do this, it would really help us internally.”

“Bob, we can’t stress how important this is right now. These projects are becoming very expensive for our business,” Martha reiterated.

“How many projects do we have?” Bob inquired.

“We have four projects in total: two in the aviation division and two in the energy division. If it matters, the aviation division has 75 developers and the energy division has 25 developers,” the CEO responded.

Bob understood the problem and responded, “I’ll see what I can do and have some ideas. I might not be able to give you retrospective insight, but going forward, we should be able to get a better idea of what’s going on and start to bring the cost down.”

The meeting ended with Bob heading to find his desk. Cost allocation tags should help us, he thought to himself as he looked for someone who might know where his office is.

#aws #aws cloud #node js #cost optimization #aws cli #well architected framework #aws cost report #cost control #aws cost #aws tags