Wednesday, 27 December 2023

AWS - Create Copy of DynamoDB Table and learn Backup and Restore Functionality

AWS DynamoDB Back and Restore


There is no direct way to copy DynamoDB tables as of now. So, we must take a backup and restore the table with a new name. Let's learn.


Step 1: Search DynamoDB from the search bar and Click Tabes on the left side. Select the table from the right that you want to take the backup.















Step 2: Click on the Backup Tab, click the Create Back dropdown below, and select Create an on-demand backup.












Step 3: Create on-demand backup, click the Create Backup button.





















Step 4: You can see the request is in progress










Step 5: You can also see the status in AWS Backup. (Search AWS backup in the Search bar).













It will take approx 5 minutes to take the backup and it will change the status to complete.
Step 6: After completion, you can Go to Dynamo DB from the search bar and you can find the backup there then you can press the restore button.












Step 7: Here you can update the table name that you want and press the restore button.































You can see the request submitted successfully.










Step 8: To check the status, you again can go to AWS backup --> Jobs --> and click Restore Jobs.
















Step 9: After completion, you can see a new table Under DynamoDb tables













This way you can create a table copy in the DynamoDB.
That's all about this article, thank you.


Sunday, 10 December 2023

Create resource on Azure with Terraform

What is Terraform?

Terraform is an Infrastructure as Code (IaC) software tool offered by HashiCorp. You can provision and manage your infrastructure both on-premises and in the cloud with it. 


How to execute Terraform Scripts?


Prerequisite

1. You need an Azure Portal account
2. Install Azure CLI on your local system. Download the installer from the below link
    Azure CLI Installer
3. Azure Login on command prompt run (az login) command 
4. Install Terraform. Download the installer from the below link. Download 
AMD64 for     64-bit system. Terraform Download

 

Let's create a small script to create a resource Group in the Azure portal.


Step 1: Create a Terraform file to create a resource group. Paste the below script into the new file and the name should be anyname.tf

provider "azurerm" {
  version = "~>2.0"
  features {}
}

resource "azurerm_resource_group" "terraform1" {
  name = "terraform1"
  location = "eastus"
}

Place the file in any drive. I have placed the file in the D drive. Below is my file. My Resource group name is terraform1. You can write any name.











Step 2: Intialize Terraform.


My file is on D drive. So I have executed the command from D drive.
            terraform init










Step 3: Terraform Plan

            Execute command    terraform plan













Step 4: Terraform Apply

            Execute command    terraform apply












It will prompt you to perform this action? Write Yes and Enter.








After yes, it will start creating the infrastructure on the Azure Portal










You can see the success message above. Go to the Azure portal, and you can see a new resource group with the name terraform1.
















That's all about this article. 


Implement Authorization in Swagger with Static Value in Header .Net 8

If you want an anonymous user should not run the APIs. To run your API Endpoints From Swagger / Postman / Code the user should pass the head...