here we are giving the provider name and then we are telling our region name in which region we would like to launch our EC2 instance. here I have used us-east-1 which is the region name of N. Virginia, and then I have used profile as default, through this we are telling the credentials of our account. you can also give an access key and secret key instead of profile.
After that, we need to run this command so that Terraform can download the plugins for AWS
Teraform init
with this command Terraform got to know how to use AWS.
now let's add the code for adding resource AWS instance and remote connection,