Sou novato, não estou identificando o erro e não consigo prosseguir.
│ Error: Provider configuration not present │ │ To work with aws_dynamodb_table.dynamodb-homologacao its original provider configuration at │ provider["registry.terraform.io/hashicorp/aws"].us-east-e is required, but it has been removed. This │ occurs when a provider configuration is removed while objects created by that provider still exist in │ the state. Re-add the provider configuration to destroy aws_dynamodb_table.dynamodb-homologacao, after │ which you can remove the provider configuration again.
main.tf
provider "aws" {
version = "~> 2.0"
region = "us-east-1"
}
provider "aws" {
alias = "us-east-2"
version = "~> 2.0"
region = "us-east-1"
}
resource "aws_instance" "dev" {
count = 3
ami = "ami-09e67e426f25ce0d7"
instance_type = "t2.micro"
key_name = "terraform-aws1"
tags = {
Name = "dev${count.index}"
}
vpc_security_group_ids = ["${aws_security_group.acesso-ssh.id}"]
}
resource "aws_instance" "dev4" {
ami = "ami-09e67e426f25ce0d7"
instance_type = "t2.micro"
key_name = "terraform-aws1"
tags = {
Name = "dev4"
}
vpc_security_group_ids = ["${aws_security_group.acesso-ssh.id}"]
depends_on = [aws_s3_bucket.dev4]
}
resource "aws_instance" "dev5" {
ami = "ami-09e67e426f25ce0d7"
instance_type = "t2.micro"
key_name = "terraform-aws1"
tags = {
Name = "dev5"
}
vpc_security_group_ids = ["${aws_security_group.acesso-ssh.id}"]
}
resource "aws_instance" "dev6" {
provider = "aws.us-east-2"
ami = "ami-0d8d212151031f51c"
instance_type = "t2.micro"
key_name = "terraform-aws1"
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 = "igorp-dev4"
acl = "private"
tags = {
"Name" = "igorp-dev4"
}
}
resource "aws_dynamodb_table" "dynamodb-homologacao" {
provider = "aws.us-east-e"
name = "GameScores"
billing_mode = "PAY_PER_REQUEST"
hash_key = "UserId"
range_key = "GameTitle"
attribute {
name = "UserId"
type = "S"
}
attribute {
name = "GameTitle"
type = "S"
}
}
security-group.tf
resource "aws_security_group" "acesso-ssh" {
name = "acesso-ssh"
description = "acesso-ssh"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["189.100.69.40/32"]
}
tags = {
Name = "ssh"
}
}
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 = ["189.100.69.40/32"]
}
tags = {
Name = "ssh"
}
}