@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
137 lines • 6.64 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportDefinition = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Cost and Usage Report Definitions.
*
* > *NOTE:* The AWS Cost and Usage Report service is only available in `us-east-1` currently.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleCurReportDefinition = new aws.cur.ReportDefinition("example_cur_report_definition", {
* reportName: "example-cur-report-definition",
* timeUnit: "HOURLY",
* format: "textORcsv",
* compression: "GZIP",
* additionalSchemaElements: [
* "RESOURCES",
* "SPLIT_COST_ALLOCATION_DATA",
* ],
* s3Bucket: "example-bucket-name",
* s3Prefix: "example-cur-report",
* s3Region: "us-east-1",
* additionalArtifacts: [
* "REDSHIFT",
* "QUICKSIGHT",
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Report Definitions using the `report_name`. For example:
*
* ```sh
* $ pulumi import aws:cur/reportDefinition:ReportDefinition example_cur_report_definition example-cur-report-definition
* ```
*/
class ReportDefinition extends pulumi.CustomResource {
/**
* Get an existing ReportDefinition resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ReportDefinition(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ReportDefinition. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ReportDefinition.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalArtifacts"] = state ? state.additionalArtifacts : undefined;
resourceInputs["additionalSchemaElements"] = state ? state.additionalSchemaElements : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["compression"] = state ? state.compression : undefined;
resourceInputs["format"] = state ? state.format : undefined;
resourceInputs["refreshClosedReports"] = state ? state.refreshClosedReports : undefined;
resourceInputs["reportName"] = state ? state.reportName : undefined;
resourceInputs["reportVersioning"] = state ? state.reportVersioning : undefined;
resourceInputs["s3Bucket"] = state ? state.s3Bucket : undefined;
resourceInputs["s3Prefix"] = state ? state.s3Prefix : undefined;
resourceInputs["s3Region"] = state ? state.s3Region : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["timeUnit"] = state ? state.timeUnit : undefined;
}
else {
const args = argsOrState;
if ((!args || args.additionalSchemaElements === undefined) && !opts.urn) {
throw new Error("Missing required property 'additionalSchemaElements'");
}
if ((!args || args.compression === undefined) && !opts.urn) {
throw new Error("Missing required property 'compression'");
}
if ((!args || args.format === undefined) && !opts.urn) {
throw new Error("Missing required property 'format'");
}
if ((!args || args.reportName === undefined) && !opts.urn) {
throw new Error("Missing required property 'reportName'");
}
if ((!args || args.s3Bucket === undefined) && !opts.urn) {
throw new Error("Missing required property 's3Bucket'");
}
if ((!args || args.s3Prefix === undefined) && !opts.urn) {
throw new Error("Missing required property 's3Prefix'");
}
if ((!args || args.s3Region === undefined) && !opts.urn) {
throw new Error("Missing required property 's3Region'");
}
if ((!args || args.timeUnit === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeUnit'");
}
resourceInputs["additionalArtifacts"] = args ? args.additionalArtifacts : undefined;
resourceInputs["additionalSchemaElements"] = args ? args.additionalSchemaElements : undefined;
resourceInputs["compression"] = args ? args.compression : undefined;
resourceInputs["format"] = args ? args.format : undefined;
resourceInputs["refreshClosedReports"] = args ? args.refreshClosedReports : undefined;
resourceInputs["reportName"] = args ? args.reportName : undefined;
resourceInputs["reportVersioning"] = args ? args.reportVersioning : undefined;
resourceInputs["s3Bucket"] = args ? args.s3Bucket : undefined;
resourceInputs["s3Prefix"] = args ? args.s3Prefix : undefined;
resourceInputs["s3Region"] = args ? args.s3Region : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["timeUnit"] = args ? args.timeUnit : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ReportDefinition.__pulumiType, name, resourceInputs, opts);
}
}
exports.ReportDefinition = ReportDefinition;
/** @internal */
ReportDefinition.__pulumiType = 'aws:cur/reportDefinition:ReportDefinition';
//# sourceMappingURL=reportDefinition.js.map