是否可以在另一个 AWS 账户(在账户 2 中创建)的一个 S3 存储桶中创建成本和使用情况报告(在账户 1 中生成)?

问题描述 投票:0回答:1

目前我正在尝试将一个帐户的成本和使用情况的输出存储到第二个帐户中创建的存储桶中。

data "aws_s3_bucket" "cur" {  
bucket = "cnr-auxo-dev-cur-logs"  
provider = aws.xxxx1
}

data "aws_region" "current" {}

resource "aws_cur_report_definition" "this" {  
report_name                = "xxxxxxxx"
time_unit                  = "HOURLY"  
format                     = "Parquet"  
compression                = "Parquet"  
report_versioning          = "OVERWRITE_REPORT"  
additional_artifacts       = ["ATHENA"]  
additional_schema_elements = ["RESOURCES"]
s3_bucket = data.aws_s3_bucket.cur.bucket  
s3_region = "${data.aws_region.current.name}"  
s3_prefix = "xxxxxxx"
}

这是我遇到的错误:

Error: creating Cost And Usage Report Definition (xxxxxxxx): ValidationException: 

  with aws_cur_report_definition.this,
  on cur.tf line 7, in resource "aws_cur_report_definition" "this":
   7: resource "aws_cur_report_definition" "this" {

所以我怀疑 aws 是否阻止我们管理另一个帐户的 s3 存储桶中 account1 的成本和使用情况报告? 感谢您的帮助!

amazon-web-services amazon-s3 terraform aws-cost-explorer
1个回答
0
投票

@helder 你是对的!跨账户是不可能的。我使用这个架构实现了它

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.