0
respostas

Invalid quoted type constraints │ │ on vars.tf line 13, in variable "cdirs_acesso_remoto": │ 13: type = "list"

Warning: Quoted references are deprecated │ │ on main.tf line 50, in resource "aws_instance" "dev6": │ 50: provider = "aws.us-east-2" │ │ In this context, references are expected literally rather than in quotes. Terraform 0.11 and│ earlier required quotes, but quoted references are now deprecated and will be removed in a future │ version of Terraform. Remove the quotes surrounding this reference to silence this warning.│ │ (and 3 more similar warnings elsewhere) ╵ ╷ │ Error: Invalid quoted type constraints │ │ on vars.tf line 13, in variable "cdirs_acesso_remoto": │ 13: type = "list" │ │ Terraform 0.11 and earlier required type constraints to be given in quotes, but that form is now│ deprecated and will be removed in a future version of Terraform. Remove the quotes around "list"│ and write list(string) instead to explicitly indicate that the list elements are strings. ╵ PS C:\Users\fernando.portella\terraform2>

provider "aws" { version = "~> 2.0" region = "us-east-1" }

provider "aws" { alias = "us-east-2" version = "~> 2.0" region = "us-east-2" }

resource "aws_instance" "dev" { count = 3 ami = "ami-026c8acd92718196b" instance_type = "t2.micro" key_name = "terraform-aws" tags = { Name = "dev${count.index}" } vpc_security_group_ids = ["sg-000e7dbfa4e45f7b4"] }

resource "aws_instance" "dev4" { ami = "ami-026c8acd92718196b" instance_type = "t2.micro" key_name = "terraform-aws" tags = { Name = "dev4" } vpc_security_group_ids = ["sg-000e7dbfa4e45f7b4"] depends_on = [aws_s3_bucket.dev4]

}

resource "aws_instance" "dev5" { ami = "${var.amis["us-east-1"]}" instance_type = "t2.micro" key_name = "terraform-aws" tags = { Name = "dev5" } vpc_security_group_ids = ["${aws_security_group.acesso-ssh.id}"] }

resource "aws_instance" "dev6" { provider = "aws.us-east-2" ami = "${var.amis["us-east-2"]}" instance_type = "t2.micro" key_name = "terraform-aws" tags = { Name = "dev6" } vpc_security_group_ids = ["${aws_security_group.acesso-ssh-us-east-2.id}"] depends_on = ["aws_dynamodb_table.dynamodb-homologacao"] }

resource "aws_s3_bucket" "dev4" { bucket = "alevatolabs-dev4" acl = "private"

tags = { Name = "My bucket" Environment = "alevatolabs-dev4" } }

resource "aws_dynamodb_table" "dynamodb-homologacao" { provider = "aws.us-east-2" name = "GameScores" billing_mode = "PAY_PER_REQUEST" hash_key = "UserId" range_key = "GameTitle"

attribute { name = "UserId" type = "S" }

attribute { name = "GameTitle" type = "S" } }

resource "aws_security_group" "acesso-ssh-us-east-2" { provider = "aws.us-east-2" name = "acesso-ssh" description = "acesso-ssh"

ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["var.cdirs_acesso_remoto"] }

tags = { Name = "ssh" }

}

variable "amis" { type = map(string)

default = { "us-east-1" = "ami-026c8acd92718196b" "us-east-2" = "ami-0d8f6eb4f641ef691"

} }

variable "cdirs_acesso_remoto" { type = "list" default = ["186.221.217.97/32", "192.32.154.79/32"] }

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software