section-1_17.tfskip 593 B

1234567891011121314151617
  1. data "aws_billing_service_account" "main" {}
  2. data "template_file" "billing-s3-bucket-name" {
  3. template = "${file("${path.module}/templates/billing-s3-bucket-name.json.tpl")}"
  4. vars {
  5. bucket_name = "${lookup(local.workspace-dps-s3-cloudtrail-bucket,terraform.workspace,"")}"
  6. aws_billing_service_account_arn = "${data.aws_billing_service_account.main.arn}"
  7. }
  8. }
  9. resource "aws_s3_bucket" "billing_logs" {
  10. bucket = "${lookup(local.workspace-dps-s3-cloudtrail-bucket,terraform.workspace,"")}"
  11. acl = "private"
  12. policy = "${var.billing_s3_bucket_policy}"
  13. }