Only set aws_s3_object SSE and ACL if not empty

This commit is contained in:
Peter Rifel 2024-09-07 10:43:24 -05:00
parent e615878519
commit 8e191496e1
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -752,10 +752,14 @@ func (p *S3Path) RenderTerraform(w *terraformWriter.TerraformWriter, name string
Bucket: p.Bucket(),
Key: p.Key(),
Content: content,
SSE: &sseVal,
Acl: &aclVal,
Provider: terraformWriter.LiteralTokens("aws", "files"),
}
if sseVal != "" {
tf.SSE = &sseVal
}
if aclVal != "" {
tf.Acl = &aclVal
}
return w.RenderResource("aws_s3_object", name, tf)
}