fix: update docs terraform config to create invalidation upon s3 upload
@@ -41,7 +41,10 @@ resource "null_resource" "upload" {
}
provisioner "local-exec" {
- command = "aws s3 sync ${var.build_dir}/docs-output/html s3://${aws_s3_bucket.docs.id}/${var.det_version} && aws cloudfront create-invalidation --distribution-id ${aws_cloudfront_distribution.distribution.id} --paths '/${var.det_version}/*'"
+ command = <<-EOT
+ aws s3 sync ${var.build_dir}/docs-output/html s3://${aws_s3_bucket.docs.id}/${var.det_version} ;
+ aws cloudfront create-invalidation --distribution-id ${aws_cloudfront_distribution.distribution.id} --paths '/${var.det_version}/*'
+ EOT
}
}
@@ -51,6 +54,9 @@ resource "null_resource" "upload_latest" {
}
provisioner "local-exec" {
- command = "aws s3 sync ${var.build_dir}/docs-output/html s3://${aws_s3_bucket.docs.id}/latest --delete && aws cloudfront create-invalidation --distribution-id ${aws_cloudfront_distribution.distribution.id} --paths '/latest/*'"
+ command = <<-EOT
+ aws s3 sync ${var.build_dir}/docs-output/html s3://${aws_s3_bucket.docs.id}/latest --delete ;
+ aws cloudfront create-invalidation --distribution-id ${aws_cloudfront_distribution.distribution.id} --paths '/latest/*'
+ EOT
}
}
