Setup S3 Trigger with Lambda and Dynamo DB. Here, we will update the dynamo DB by fetching/triggering the new files added in the S3 bucket using the AWS lambda function which will we be complete automation.

Step-1:
Create an IAM role (having specific permissions to access the AWS services).
Go to Roles > create role > AWS services > lambda and select the policy.
Here policy, we are attaching to our role is “AmazonDynamoDBFullAccess” and move a step ahead to complete further configurations.
Add a role name, role name can be any, and click on create.
Follow the below output.


AWS Lambda is a compute service from Amazon Web Services that allows you to run code without having to provision or manage servers. With AWS Lambda, you can run code for almost any type of application or backend service with no need for an administrator.

Aws manages various administrator services:

  • Provisioning and capacity of the compute fleet that offers a balance of memory, CPU, network, and other resources.
  • Server and OS maintenance
  • High availability and Automatic Scaling
  • Monitoring fleet Health
  • Applying Security patches
  • Deploying your code
  • Monitoring and logging your lambda function
  • AWS Lambda runs your code on a high–availability…

Prerequisite => https://bansalkushagra.medium.com/what-is-bootstrapping-uploading-cookbook-in-chef-server-node-configurations-db59c1991514

Basic commands to List and delete cookbooks, roles, list of clients and nodes

1. To list cookbooks in chef-server

Ø knife cookbook list

2. To delete the cookbook from the chef-server

Ø knife cookbook delete <cookbook_name> -y

3. To list nodes in chef-server

Ø knife node list

4. To delete a node from chef-server

Ø knife node delete <Node_name> -y

5. To list Client in chef-server

Ø knife client-list

6. To delete clients from chef-server

Ø knife client delete <client_name > -y

7. To list roles in chef-server

Ø knife role list

8. To delete role form…


Prerequisite: https://medium.com/nerd-for-tech/attributes-in-chef-a56073de90ea

https://medium.com/nerd-for-tech/runlist-multiple-recipes-linux-group-users-in-chef-170afcb51fba

Step-1: Access your Amazon EC-2 machine and follow the below command:

Ø sudo su

Ø cd cookbooks

Step-2:

Create an account of chef-server. Go to https://manage.chef.io/login, create an organization for your chef-server. After some time we will see “starter-kit” download it using this we can connect our chef-workstation with different nodes.

Start-kit contains all the server files which are used to connect over the server. Follow the below output sequentially.

First, Go to https://manage.chef.io/login> sign up, and verify your account


Prerequisite: https://bansalkushagra.medium.com/how-to-create-a-cookbook-and-recipe-in-chef-ae62e9ba8156

Types of Attributes (Priority Based):

A. Default

B. Force-default

C. normal

d. override

E. force-override

f. automatic

The attribute is key-value pair that represents a specific detail about a node. It is used to find the state of the node was at the end of the previous chef-client run. Or, what state of node should be at the end of the current chef-client run. Attributes are defined by Node, Roles, cookbook, recipe, and Environment.

Implementation:

Step-1: Access your Amazon EC-2 machine and follow the below command:

Command:

Ø sudo su: to go to the root

Ø ohai

Ø…


prerequisite: https://bansalkushagra.medium.com/how-to-create-a-cookbook-and-recipe-in-chef-ae62e9ba8156

Step-1: Access your Amazon EC-2 machine and follow the below command:

Ø sudo su

Ø cd cookbooks

Step-2:

Let’s create a directory and a file in a Linux machine using the ruby script in chef and see the difference between the ruby script in the recipe and the Linux command run in the recipe.

Directory & file name is kushagradirectory and kushagrafile

First, create a recipe and enter a code

Ø vi test-cookbook/recipes/recipe3.rb

Code:

execute “run a script” do

command <<-EOH

mkdir /kushagradirectory

touch /kushagrafile

EOH

end


Version: 21.3.346

Prerequisite: https://bansalkushagra.medium.com/how-chef-works-eb4c7846819a

What’s Inside Cookbook?

A. Chefbook => Like .gitignore

B. Kitchen.yml => For testing Cookbook

C. Metadata.rb => name, version author name etc info of the cookbook.

D. Readme.md => information about usage of cookbook

E. Recipe => where we write code

F. Spec => It used for unit test

G. Test => It is used for integration test

Implementation =>

Step-1:

Create ac EC2 instance of Linux, update the instance and download the chef.

Follow the below command

Ø Yum update –y

Ø Wget https://packages.chef.io/files/stable/chef-workstation/21.4.365/el/7/chef-workstation-21.4.365-1.el7.x86_64.rpm

Step-2:

.rpm file of chef-workstation will get the download. …


CHEF is an open-source configuration management tool. Earlier system administrators used to manage the machines/servers like updating, installation, security, etc. By configuration we mean- each minute detail of our machine. Due to which chances of error increase because it’s done manually by an administrator. CHEF, an automated tool comes into existence.

DevOps CHEF tool comes into an operation section. Now instead of the system administrator, DevOps Engineer will handle the server configuration process using script. Infrastructure builds/configured by a script is known as IAC (Infrastructure as code).

It’s the Pull based management tool. Pull configuration nodes check the server periodically…


Prerequisite: https://bansalkushagra.medium.com/docker-port-expose-and-publish-3470f4b49ccf

How to push docker image in docker hub

Step-1:

Create a container say ubuntu

Command:

Docker run –it ubuntu /bin/bash

ls

You will see many files and directory already exists. Create more files here.

Command:

Touch file file2 test test2 xyz

Also, additionally, install the apache server and files inside tmp/ directory using the command

apt-get install apache2 –y

To see an HTML webpage go to “cd var/www/ ”

Go to tmp directory

cd /tmp

touch file1 file2

ls

Now, create an image of this updated container.

Command:

docker commit <Container_name> <new_container_name>

docker commit practical_mclean newimageuser

docker images


Prerequisite:

https://bansalkushagra.medium.com/everything-about-docker-volume-59100f884a66

Must create an ec2 instance on AWS by letting configurations default.

AWS instance :

KUSHAGRA BANSAL

DevOps Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store