diff --git a/terraform/main.tf b/terraform/main.tf index 1d247bd..a627bca 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -6,6 +6,10 @@ provider "aws" { resource "random_pet" "name" {} +data "http" "myip" { + url = "http://ipv4.icanhazip.com" +} + module "vpc" { source = "terraform-aws-modules/vpc/aws" diff --git a/terraform/outputs.tf b/terraform/outputs.tf index 1f0be17..949d6d5 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -12,8 +12,9 @@ output "nameservers" { output "s3_bucket_name" { value = module.s3_bucket.s3_bucket_id } -#output "myip" { -#} +output "myip" { + value = "${chomp(data.http.myip.body)}" +} #output "aws_route53_zone" { # value = local.route53_zone