diff --git a/pkg/terraform/presets.go b/pkg/terraform/presets.go index c6a46da31..58879d809 100644 --- a/pkg/terraform/presets.go +++ b/pkg/terraform/presets.go @@ -1,6 +1,7 @@ package terraform import ( + "fmt" "strings" "github.com/zclconf/go-cty/cty" @@ -38,5 +39,14 @@ func postProcessValues(b *Block, input map[string]cty.Value) map[string]cty.Valu } } + switch b.TypeLabel() { + case "aws_s3_bucket": + var bucketName string + if bucket := input["bucket"]; bucket.Type().Equals(cty.String) { + bucketName = bucket.AsString() + } + input["arn"] = cty.StringVal(fmt.Sprintf("arn:aws:s3:::%s", bucketName)) + } + return input }