putReportDefinition
inline suspend fun CostAndUsageReportClient.putReportDefinition(crossinline block: PutReportDefinitionRequest.Builder.() -> Unit): PutReportDefinitionResponse
Creates a new report using the description that you provide.
Samples
import aws.sdk.kotlin.services.costandusagereportservice.model.AdditionalArtifact
import aws.sdk.kotlin.services.costandusagereportservice.model.SchemaElement
fun main() {
//sampleStart
// The following example creates a AWS Cost and Usage report named ExampleReport.
costAndUsageReportClient.putReportDefinition {
reportDefinition = ReportDefinition {
reportName = "ExampleReport"
timeUnit = TimeUnit.fromValue("DAILY")
format = ReportFormat.fromValue("textORcsv")
compression = CompressionFormat.fromValue("ZIP")
additionalSchemaElements = listOf<SchemaElement>(
SchemaElement.fromValue("RESOURCES")
)
s3Bucket = "example-s3-bucket"
s3Prefix = "exampleprefix"
s3Region = AwsRegion.fromValue("us-east-1")
additionalArtifacts = listOf<AdditionalArtifact>(
AdditionalArtifact.fromValue("REDSHIFT"),
AdditionalArtifact.fromValue("QUICKSIGHT")
)
}
}
//sampleEnd
}