Terraform
Terraform
Features
Visual Studio Code is a source-code editor that can be
used with a variety of programming languages,
including Java, JavaScript, Go, Node.js, Python and C+
+. It is based on the Electron framework, which is used
to develop Node.js Web applications that run on
the Blink layout engine. Visual Studio Code employs the
same editor component (codenamed "Monaco") used
in Azure DevOps (formerly called Visual Studio Online
and Visual Studio Team Services).
Instead of a project system, it allows users to open one or
more directories, which can then be saved in workspaces
for future reuse. This allows it to operate as a language-
agnostic code editor for any language. It supports a
number of programming languages and a set of features
that differs per language. Unwanted files and folders can
be excluded from the project tree via the settings. Many
Visual Studio Code features are not exposed through
menus or the user interface but can be accessed via the
command palette.
Visual Studio Code can be extended
via extensions, available through a central repository.
This includes additions to the editor and language
support. A notable feature is the ability to create
extensions that add support for new languages, themes,
and debuggers, perform static code analysis, and
add code linters using the Language Server Protocol.
Visual Studio Code includes multiple extensions
for FTP, allowing the software to be used as a free
alternative for web development. Code can be synced
between the editor and the server, without downloading
any extra software.
Visual Studio Code allows users to set the code page in
which the active document is saved,
the newline character, and the programming language of
the active document. This allows it to be used on any
platform, in any locale, and for any given programming
language.
Language support
Out of the box, Visual Studio Code includes basic
support for most common programming languages. This
basic support includes syntax highlighting, bracket
matching, code folding, and configurable snippets.
Visual Studio Code also ships with IntelliSense for
JavaScript, TypeScript, JSON, CSS, and HTML, as well
as debugging support for Node.js. Support for additional
languages can be provided by freely available extensions
on the VS Code Marketplace.
Data collection
Visual Studio Code collects usage data and sends it to
Microsoft, although this can be disabled. In addition,
because of the open-source nature of the application, the
telemetry code is accessible to the public, who can see
exactly what is collected. According to Microsoft, the
data is shared with Microsoft-controlled affiliates and
subsidiaries, although law enforcement may request it as
part of a legal process.
Version control
Source control is a built-in feature of Visual Studio
Code. It has a dedicated tab inside of the menu bar where
you can access version control settings and view changes
made to the current project. To use the feature you must
link Visual Studio Code to any supported version control
system (Git, Apache Subversion, Perforce, etc.). This
allows you to create repositories as well as make push
and pull requests directly from the Visual Studio Code
program.
Introduction to Terraform
Terraform is an infrastructure as code (IaC) tool that
allows you to build, change, and version infrastructure
safely and efficiently. This includes low-level
components such as compute instances, storage, and
networking, as well as high-level components such as
DNS entries, SaaS features, etc. Terraform can manage
both existing service providers and custom in-house
solutions.
Command: init - Terraform
The terraform init command is used to initialize a
working directory containing Terraform configuration
files. This is the first command that should be run after
writing a new Terraform configuration or cloning an
existing one from version control. It is safe to run this
command multiple times.
2. terraform plan
We will use this command for script verification. It will
show if there is an error in our configuration.
The output of terraform plan looks like this if it runs
successfully-
3. terraform apply
Use terraform apply to create your S3 bucket.
It will ask you for confirmation before execution; enter
yes for confirmation.
Use terraform apply -auto-approve if you want to execute
it without asking for confirmation.
After successful execution, it will display the following
message-
You can verify your bucket in S3 services in your AWS
Account.
Terraform AWS S3
Steps to Create an S3 Bucket using Terraform
Create S3 bucket module. Create a module that will
have a basic S3 file configuration.
Define bucket. Open bucket.tf and define bucket in
that.
Define variables. In var.tf, we will define variables for
the bucket.tf.
Add Configuration.
Add Access key, Secret key, and Region.
Screenshots
Terraform AWS EC2 Instance
Using Terraform to Create an EC2 Instance
Create an EC2 Instance.
Automatically look up the latest Windows Server
2019 AMI for the EC2 instance.
Create and attach a additional drive.
Create a Cloudwatch Alarm Metric to monitor CPU.
Screenshots
Terraform AWS IAM
Explanation:
SCREENSHOTS
Terraform SQS
How to create an SQS queue on AWS using
Terraform
Pre-requisites.
What we will do.
Write Terraform configuration files for SQS Queue.
Create an SQS Queue using the Terraform
configuration files.
Delete the created SQS Queue using Terraform.
SCREENSHOTS
Terraform SNS
How to create an SNS topic on AWS using Terraform
Pre-requisites.
What we will do.
Write Terraform configuration files for SNS Topic.
Create an SNS Topic using the Terraform
configuration files.
Delete the created SNS topic using Terraform.
SCREENSHOTS
Terraform VPC
How do I create AWS VPC with terraform?
Running Terraform to Create the AWS VPC
Open a terminal and navigate to the ~\terraform-vpc-
demo directory. cd ~\terraform-vpc-demo.
Run the terraform init command in the same directory.