-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance.tf
More file actions
30 lines (25 loc) · 702 Bytes
/
Copy pathinstance.tf
File metadata and controls
30 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
provider "aws" {
profile = "terraform_user"
access_key = "" # Note: Avoid hardcoding sensitive info in your code
secret_key = "" # Consider using environment variables or AWS credentials file
region = "ap-south-1"
}
resource "aws_security_group" "allow_rdp" {
name = "allow_rdp"
description = "Allow RDP traffic"
ingress {
from_port = 3389
to_port = 3389
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_instance" "terraform" {
ami = "ami-053284fc22a2c3f82"
instance_type = "t2.micro"
key_name = "All keypair"
subnet_id = "subnet-03a3f218c8dfa99fb"
tags = {
Name = "TerraformInstance"
}
}