@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
127 lines (126 loc) • 4.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Use this data source to get the Account ID of the [AWS Billing and Cost Management Service Account](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2) for the purpose of permitting in S3 bucket policy.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = aws.getBillingServiceAccount({});
* const billingLogs = new aws.s3.Bucket("billing_logs", {bucket: "my-billing-tf-test-bucket"});
* const billingLogsAcl = new aws.s3.BucketAcl("billing_logs_acl", {
* bucket: billingLogs.id,
* acl: "private",
* });
* const allowBillingLogging = pulumi.all([main, billingLogs.arn, main, billingLogs.arn]).apply(([main, billingLogsArn, main1, billingLogsArn1]) => aws.iam.getPolicyDocumentOutput({
* statements: [
* {
* effect: "Allow",
* principals: [{
* type: "AWS",
* identifiers: [main.arn],
* }],
* actions: [
* "s3:GetBucketAcl",
* "s3:GetBucketPolicy",
* ],
* resources: [billingLogsArn],
* },
* {
* effect: "Allow",
* principals: [{
* type: "AWS",
* identifiers: [main1.arn],
* }],
* actions: ["s3:PutObject"],
* resources: [`${billingLogsArn1}/*`],
* },
* ],
* }));
* const allowBillingLoggingBucketPolicy = new aws.s3.BucketPolicy("allow_billing_logging", {
* bucket: billingLogs.id,
* policy: allowBillingLogging.apply(allowBillingLogging => allowBillingLogging.json),
* });
* ```
*/
export declare function getBillingServiceAccount(args?: GetBillingServiceAccountArgs, opts?: pulumi.InvokeOptions): Promise<GetBillingServiceAccountResult>;
/**
* A collection of arguments for invoking getBillingServiceAccount.
*/
export interface GetBillingServiceAccountArgs {
/**
* ID of the AWS billing service account.
*/
id?: string;
}
/**
* A collection of values returned by getBillingServiceAccount.
*/
export interface GetBillingServiceAccountResult {
/**
* ARN of the AWS billing service account.
*/
readonly arn: string;
/**
* ID of the AWS billing service account.
*/
readonly id: string;
}
/**
* Use this data source to get the Account ID of the [AWS Billing and Cost Management Service Account](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2) for the purpose of permitting in S3 bucket policy.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = aws.getBillingServiceAccount({});
* const billingLogs = new aws.s3.Bucket("billing_logs", {bucket: "my-billing-tf-test-bucket"});
* const billingLogsAcl = new aws.s3.BucketAcl("billing_logs_acl", {
* bucket: billingLogs.id,
* acl: "private",
* });
* const allowBillingLogging = pulumi.all([main, billingLogs.arn, main, billingLogs.arn]).apply(([main, billingLogsArn, main1, billingLogsArn1]) => aws.iam.getPolicyDocumentOutput({
* statements: [
* {
* effect: "Allow",
* principals: [{
* type: "AWS",
* identifiers: [main.arn],
* }],
* actions: [
* "s3:GetBucketAcl",
* "s3:GetBucketPolicy",
* ],
* resources: [billingLogsArn],
* },
* {
* effect: "Allow",
* principals: [{
* type: "AWS",
* identifiers: [main1.arn],
* }],
* actions: ["s3:PutObject"],
* resources: [`${billingLogsArn1}/*`],
* },
* ],
* }));
* const allowBillingLoggingBucketPolicy = new aws.s3.BucketPolicy("allow_billing_logging", {
* bucket: billingLogs.id,
* policy: allowBillingLogging.apply(allowBillingLogging => allowBillingLogging.json),
* });
* ```
*/
export declare function getBillingServiceAccountOutput(args?: GetBillingServiceAccountOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetBillingServiceAccountResult>;
/**
* A collection of arguments for invoking getBillingServiceAccount.
*/
export interface GetBillingServiceAccountOutputArgs {
/**
* ID of the AWS billing service account.
*/
id?: pulumi.Input<string>;
}