You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ Error: Unsupported attribute │ │ on security_groups.tf line 23, in resource "aws_security_group" "webapp_http_inbound_sg": │ 23: vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id │ ├──────────────── │ │ data.tfe_outputs.networking.nonsensitive_values is object with no attributes │ │ This object does not have an attribute named "vpc_id".
tags = local.common_tags
}
\ No newline at end of file
diff --git a/terraform.tf b/terraform.tf
index 0b2278d..ac83b91 100644
--- a/terraform.tf
+++ b/terraform.tf
@@ -4,5 +4,9 @@ terraform {
source = "hashicorp/aws"
version = "~>5.0"
}
tfe = {
source = "hashicorp/tfe"
version = "~>0.49.2"
}
}
}
\ No newline at end of file
diff --git a/variables.tf b/variables.tf
index b1ef070..1f042b4 100644
--- a/variables.tf
+++ b/variables.tf
@@ -37,14 +37,12 @@ variable "api_key" {
description = "(Required) API key for web app to talk to SaaS platform."
}
-variable "public_subnets" {
type = list(string)
description = "(Required) List of subnet IDs for EC2 instance deployments."
+variable "tfe_organization" {
type = string
description = "(Required) TFE Organization to use for remote state."
}
-variable "vpc_id" {
+variable "tfe_workspace_name" {
type = string
description = "(Required) VPC ID of VPC for application deployment."
description = "(Required) TFE Workspace Name to use for remote state."
}`
when doing terraform plan data.tfe_outputs.networking.nonsensitive_values.vpc_id basically is not found. comparing w/the complete code in m9 - it has no diff. also tried. init, then plan from there, - same error.
tried both latest 0.49.2 and 0.47.0 of tfe provider, no diff
The text was updated successfully, but these errors were encountered:
https://github.com/timakamystery/globo-webapp/blob/tfe-outputs/resources.tf
│ Error: Unsupported attribute │ │ on security_groups.tf line 23, in resource "aws_security_group" "webapp_http_inbound_sg": │ 23: vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id │ ├──────────────── │ │ data.tfe_outputs.networking.nonsensitive_values is object with no attributes │ │ This object does not have an attribute named "vpc_id".
tfe = { source = "hashicorp/tfe" version = "= 0.47.0" }
`diff --git a/datasources.tf b/datasources.tf
index bafe7b0..888c009 100644
--- a/datasources.tf
+++ b/datasources.tf
@@ -4,4 +4,9 @@
data "aws_ssm_parameter" "amzn2_linux" {
name = "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
+}
+
+data "tfe_outputs" "networking" {
}
\ No newline at end of file
diff --git a/resources.tf b/resources.tf
index f3ab76d..5272bf0 100644
--- a/resources.tf
+++ b/resources.tf
@@ -26,10 +26,10 @@ locals {
##################################################################################
resource "aws_instance" "main" {
ami = nonsensitive(data.aws_ssm_parameter.amzn2_linux.value)
instance_type = var.instance_type
vpc_security_group_ids = [
aws_security_group.webapp_http_inbound_sg.id,
aws_security_group.webapp_ssh_inbound_sg.id,
@@ -97,7 +97,7 @@ resource "aws_lb" "main" {
internal = false
load_balancer_type = "application"
security_groups = [aws_security_group.webapp_http_inbound_sg.id]
subnets = data.tfe_outputs.networking.nonsensitive_values.public_subnets
enable_deletion_protection = false
@@ -120,7 +120,7 @@ resource "aws_lb_target_group" "main" {
port = 80
target_type = "instance"
protocol = "HTTP"
}
resource "aws_alb_target_group_attachment" "main" {
diff --git a/security_groups.tf b/security_groups.tf
index 9419606..9459c41 100644
--- a/security_groups.tf
+++ b/security_groups.tf
@@ -20,7 +20,7 @@ resource "aws_security_group" "webapp_http_inbound_sg" {
cidr_blocks = ["0.0.0.0/0"]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}
@@ -36,7 +36,7 @@ resource "aws_security_group" "webapp_ssh_inbound_sg" {
cidr_blocks = [var.ip_range]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}
@@ -52,7 +52,7 @@ resource "aws_security_group" "webapp_outbound_sg" {
cidr_blocks = ["0.0.0.0/0"]
}
vpc_id = data.tfe_outputs.networking.nonsensitive_values.vpc_id
tags = local.common_tags
}
\ No newline at end of file
diff --git a/terraform.tf b/terraform.tf
index 0b2278d..ac83b91 100644
--- a/terraform.tf
+++ b/terraform.tf
@@ -4,5 +4,9 @@ terraform {
source = "hashicorp/aws"
version = "~>5.0"
}
tfe = {
}
}
}
\ No newline at end of file
diff --git a/variables.tf b/variables.tf
index b1ef070..1f042b4 100644
--- a/variables.tf
+++ b/variables.tf
@@ -37,14 +37,12 @@ variable "api_key" {
description = "(Required) API key for web app to talk to SaaS platform."
}
-variable "public_subnets" {
+variable "tfe_organization" {
}
-variable "vpc_id" {
+variable "tfe_workspace_name" {
type = string
}`
when doing terraform plan data.tfe_outputs.networking.nonsensitive_values.vpc_id basically is not found. comparing w/the complete code in m9 - it has no diff. also tried. init, then plan from there, - same error.
tried both latest 0.49.2 and 0.47.0 of tfe provider, no diff
The text was updated successfully, but these errors were encountered: