Task 5 - Create an IAM, S3 bucket and Dynamo DB table
Navigate to AWS CONSOLE -> Click the “Search” field. -> Type “IAM enter” -> Click “Roles” -> Click “Create role” -> Click “AWS service” -> Click “Choose a service or use case” -> Click “EC2” -> Click “Next”
Click the “Search” field. -> Add permissions policies -> AmazonEC2FullAccess -> Click the “Search” field. -> AmazonS3FullAccess -> Search -> AmazonDynamoDBFullAccess -> click Next -> Click the “Role name” field. -> Type “Jenkins-cicd” -> Click “Create role”
Click “EC2” -> go to the Jenkins instance and add this role to the Ec2 instance. -> select Jenkins instance → Actions → Security → Modify IAM role
Add a newly created Role and click on Update IAM role.
Search for S3 in console -> “Create bucket”
Click the “Search” field. Search for DynamoDB and click on it.
Click “Create table”
Click the “Table name” field. enter “dynamodb_table = “mrcloudbook-dynamo-db-table”” -> Click the “Enter the partition key name” field. -> Type “LockID” -> Click “Create table”
Docker Plugin setup
We need to install the Docker tool in our system, Goto Dashboard → Manage Plugins → Available plugins → Search for Docker and install these plugins
Docker
Docker Commons
Docker Pipeline
Docker API
docker-build-step
and click on install without restart
Now, go to Dashboard → Manage Jenkins → Tools → Add Docker Hub Username and Password under Global Credentials
Let’s check the Terraform code Now.
[backend.tf]()
[provider.tf]()
[main.tf]()
[s3.tf]()
[variables.tf]()
User data for instance
[website.sh]()
[index.html]()
[error.html]()
[style.css]()
[script.js]()
Let’s create a Job now in Jenkins set a job name and add this pipeline
Task 5 - Create an IAM, S3 bucket and Dynamo DB table
Docker Plugin setup
Now, go to Dashboard → Manage Jenkins → Tools → Add Docker Hub Username and Password under Global Credentials
User data for instance
Let’s create a Job now in Jenkins set a job name and add this pipeline