Guest User

Untitled

a guest
Mar 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. provider "aws" {
  2. access_key = "xxxxxxxxxxxxxx"
  3. secret_key = "yyyyyyyyyyyyyyyyyyyyyy"
  4. region = "us-west-2"
  5. }
  6.  
  7. resource "aws_security_group" "myweb" {
  8. name = "web-node"
  9. description = "Web Security Group"
  10.  
  11. ingress {
  12. from_port = 80
  13. to_port = 80
  14. protocol = "tcp"
  15. cidr_blocks = ["0.0.0.0/0"]
  16. }
  17.  
  18. ingress {
  19. from_port = 22
  20. to_port = 22
  21. protocol = "tcp"
  22. cidr_blocks = ["0.0.0.0/0"]
  23. }
  24.  
  25. egress {
  26. from_port = 0
  27. to_port = 0
  28. protocol = "-1"
  29. cidr_blocks = ["0.0.0.0/0"]
  30. }
  31. }
  32. resource "aws_instance" "myweb" {
  33. ami = "ami-7f43f307"
  34. instance_type = "t2.micro"
  35. key_name = "test"
  36. security_groups = ["${aws_security_group.myweb.name}"]
  37. tags {
  38. Name = "terraform-instance"
  39. }
  40. }
Add Comment
Please, Sign In to add comment