Export class

Resource for managing an AWS BCM Data Exports Export.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = aws.getCallerIdentity({});
const currentGetPartition = aws.getPartition({});
const test = new aws.bcmdata.Export("test", {"export": {
    dataQueries: [{
        queryStatement: "SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT",
        tableConfigurations: {
            COST_AND_USAGE_REPORT: {
                BILLING_VIEW_ARN: Promise.all([currentGetPartition, current]).then(([currentGetPartition, current]) => `arn:${currentGetPartition.partition}:billing::${current.accountId}:billingview/primary`),
                TIME_GRANULARITY: "HOURLY",
                INCLUDE_RESOURCES: "FALSE",
                INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY: "FALSE",
                INCLUDE_SPLIT_COST_ALLOCATION_DATA: "FALSE",
            },
        },
    }],
    destinationConfigurations: [{
        s3Destinations: [{
            s3OutputConfigurations: [{
                overwrite: "OVERWRITE_REPORT",
                format: "TEXT_OR_CSV",
                compression: "GZIP",
                outputType: "CUSTOM",
            }],
            s3Bucket: testAwsS3Bucket.bucket,
            s3Prefix: testAwsS3Bucket.bucketPrefix,
            s3Region: testAwsS3Bucket.region,
        }],
    }],
    refreshCadences: [{
        frequency: "SYNCHRONOUS",
    }],
    name: "testexample",
}});
import pulumi
import pulumi_aws as aws

