-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📊Tracking: AWS CE #8635
Comments
Hey team, even though there are only a few thumbs up, I'd like to take this on if that's alright! If so, I'll start on the modeling/README file. So far I was thinking something like the following as an idea for the cost category, based on the feedback from #16564. const sharedBusinessUnit = CostCategoryRule.regular({
value: "Shared",
rule: Expression.dimension({
key: DimensionValuesKey.LINKED_ACCOUNT,
matchOptions: [MatchOption.EQUALS],
values: ["222222222222"],
}),
});
const businessUnit = new CostCategory(this, "BusinessUnit", {
name: "Business Unit",
defaultValue: "Other",
ruleVersion: RuleVersion.COST_CATEGORY_EXPRESSION_V1,
rules: [
CostCategoryRule.inheritedValue({
dimensionName: CostCategoryInheritedValueDimensionName.TAG,
dimensionKey: "BusinessUnit",
}),
CostCategoryRule.regular({
value: "Amazon.com",
rule: Expression.dimension({
key: DimensionValuesKey.LINKED_ACCOUNT,
matchOptions: [MatchOption.EQUALS],
values: ["11111111"],
}),
}),
CostCategoryRule.regular({
value: "Amazon Web Services",
rule: Expression.tag({
key: "Application",
matchOptions: [MatchOption.CONTAINS, MatchOption.CASE_INSENSITIVE],
values: ["AWS", "Amazon Web Services"],
}),
}),
sharedBusinessUnit,
],
});
businessUnit.addSplitChargeRule(
CostCategorySplitChargeRule.proportional({
source: sharedBusinessUnit,
targets: businessUnit.rules,
})
); |
I'm also thinking we can add a type to model the account numbers and other dimension values so we can add validation. For example: const sharedBusinessUnit = CostCategoryRule.regular({
value: ExpressionValue.dimension("Shared"),
rule: Expression.dimension({
key: DimensionValuesKey.LINKED_ACCOUNT,
matchOptions: [MatchOption.EQUALS],
values: [ExpressionValue.awsAccount("222222222222")],
}),
});
const businessUnit = new CostCategory(this, "BusinessUnit", {
name: ExpressionValue.costCategory("Business Unit"),
defaultValue: ExpressionValue.costCategory("Other"),
ruleVersion: RuleVersion.COST_CATEGORY_EXPRESSION_V1,
rules: [
CostCategoryRule.inheritedValue({
dimensionName: CostCategoryInheritedValueDimensionName.TAG,
dimensionKey: ExpressionValue.costCategory("BusinessUnit"),
}),
CostCategoryRule.regular({
value: ExpressionValue.costCategory("Amazon.com"),
rule: Expression.dimension({
key: DimensionValuesKey.LINKED_ACCOUNT,
matchOptions: [MatchOption.EQUALS],
values: [ExpressionValue.awsAccount("111111111111")],
}),
}),
CostCategoryRule.regular({
value: ExpressionValue.costCategory("Amazon Web Services"),
rule: Expression.tag({
key: ExpressionValue.dimension("Application"),
matchOptions: [MatchOption.CONTAINS, MatchOption.CASE_INSENSITIVE],
values: [
ExpressionValue.dimension("AWS"),
ExpressionValue.dimension("Amazon Web Services"),
],
}),
}),
sharedBusinessUnit,
],
});
businessUnit.addSplitChargeRule(
CostCategorySplitChargeRule.proportional({
source: sharedBusinessUnit,
targets: businessUnit.rules,
})
); |
Add your +1 👍 to help us prioritize high-level constructs for this service
Overview:
AWS Docs
Maturity: CloudFormation Resources Only
See the AWS Construct Library Module Lifecycle doc for more information about maturity levels.
Implementation:
See the CDK API Reference for more implementation details.
Issue list:
This is a 📊Tracking Issue
The text was updated successfully, but these errors were encountered: