AWS Contact Center

Create a holiday calendar in Amazon Connect

During the holidays, different customer service mechanisms are deployed by contact centers based on their business needs. Some might want to extend their hours of operation due to influx of calls, while others might want to offer decreased or no hours of operation due to limited staffing. In either scenario, offering a flexible and easy way for contact center managers to update the self-service logic or hours, without impacting production users is key.

One of the benefits of Amazon Connect is the agility that it offers to customers in order to make changes in real time and minimize the effect these changes have on the contact center. By implementing a holiday calendar, contact centers can be inform customers of new working hours or self-service logic or simply make different announcements during pre-defined times of the year.

In this blog post, we will leverage AWS CloudFormation, AWS Lambda and Amazon DynamoDB to create a holiday calendar functionality within Amazon Connect. This will allow call center managers to update their Amazon Connect contact flow with minimal disruption.

Overview of solution

Architecture for checking holiday



In the preceding architecture, the customer calls into the contact center. Amazon Connect checks the date via an AWS Lambda operation. The Lambda function then queries the ‘Holidays Table’ in Amazon DynamoDB and determines if the date matches any of the day in the holiday list . If there is a match, the Lambda function will pass the following variables with their relevant value back to the Amazon Connect contact flow:-

  • publicHoliday (either set to true or false)
  • holidayName (to be the name of the holiday if set)



For this walkthrough, you should have the following prerequisites:

Create AWS Lambda function using AWS CloudFormation

AWS CloudFormation will be used programmatically create the necessary Identity and Access Management (IAM) Roles, an Amazon DynamoDB Table called ‘Holidays’ as well as an AWS Lambda function (readholiday) which is used to check the date against the Holidays DynamoDB Table to ensure validation.

  1. Log in to your AWS Management Console.
  2. Confirm that the AWS Region selected has the Amazon Connect service available.
  3. Click on the button below “Launch Stack” to create a stack called ‘Holiday’.

  1. On the AWS CloudFormation page, modify the stack name if you prefer a different one.
  2. Following security best practices, change the Connect Instance Id to be your Amazon Connect Instance Id. However if this CloudFormation stack is to be deployed in several Amazon Connect instances set this value to *.
  3. The table name (TableName) is also a parameter that can be customized.
  4. If the table name is changed, the text in this document referencing the Holidays table also needs to be changed to match it.
  5. The Date Format drop-down list provides a list of supported date formats for the readHoliday Lambda.
  6. The Time Zone parameter is expecting an IANA Time Zone.
  7. To find the Instance Id of your Connect instance go to Overview.
  8. Under Overview there is an Instance ARN, copy the 36 digits after instance/.

  1. Click the Create stack button after selecting all three checkboxes.


Granting Amazon Connect permission to execute the AWS Lambda function

To grant the Amazon Connect instance permission to invoke the AWS Lambda functions previously created follow the steps below. For additional information, see the Amazon Connect Administrator guide.

  1. In the Amazon Connect console, choose Contact flows and scroll to the bottom of the page in the AWS Lambda section.
  2. On the Function drop-down menu, select the readholiday function and click on +Add AWS Lambda Function, as shown in the following screenshot:


Import and Configure the Amazon Connect Contact Flow

  1. Download the contact flow called Holiday.
  2. Log in to your Amazon Connect Console.
  3. On the left side of the Amazon Connect console, select Routing -> Contact flows
  4. Click the Create contact flow button at the top-right
  5. Click the drop-down at the top-right and select Import Flow
  6. Click the Select button and select the downloaded Holiday file from step 1 above.
  7. Click on the header for the first “Invoke AWS Lambda function” and select the Holiday AWS Lambda function from the dropdown list or enter the ARN for the AWS Lambda function.

  1. Save and Publish your contact flow.

Update the Holidays Table in DynamoDB

You can also upload your own data directly to the DynamoDB table using a bulk upload mechanism as found in this AWS Database Blog.

Alternatively, if you wish to edit the data directly in DynamoDB use the following steps:

  1. Open DynamoDB in the same Region of the CloudFormation Template.
  2. Select Tables from the left side navigation menu.
  3. Select the Holidays Table.
  4. Select the Items tab.
  5. Select the Create Item button.
  6. Enter a value for the next holiday for the FullDate item. It should be in the format the you selected during the stack deployment, by default is DDMMYYYY (no slash or tack marks between)
  7. Optionally to add a holiday name such as Christmas, click on the + symbol, select Append, select String:

  1. Make the field HolidayName and give it a value and save:

Testing the solution

In the Amazon Connect console on the left-hand side choose Routing > Phone Numbers.

Click on the phone number: Under Contact flow / IVR select Holiday and Save.

In DynamoDB select the Holiday table click Create Item button.

Enter today’s date in the format you chose when you deployed the template.

Optionally enter a name for your holiday.

Save the entry.

Using the previously mentioned phone number call into the Contact Flow to check if you hear the Holiday Greeting.


In this blog post, we implemented a solution that provides a quick solution to offer holiday hours in an Amazon Connect contact flow. This solution provided the following features:

  • An inbound Amazon Connect contact flow for checking holidays
  • A Lambda function that performs a data dip into a DynamoDB table
  • A DynamoDB table that can be modified to add as many holidays as needed

This was a basic demonstration to show how to create entries for holidays. You can enhance the solution by adding different scenarios as needed based on your company requirements.