我想将多个文件从本地设备中的特定文件夹上传到 AWS S3。我遇到了以下错误。

这是我的 terraform 代码。
resource "aws_s3_bucket" "testbucket" {
bucket = "test-terraform-pawan-1"
acl = "private"
tags = {
Name = "test-terraform"
Environment = "test"
}
}
resource "aws_s3_bucket_object" "uploadfile" {
bucket = "test-terraform-pawan-1"
key = "index.html"
source = "/home/pawan/Documents/Projects/"
}
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
我正在尝试使用 terraform 将我的 AWS ECR 存储库复制到同一账户内的多个区域。我从 AWS 控制台手动尝试,它工作正常,但从 terraform ,我无法找到解决方案。我尝试过的操作:我尝试为名为replicate_region的区域创建一个单独的变量,并尝试在列表中提供该区域,但它一直给我一个名为replicate_region的错误
属性“region”的值不合适:需要字符串。
这是变量代码:
variable "replicate_region" {
description = "value"
type = list(string)
}
Run Code Online (Sandbox Code Playgroud)
这是我的 ecr 复制代码:
resource "aws_ecr_replication_configuration" "replication" {
replication_configuration {
rule {
destination {
region = var.replicate_region
registry_id = "xxxxxxxx"
}
}}}
Run Code Online (Sandbox Code Playgroud)
有人可以帮我吗?
谢谢,
amazon-web-services terraform amazon-ecr terragrunt elastic-container-registry