Advertisement
Guest User

Untitled

a guest
Jan 14th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1.  
  2. resource "aws_vpc" "vpc-demosubs" {
  3. cidr_block = "10.3.0.0/16"
  4. enable_dns_support = "true"
  5. enable_dns_hostnames = "true"
  6. tags {
  7. Name = "vpc-demosubs"
  8. Client = "demosubs"
  9. VPC = "demosubs_vpc"
  10. }
  11. }
  12. resource "aws_internet_gateway" "vpc-demosubs" {
  13. vpc_id = "${aws_vpc.vpc-demosubs.id}"
  14. tags {
  15. Name = "demosubs_internet_gateway"
  16. Client = "demosubs"
  17. Internet_gateway = "demosubs_internet_gateway"
  18. }
  19. }
  20.  
  21.  
  22. /*
  23. Public Subnet 1
  24. */
  25. resource "aws_subnet" "public_subnet_demosubs" {
  26. vpc_id = "${aws_vpc.vpc-demosubs.id}"
  27. cidr_block = "10.3.0.0/24"
  28. availability_zone = "${var.region}a"
  29. map_public_ip_on_launch = "true"
  30. tags {
  31. Name = "demosubs_public_subnet"
  32. Client = "demosubs"
  33. Subnet = "Public_subnet"
  34. }
  35. }
  36.  
  37. resource "aws_route_table" "public_subnet_demosubs" {
  38. vpc_id= "${aws_vpc.vpc-demosubs.id}"
  39.  
  40. route {
  41. cidr_block = "0.0.0.0/0"
  42. gateway_id = "${aws_internet_gateway.vpc-demosubs.id}"
  43. }
  44. route {
  45. cidr_block = "10.0.0.0/16"
  46. vpc_peering_connection_id = "${aws_vpc_peering_connection.rds_to_demosubs.id}"
  47. }
  48.  
  49.  
  50.  
  51. tags {
  52. Name = "demosubs_public_route_table"
  53. Client = "demosubs"
  54. route_table = "demosubs_public_route_table"
  55. }
  56. }
  57.  
  58. resource "aws_route_table_association" "public_subnet_demosubs" {
  59. subnet_id = "${aws_subnet.public_subnet_demosubs.id}"
  60. route_table_id = "${aws_route_table.public_subnet_demosubs.id}"
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement