diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..b242572efb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] +} \ No newline at end of file diff --git a/main.tf b/main.tf index 9b32ce06bb..53347769f4 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,5 @@ + + data "aws_ami" "app_ami" { most_recent = true @@ -16,7 +18,7 @@ data "aws_ami" "app_ami" { resource "aws_instance" "web" { ami = data.aws_ami.app_ami.id - instance_type = "t3.nano" + instance_type = var.instance_type tags = { Name = "HelloWorld" diff --git a/outputs.tf b/outputs.tf index b35171bef1..8103cba656 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,7 +1,7 @@ -#output "instance_ami" { -# value = aws_instance.web.ami -#} +output "instance_ami" { + value = aws_instance.web.ami +} -#output "instance_arn" { -# value = aws_instance.web.arn -#} +output "instance_arn" { + value = aws_instance.web.arn +} diff --git a/providers.tf b/providers.tf index c41e3650b5..37e4eaae11 100644 --- a/providers.tf +++ b/providers.tf @@ -1,11 +1,15 @@ -terraform { required_providers { aws = { source = "hashicorp/aws" + version = "~> 5.0" } } + + required_version = ">= 1.3.0" } provider "aws" { - region = "us-west-2" + region = "us-east-1" } + + diff --git a/variables.tf b/variables.tf index c750667e0f..60856bc925 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,4 @@ -#variable "instance_type" { -# description = "Type of EC2 instance to provision" -# default = "t3.nano" -#} +variable "instance_type" { + description = "Type of EC2 instance to provision" + default = "t3.nano" +}