Show / Hide Table of Contents

Class GetBillingServiceAccount

Inheritance
System.Object
GetBillingServiceAccount
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws
Assembly: Pulumi.Aws.dll
Syntax
public static class GetBillingServiceAccount

Methods

View Source

InvokeAsync(InvokeOptions)

Use this data source to get the Account ID of the AWS Billing and Cost Management Service Account for the purpose of whitelisting in S3 bucket policy.

{{% examples %}}

Example Usage

{{% example %}}

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var main = Output.Create(Aws.GetBillingServiceAccount.InvokeAsync());
    var billingLogs = new Aws.S3.Bucket("billingLogs", new Aws.S3.BucketArgs
    {
        Acl = "private",
        Policy = Output.Tuple(main, main).Apply(values =>
        {
            var main = values.Item1;
            var main1 = values.Item2;
            return @$"{{
""Id"": ""Policy"",
""Version"": ""2012-10-17"",
""Statement"": [
{{
  ""Action"": [
    ""s3:GetBucketAcl"", ""s3:GetBucketPolicy""
  ],
  ""Effect"": ""Allow"",
  ""Resource"": ""arn:aws:s3:::my-billing-tf-test-bucket"",
  ""Principal"": {{
    ""AWS"": [
      ""{main.Arn}""
    ]
  }}
}},
{{
  ""Action"": [
    ""s3:PutObject""
  ],
  ""Effect"": ""Allow"",
  ""Resource"": ""arn:aws:s3:::my-billing-tf-test-bucket/*"",
  ""Principal"": {{
    ""AWS"": [
      ""{main1.Arn}""
    ]
  }}
}}
]
}}

";
        }),
    });
}

}

{{% /example %}} {{% /examples %}}

Declaration
public static Task<GetBillingServiceAccountResult> InvokeAsync(InvokeOptions options = null)
Parameters
Type Name Description
InvokeOptions options
Returns
Type Description
System.Threading.Tasks.Task<GetBillingServiceAccountResult>
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.