0
respostas

Erro ao executar o terraform plan para incluir um recurso via terraformcloud. Vi

Vi que um aluno resolveu e enviou o link da documentação, mas mesmo assim não entendi. Conseguem me mandar um modelo de como declarar as chaves no terraform cloud?

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

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

resource "aws_instance" "dev" { count = 3 ami = var.amis.us-east-1 instance_type = "t2.micro" key_name = var.key_name

tags = { Name = "dev${count.index}"} vpc_security_group_ids = ["sg-092dadab8a0f6e045"] }

resource "aws_instance" "dev4" {

ami = var.amis.us-east-1 instance_type = "t2.micro" key_name = var.key_name tags = { Name = "dev4"} vpc_security_group_ids = ["sg-092dadab8a0f6e045"] depends_on = [aws_s3_bucket.dev4] }

resource "aws_instance" "dev5" {

ami = var.amis.us-east-1 instance_type = "t2.micro" key_name = var.key_name tags = { Name = "dev5"} vpc_security_group_ids = ["sg-092dadab8a0f6e045"] }

resource "aws_instance" "dev6" { provider = aws.east-2ami = var.amis.us-east-2 instance_type = "t2.micro" key_name = var.key_name

tags = { Name = "dev6"} vpc_security_group_ids = ["sg-025986e4151bde69c"] depends_on = [aws_dynamodb_table.aws-database] }

resource "aws_instance" "dev7" { provider = aws.east-2ami = var.amis.us-east-2 instance_type = "t2.micro" key_name = var.key_name

tags = { Name = "dev7"} vpc_security_group_ids = ["sg-025986e4151bde69c"] }

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

tags = { Name = "marcio-bucket"

} }

resource "aws_s3_bucket" "homologacao" { bucket = "marcio-bucket-homo" acl = "private"

tags = { Name = "marcio-bucket-home"

} }

resource "aws_dynamodb_table" "aws-database" { provider = aws.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" } }