Created
April 3, 2023 04:22
-
-
Save devops-school/d9e65c11c680a2caa91d7b5da3ce47c2 to your computer and use it in GitHub Desktop.
write a terraform code which would create Ec2 instance and use Existing Security Group and Key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| region = "us-east-1" | |
| } | |
| resource "aws_instance" "example" { | |
| ami = "ami-0c55b159cbfafe1f0" | |
| instance_type = "t2.micro" | |
| key_name = "existing-key-name" | |
| vpc_security_group_ids = ["existing-security-group-id"] | |
| tags = { | |
| Name = "Example Instance" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment