Amazon 账单控制台模板代码段 - Amazon CloudFormation
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

Amazon 账单控制台模板代码段

此示例创建一个包含 10% 全球加价定价规则的定价计划。此定价计划已附加到账单组。账单组还有两个自定义行项目,在账单组总成本的基础上收取 10 美元的费用和 10% 的费用。

JSON

{ "Parameters": { "LinkedAccountIds": { "Type": "ListNumber" }, "PrimaryAccountId": { "Type": "Number" } }, "Resources": { "TestPricingRule": { "Type": "AWS::BillingConductor::PricingRule", "Properties": { "Name": "TestPricingRule", "Description": "Test pricing rule created through Cloudformation. Mark everything by 10%.", "Type": "MARKUP", "Scope": "GLOBAL", "ModifierPercentage": 10 } }, "TestPricingPlan": { "Type": "AWS::BillingConductor::PricingPlan", "Properties": { "Name": "TestPricingPlan", "Description": "Test pricing plan created through Cloudformation.", "PricingRuleArns": [ {"Fn::GetAtt": ["TestPricingRule", "Arn"]} ] } }, "TestBillingGroup": { "Type": "AWS::BillingConductor::BillingGroup", "Properties": { "Name": "TestBillingGroup", "Description": "Test billing group created through Cloudformation with 1 linked account. The linked account is also the primary account.", "PrimaryAccountId": { "Ref": "PrimaryAccountId" }, "AccountGrouping": { "LinkedAccountIds": null }, "ComputationPreference": { "PricingPlanArn": { "Fn::GetAtt": ["TestPricingPlan", "Arn"] } } } }, "TestFlatCustomLineItem": { "Type": "AWS::BillingConductor::CustomLineItem", "Properties": { "Name": "TestFlatCustomLineItem", "Description": "Test flat custom line item created through Cloudformation for a $10 charge.", "BillingGroupArn": { "Fn::GetAtt": ["TestBillingGroup", "Arn"] }, "CustomLineItemChargeDetails": { "Flat": { "ChargeValue": 10 }, "Type": "FEE" } } }, "TestPercentageCustomLineItem": { "Type": "AWS::BillingConductor::CustomLineItem", "Properties": { "Name": "TestPercentageCustomLineItem", "Description": "Test percentage custom line item created through Cloudformation for a %10 additional charge on the overall total bill of the billing group.", "BillingGroupArn": { "Fn::GetAtt": ["TestBillingGroup", "Arn"] }, "CustomLineItemChargeDetails": { "Percentage": { "PercentageValue": 10, "ChildAssociatedResources": [ {"Fn::GetAtt": ["TestBillingGroup", "Arn"]} ] }, "Type": "FEE" } } } } }

YAML

Parameters: LinkedAccountIds: Type: ListNumber PrimaryAccountId: Type: Number Resources: TestPricingRule: Type: 'AWS::BillingConductor::PricingRule' Properties: Name: 'TestPricingRule' Description: 'Test pricing rule created through Cloudformation. Mark everything by 10%.' Type: 'MARKUP' Scope: 'GLOBAL' ModifierPercentage: 10 TestPricingPlan: Type: 'AWS::BillingConductor::PricingPlan' Properties: Name: 'TestPricingPlan' Description: 'Test pricing plan created through Cloudformation.' PricingRuleArns: - !GetAtt TestPricingRule.Arn TestBillingGroup: Type: 'AWS::BillingConductor::BillingGroup' Properties: Name: 'TestBillingGroup' Description: 'Test billing group created through Cloudformation with 1 linked account. The linked account is also the primary account.' PrimaryAccountId: !Ref PrimaryAccountId AccountGrouping: LinkedAccountIds: !Ref LinkedAccountIds ComputationPreference: PricingPlanArn: !GetAtt TestPricingPlan.Arn TestFlatCustomLineItem: Type: 'AWS::BillingConductor::CustomLineItem' Properties: Name: 'TestFlatCustomLineItem' Description: 'Test flat custom line item created through Cloudformation for a $10 charge.' BillingGroupArn: !GetAtt TestBillingGroup.Arn CustomLineItemChargeDetails: Flat: ChargeValue: 10 Type: 'FEE' TestPercentageCustomLineItem: Type: 'AWS::BillingConductor::CustomLineItem' Properties: Name: 'TestPercentageCustomLineItem' Description: 'Test percentage custom line item created through Cloudformation for a %10 additional charge on the overall total bill of the billing group.' BillingGroupArn: !GetAtt TestBillingGroup.Arn CustomLineItemChargeDetails: Percentage: PercentageValue: 10 ChildAssociatedResources: - !GetAtt TestBillingGroup.Arn Type: 'FEE'