current = aws.get_caller_identity()
current_get_partition = aws.get_partition()
test = aws.bcmdata.Export("test", export={
    "data_queries": [{
        "query_statement": "SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT",
        "table_configurations": {
            "COST_AND_USAGE_REPORT": {
                "BILLING_VIEW_ARN": f"arn:{current_get_partition.partition}:billing::{current.account_id}:billingview/primary",
                "TIME_GRANULARITY": "HOURLY",
                "INCLUDE_RESOURCES": "FALSE",
                "INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY": "FALSE",
                "INCLUDE_SPLIT_COST_ALLOCATION_DATA": "FALSE",
            },
        },
    }],
    "destination_configurations": [{
        "s3_destinations": [{
            "s3_output_configurations": [{
                "overwrite": "OVERWRITE_REPORT",
                "format": "TEXT_OR_CSV",
                "compression": "GZIP",
                "output_type": "CUSTOM",
            }],
            "s3_bucket": test_aws_s3_bucket["bucket"],
            "s3_prefix": test_aws_s3_bucket["bucketPrefix"],
            "s3_region": test_aws_s3_bucket["region"],
        }],
    }],
    "refresh_cadences": [{
        "frequency": "SYNCHRONOUS",
    }],
    "name": "testexample",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var current = Aws.GetCallerIdentity.Invoke();

    var currentGetPartition = Aws.GetPartition.Invoke();

    var test = new Aws.BcmData.Export("test", new()
    {
        ExportDetails = new Aws.BcmData.Inputs.ExportExportArgs
        {
            DataQueries = new[]
            {
                new Aws.BcmData.Inputs.ExportExportDataQueryArgs
                {
                    QueryStatement = "SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT",
                    TableConfigurations =
                    {
                        { "COST_AND_USAGE_REPORT", new InputMap<string>
                        {
                            { "BILLING_VIEW_ARN", Output.Tuple(currentGetPartition, current).Apply(values =>
                            {
                                var currentGetPartition = values.Item1;
                                var current = values.Item2;
                                return $"arn:{currentGetPartition.Apply(getPartitionResult => getPartitionResult.Partition)}:billing::{current.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId)}:billingview/primary";
                            }) },
                            { "TIME_GRANULARITY", "HOURLY" },
                            { "INCLUDE_RESOURCES", "FALSE" },
                            { "INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY", "FALSE" },
                            { "INCLUDE_SPLIT_COST_ALLOCATION_DATA", "FALSE" },
                        } },
                    },
                },
            },
            DestinationConfigurations = new[]
            {
                new Aws.BcmData.Inputs.ExportExportDestinationConfigurationArgs
                {
                    S3Destinations = new[]
                    {
                        new Aws.BcmData.Inputs.ExportExportDestinationConfigurationS3DestinationArgs
                        {
                            S3OutputConfigurations = new[]
                            {
                                new Aws.BcmData.Inputs.ExportExportDestinationConfigurationS3DestinationS3OutputConfigurationArgs
                                {
                                    Overwrite = "OVERWRITE_REPORT",
                                    Format = "TEXT_OR_CSV",
                                    Compression = "GZIP",
                                    OutputType = "CUSTOM",
                                },
                            },
                            S3Bucket = testAwsS3Bucket.Bucket,
                            S3Prefix = testAwsS3Bucket.BucketPrefix,
                            S3Region = testAwsS3Bucket.Region,
                        },
                    },
                },
            },
            RefreshCadences = new[]
            {
                new Aws.BcmData.Inputs.ExportExportRefreshCadenceArgs
                {
                    Frequency = "SYNCHRONOUS",
                },
            },
            Name = "testexample",
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bcmdata"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
		if err != nil {
			return err
		}
		currentGetPartition, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = bcmdata.NewExport(ctx, "test", &bcmdata.ExportArgs{
			Export: &bcmdata.ExportExportArgs{
				DataQueries: bcmdata.ExportExportDataQueryArray{
					&bcmdata.ExportExportDataQueryArgs{
						QueryStatement: pulumi.String("SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT"),
						TableConfigurations: pulumi.StringMapMap{
							"COST_AND_USAGE_REPORT": pulumi.StringMap{
								"BILLING_VIEW_ARN":                      pulumi.Sprintf("arn:%v:billing::%v:billingview/primary", currentGetPartition.Partition, current.AccountId),
								"TIME_GRANULARITY":                      pulumi.String("HOURLY"),
								"INCLUDE_RESOURCES":                     pulumi.String("FALSE"),
								"INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY": pulumi.String("FALSE"),
								"INCLUDE_SPLIT_COST_ALLOCATION_DATA":    pulumi.String("FALSE"),
							},
						},
					},
				},
				DestinationConfigurations: bcmdata.ExportExportDestinationConfigurationArray{
					&bcmdata.ExportExportDestinationConfigurationArgs{
						S3Destinations: bcmdata.ExportExportDestinationConfigurationS3DestinationArray{
							&bcmdata.ExportExportDestinationConfigurationS3DestinationArgs{
								S3OutputConfigurations: bcmdata.ExportExportDestinationConfigurationS3DestinationS3OutputConfigurationArray{
									&bcmdata.ExportExportDestinationConfigurationS3DestinationS3OutputConfigurationArgs{
										Overwrite:   pulumi.String("OVERWRITE_REPORT"),
										Format:      pulumi.String("TEXT_OR_CSV"),
										Compression: pulumi.String("GZIP"),
										OutputType:  pulumi.String("CUSTOM"),
									},
								},
								S3Bucket: pulumi.Any(testAwsS3Bucket.Bucket),
								S3Prefix: pulumi.Any(testAwsS3Bucket.BucketPrefix),
								S3Region: pulumi.Any(testAwsS3Bucket.Region),
							},
						},
					},
				},
				RefreshCadences: bcmdata.ExportExportRefreshCadenceArray{
					&bcmdata.ExportExportRefreshCadenceArgs{
						Frequency: pulumi.String("SYNCHRONOUS"),
					},
				},
				Name: pulumi.String("testexample"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_getcalleridentity" "current" {
}
data "aws_getpartition" "currentGetPartition" {
}

resource "aws_bcmdata_export" "test" {
  export = {
    data_queries = [{
      "queryStatement" = "SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT"
      "tableConfigurations" = {
        "COST_AND_USAGE_REPORT" = {
          "BILLING_VIEW_ARN"                      ="arn:${data.aws_getpartition.currentGetPartition.partition}:billing::${data.aws_getcalleridentity.current.account_id}:billingview/primary"
          "TIME_GRANULARITY"                      = "HOURLY"
          "INCLUDE_RESOURCES"                     = "FALSE"
          "INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY" = "FALSE"
          "INCLUDE_SPLIT_COST_ALLOCATION_DATA"    = "FALSE"
        }
      }
    }]
    destination_configurations = [{
      "s3Destinations" = [{
        "s3OutputConfigurations" = [{
          "overwrite"   = "OVERWRITE_REPORT"
          "format"      = "TEXT_OR_CSV"
          "compression" = "GZIP"
          "outputType"  = "CUSTOM"
        }]
        "s3Bucket" = testAwsS3Bucket.bucket
        "s3Prefix" = testAwsS3Bucket.bucketPrefix
        "s3Region" = testAwsS3Bucket.region
      }]
    }]
    refresh_cadences = [{
      "frequency" = "SYNCHRONOUS"
    }]
    name = "testexample"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.inputs.GetPartitionArgs;
import com.pulumi.aws.bcmdata.Export;
import com.pulumi.aws.bcmdata.ExportArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportDataQueryArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportDestinationConfigurationArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportDestinationConfigurationS3DestinationArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportDestinationConfigurationS3DestinationS3OutputConfigurationArgs;
import com.pulumi.aws.bcmdata.inputs.ExportExportRefreshCadenceArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var current = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
            .build());

        final var currentGetPartition = AwsFunctions.getPartition(GetPartitionArgs.builder()
            .build());

        var test = new Export("test", ExportArgs.builder()
            .export(ExportExportArgs.builder()
                .dataQueries(ExportExportDataQueryArgs.builder()
                    .queryStatement("SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT")
                    .tableConfigurations(Map.of("COST_AND_USAGE_REPORT", Map.ofEntries(
                        Map.entry("BILLING_VIEW_ARN", String.format("arn:%s:billing::%s:billingview/primary", currentGetPartition.partition(),current.accountId())),
                        Map.entry("TIME_GRANULARITY", "HOURLY"),
                        Map.entry("INCLUDE_RESOURCES", "FALSE"),
                        Map.entry("INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY", "FALSE"),
                        Map.entry("INCLUDE_SPLIT_COST_ALLOCATION_DATA", "FALSE")
                    )))
                    .build())
                .destinationConfigurations(ExportExportDestinationConfigurationArgs.builder()
                    .s3Destinations(ExportExportDestinationConfigurationS3DestinationArgs.builder()
                        .s3OutputConfigurations(ExportExportDestinationConfigurationS3DestinationS3OutputConfigurationArgs.builder()
                            .overwrite("OVERWRITE_REPORT")
                            .format("TEXT_OR_CSV")
                            .compression("GZIP")
                            .outputType("CUSTOM")
                            .build())
                        .s3Bucket(testAwsS3Bucket.bucket())
                        .s3Prefix(testAwsS3Bucket.bucketPrefix())
                        .s3Region(testAwsS3Bucket.region())
                        .build())
                    .build())
                .refreshCadences(ExportExportRefreshCadenceArgs.builder()
                    .frequency("SYNCHRONOUS")
                    .build())
                .name("testexample")
                .build())
            .build());

    }
}
resources:
  test:
    type: aws:bcmdata:Export
    properties:
      export:
        dataQueries:
          - queryStatement: SELECT identity_line_item_id, identity_time_interval, line_item_product_code,line_item_unblended_cost FROM COST_AND_USAGE_REPORT
            tableConfigurations:
              COST_AND_USAGE_REPORT:
                BILLING_VIEW_ARN: arn:${currentGetPartition.partition}:billing::${current.accountId}:billingview/primary
                TIME_GRANULARITY: HOURLY
                INCLUDE_RESOURCES: FALSE
                INCLUDE_MANUAL_DISCOUNT_COMPATIBILITY: FALSE
                INCLUDE_SPLIT_COST_ALLOCATION_DATA: FALSE
        destinationConfigurations:
          - s3Destinations:
              - s3OutputConfigurations:
                  - overwrite: OVERWRITE_REPORT
                    format: TEXT_OR_CSV
                    compression: GZIP
                    outputType: CUSTOM
                s3Bucket: ${testAwsS3Bucket.bucket}
                s3Prefix: ${testAwsS3Bucket.bucketPrefix}
                s3Region: ${testAwsS3Bucket.region}
        refreshCadences:
          - frequency: SYNCHRONOUS
        name: testexample
variables:
  current:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}
  currentGetPartition:
    fn::invoke:
      function: aws:getPartition
      arguments: {}

Import

Identity Schema

Required

  • arn (String) ARN of the BCM Data Exports export.

Using pulumi import, import BCM Data Exports Export using the export ARN. For example:

$ pulumi import aws:bcmdata/export:Export example arn:aws:bcm-data-exports:us-east-1:123456789012:export/CostUsageReport-9f1c75f3-f982-4d9a-b936-1e7ecab814b7

Constructors

Export(String name, {ExportArgs? args, CustomResourceOptions? options})
Creates a new Export. name The Pulumi resource name. args Arguments used to configure this Export. The set of arguments for Export. options Resource options controlling this resource's behavior.
Export.reference(String urn)
Creates a typed reference to an existing Export resource.

Properties

arn ↔ Output<String>
ARN for this export.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
export ↔ Output<ExportExport?>
The details of the export, including data query, name, description, and destination configuration. See the export argument reference below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
latefinal
timeouts ↔ Output<ExportTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ExportState? state, CustomResourceOptions? options}) → Export
Gets an existing Export resource's state with the given name and id.