amazon-connect / amazon-connect-salesforce-scv

This repository contains resources, examples, and projects to help Service Cloud Voice customers address some common requirements as they deploy Service Cloud Voice.
Apache License 2.0
52 stars 54 forks source link

Voicemail Express Email - Url not working in eu-central-1 region #172

Open bnirwan opened 6 months ago

bnirwan commented 6 months ago

Got the SES email for the voicemail. When i click listen to voicemail it gives error -

SignatureDoesNotMatch The request signature we calculated does not match the signature you provided. Check your key and signing method. Can you please check ? I am using the template version - 2024.02.28
bnirwan commented 6 months ago

I debugged the presigned function. The url generated is giving the same error. So looks like presigner function has some error which is causing this.

Appreciate if you take a look. Thanks

dougjaso commented 6 months ago

Make the following change:

In the presigner code, find:

    try:
        my_config = Config(
            region_name = os.environ['aws_region'],
            signature_version = 's3v4',
            retries = {
                'max_attempts': 10,
                'mode': 'standard'
            }
        )

        client = boto3.client(
            's3',
            aws_access_key_id = use_keys['vmx_iam_key_id'],
            aws_secret_access_key = use_keys['vmx_iam_key_secret'],
            config=my_config
        )

and change to:

    try:

        use_region = os.environ['aws_region']

        my_config = Config(
            region_name = use_region,
            signature_version = 's3v4',
            retries = {
                'max_attempts': 10,
                'mode': 'standard'
            }
        )

        client = boto3.client(
            's3',
            endpoint_url = 'https://s3.' + use_region + '.amazonaws.com',
            aws_access_key_id = use_keys['vmx_iam_key_id'],
            aws_secret_access_key = use_keys['vmx_iam_key_secret'],
            config=my_config
        )

That should correct the problem.

bnirwan commented 6 months ago

Thank you. Its working now. Is the issue already fixed in new template which we can use or this is manual step required always?

Or its needed only for eu-central-1 region.

Thanks for helping us out. Appreciate it.