英文:
Update/delete aws_s3_object results in "InvalidArgument: Invalid attribute name specified."
问题
我有一个项目,使用Terraform创建AWS IoT证书并将它们存储在Amazon S3存储桶中。
我使用aws_s3_object
和内容属性来存储证书:
resource "aws_iot_certificate" "this" {
count = length(aws_iot_thing.this)
active = true
}
resource "aws_s3_object" "public_key" {
count = length(var.things)
bucket = module.s3_bucket.s3_bucket_id
key = "certificate/${var.things[count.index].customer_id}/public_key.pem"
content = aws_iot_certificate.this[count.index].public_key
}
该应用程序可以正常工作,但当我尝试创建或销毁对象时,Terraform总是给我这个错误:
Error: deleting S3 Bucket (xxxxxxx) Object (certificate/xxxx/public_key.pem): InvalidArgument: Invalid attribute name specified. status code: 400, request id: xxxxx, host id: xxxx
我尝试使用一个常量键,比如"test/public_key.pem",但结果相同。
英文:
I have a project where I create AWS IoT certificates using Terraform and store them in an Amazon S3 bucket.
I store the certificates using aws_s3_object
and the content attribute:
resource "aws_iot_certificate" "this" {
count = length(aws_iot_thing.this)
active = true
}
resource "aws_s3_object" "public_key" {
count = length(var.things)
bucket = module.s3_bucket.s3_bucket_id
key = "certificate/${var.things[count.index].customer_id}/public_key.pem"
content = aws_iot_certificate.this[count.index].public_key
}
The application works, but when I try to create or destroy the objects, Terraform always gives me this error:
Error: deleting S3 Bucket (xxxxxxx) Object (certificate/xxxx/public_key.pem): InvalidArgument: Invalid attribute name specified. status code: 400, request id: xxxxx, host id: xxxx
I tried to use a constant key like "test/public_key.pem", with the same result.
答案1
得分: 0
问题如jarmod提到的那样,已在Terraform AWS提供程序的问题32307中提到,并在提供程序版本5.6.2中修复。
英文:
Like jarmod mentioned the problem was mentioned in the Terraform AWS provider issue 32307 and fixed in the provider version 5.6.2.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论