Skip to content

Commit

Permalink
fix integ test by adding dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hoegertn committed Apr 18, 2024
1 parent 0bbc0a7 commit da52664
Show file tree
Hide file tree
Showing 11 changed files with 938 additions and 6 deletions.
6 changes: 3 additions & 3 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/aws-cur/cost-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class ReportGranularity {
export class CurFormat {

/** GZIP compressed text or CSV format */
public static readonly TEXT: CurFormat = new CurFormat('GZIP', 'textORcsv');
public static readonly TEXT_OR_CSV: CurFormat = new CurFormat('GZIP', 'textORcsv');
/** Parquet format */
public static readonly PARQUET: CurFormat = new CurFormat('Parquet', 'Parquet');

Expand Down Expand Up @@ -124,9 +124,9 @@ export class CostReport extends Construct {
resources: [this.reportBucket.bucketArn],
}));

const format = props.format ?? CurFormat.TEXT;
const format = props.format ?? CurFormat.TEXT_OR_CSV;

this.createReportDefinition(this, 'Resource', {
const reportDefinition = this.createReportDefinition(this, 'Resource', {
compression: format.compression,
format: format.format,
refreshClosedReports: false,
Expand All @@ -138,6 +138,7 @@ export class CostReport extends Construct {
timeUnit: props.reportGranularity?.value ?? 'HOURLY',
additionalSchemaElements: ['RESOURCES'],
});
reportDefinition.node.addDependency(this.reportBucket.policy!);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "36.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "CurReportDefaultTestDeployAssert2956AD14.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/aws-cur/integ.cost-report.ts.snapshot/cdk.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"36.0.0"}
32 changes: 32 additions & 0 deletions test/aws-cur/integ.cost-report.ts.snapshot/cur-report.assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "36.0.0",
"files": {
"b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6": {
"source": {
"path": "asset.b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"ae9c3c5ffd6c1730f1c1a6319554d1637fade1f5910c4e0e87bcdc05e3d42ce7": {
"source": {
"path": "cur-report.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "ae9c3c5ffd6c1730f1c1a6319554d1637fade1f5910c4e0e87bcdc05e3d42ce7.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Loading

0 comments on commit da52664

Please sign in to comment.