Blocker 48 · DevOps

Nobody knows what each team's contact center costs: tagging Amazon Connect for cost visibility

Cost visibility is an engineering task. Somebody has to decide the tags, put them in every flow and every resource, and switch them on in billing. Do that once, in code, and each team can see its own share of the bill.

24 hoursHow long cost allocation tags can take to activate in the AWS Billing console, so turn them on before you need the report.Source: AWS, Set up granular billing for Amazon Connect

Illustration. The blocker: Nobody knows what each team costs. The fix: Costs tagged by team and use.

The blocker

Three lines of business share one Amazon Connect instance. Each has its own phone numbers, queues and Lambda functions. At the end of the month the bill shows Amazon Connect as a total by usage type, with Lambda, S3 and Kinesis as separate totals. Finance splits it by headcount. The team that launched a new chat channel pays the same share as the team that cut its call volume in half. Nobody can tell whether a change saved money.

In our post on contact center costs we covered why pay-as-you-go pricing helps the business. This post is about the engineering work that makes each team’s share visible.

Why it happens

  • No tagging scheme. Nobody agreed which tag keys to use, so each team invents its own, or none.
  • Contacts are not tagged. By default, Amazon Connect channel usage is summarized at the account level, and the flows never add tags to contacts.
  • Resources are tagged by hand. Some Lambda functions and buckets have tags, others do not, and the spelling varies.
  • Tags are never activated. Tags exist on resources, but nobody switched them on in billing.

How Amazon Connect solves it

1. Tag every contact in the flow

By default, Amazon Connect channel usage is summarized at the account level. Granular billing changes that. Amazon Connect adds system-defined tags to each contact: aws:connect:instanceId and aws:connect:systemEndpoint (the phone number), plus aws:connect:transferredFromEndpoint for third-party transfers. You can add up to 6 user-defined tags per contact with the Contact tags block or the TagContact API.

A few rules shape the design:

  • Put the Contact tags block early in the first flow each contact enters. Amazon Connect applies user-defined tags to new contact segments for transfers and similar cases.
  • You can update tags with TagContact up to 3 hours after the contact disconnects, but those changes are not reflected in billing. The contact record gets the new value; the bill keeps the old one. Get the tag right in the flow.
  • Contact tags are for cost allocation only. You cannot filter contact search with them or use them for access control.
  • Do not put personal or sensitive data in tags.

Tags also appear in contact records and in the data lake contact record table, so you can join usage and contact data later.

2. Tag the resources around the instance

The contact center’s cost is more than Amazon Connect. The Lambda functions behind flows, the S3 buckets for recordings and the Kinesis streams for data are billed separately. Give them the same tag keys.

Amazon Connect resources can be tagged too: instances, queues, flows, phone numbers, routing profiles and more, with up to 50 tags per resource. Most support tagging on creation. Set tags in the same infrastructure code that creates each resource, so nothing goes live untagged. Tag Editor can find resources that have no tags, so you can fix the ones that were missed.

3. Keep tags consistent across accounts

Tag keys and values are case sensitive, so CostCenter and costcenter are two different tags in a report. Tag policies in AWS Organizations let you standardize tags across your accounts, including the case of keys and values. AWS’s tagging best practices whitepaper covers how to choose a scheme by team, purpose and environment.

4. Activate the tags and report on them

Tags do nothing for billing until you activate them. In the AWS Billing and Cost Management console, under Cost Allocation Tags, activate both the system-defined and user-defined tags. Activation can take up to 24 hours, so do it well before the first month you need to report.

Then group by tag in AWS Cost Explorer, which shows up to the last 13 months. For finance systems, AWS Cost and Usage Reports add tag columns, and you can include resource IDs for a line per contact. AWS warns that resource IDs can make the report files much larger.

5. Give each owner a budget and an alert

AWS Budgets tracks cost against a target and can alert on actual or forecasted spend, by email or Amazon SNS. AWS Cost Anomaly Detection can monitor specific cost allocation tags, so an unusual change in one team’s spend reaches that team.

What good looks like

Every contact carries a department tag from the first flow. Every Lambda function, bucket and stream carries the same keys, set in code. Each team lead opens Cost Explorer, filters by their tag and sees this month against last. A budget alert reaches them before the month ends. Finance allocates the bill from tags, not headcount.

Where to start

  1. Agree two or three tag keys with finance, such as Department and CostCenter, and write down allowed values.
  2. Add a Contact tags block to the first flow for each phone number.
  3. Add the same tags to every resource in your infrastructure code, and set a tag policy.
  4. Activate the cost allocation tags now, so the data is there when you need it.
  5. Create a Cost Explorer view and a budget for each owner, and review them monthly.
High-level architectureFrom tagged contacts to a cost per team
Amazon Connect
  • Contact tags block
  • System tags
  • Tagged resources
Surrounding AWS services
  • Lambda functions
  • S3 buckets
  • Kinesis streams
Governance
  • Tag policies
  • Infrastructure as code
AWS Billing
  • Cost allocation tags
  • Cost Explorer
  • Cost and Usage Reports
  • AWS Budgets
Owners
  • Team leads
  • Finance
  • Amazon Connect
  • AWS services
  • People
  1. A Contact tags block early in each flow adds user-defined tags, such as Department or CostCenter. Amazon Connect adds system tags for the instance and phone number.
  2. Lambda functions, buckets and streams around the instance carry the same tag keys, set in infrastructure as code.
  3. Tag policies in AWS Organizations keep tag keys and values consistent across accounts.
  4. Tags are activated as cost allocation tags, then grouped in Cost Explorer and exported in Cost and Usage Reports.
  5. AWS Budgets and Cost Anomaly Detection alert each owner when spend runs ahead of plan or changes unexpectedly.
References

Official AWS documentation

Every Amazon Connect capability in this post links to AWS’s own documentation, so you can check the details for your Region and account.

  1. Set up granular billing for a detailed view of your usagedocs.aws.amazon.com
  2. Flow block: Contact tagsdocs.aws.amazon.com
  3. Add tags to resources in Amazon Connectdocs.aws.amazon.com
  4. Organizing and tracking costs using AWS cost allocation tagsdocs.aws.amazon.com
  5. Tag policies (AWS Organizations)docs.aws.amazon.com
  6. Finding resources to tag (Tag Editor)docs.aws.amazon.com
  7. Best Practices for Tagging AWS Resourcesdocs.aws.amazon.com
  8. Analyzing your costs and usage with AWS Cost Explorerdocs.aws.amazon.com
  9. Managing your costs with AWS Budgetsdocs.aws.amazon.com
  10. Detecting unusual spend with AWS Cost Anomaly Detectiondocs.aws.amazon.com
Start here

Tell us what you want to improve.

We will tell you whether a voice agent fits it, what it would take, and what it should return. You will hear back within a week.

  • AWS Advanced Tier Services Partner
  • AWS Migration Services Competency
  • Amazon Connect Delivery Partner
  • AWS AI Services Competency
  • AWS Experience-Based Acceleration (EBA) partner
  • ISO/IEC 27001 certified
  • SOC 2 Type II
Certified supplierMWDBE certifiedTexas HUB certifiedNCTRCA certified
+1 (214) 550-14936275 West Plano Parkway, Suite 500, Plano, Texas 75093