Closed btgann closed 11 months ago
@btgann Good afternoon. Thanks for reporting the issue. Could you please share the below information:
Phone number ARN could be retrieved using AWS CLI command aws connect list-phone-numbers --instance-id <<instance-id>> --region us-east-1
.
I was unable to use Copy-CONNInstance
to configure replica for global resilience and create traffic distribution group, due to some account limitations. Per the API documentation AssociatePhoneNumberContactFlow, If the number is claimed to a traffic distribution group, and you are calling this API using an instance in the AWS Region where the traffic distribution group was created, you can use either a full phone number ARN or UUID value for the PhoneNumberId URI request parameter.
.
So I tried executing below without creating traffice distribution group (as required by API to use full phone number ARN):
Add-CONNPhoneNumberContactFlow -InstanceId <<instance-id>> -ContactFlowId <<contact-flow-id>> -PhoneNumberId arn:aws:connect:us-east-1:<<account-id>>:instance/<<instance-id>>/phone-number/<<phone-number-id>> -Region us-east-1
, it gave the error Add-CONNPhoneNumberContactFlow: Invalid request parameter: PhoneNumberId
aws connect associate-phone-number-contact-flow --instance-id <<instance-id>> --contact-flow-id <<contact-flow-id>> --phone-number-id arn:aws:connect:us-east-1:<<account-id>>:instance/<<instance-id>>/phone-number/<<phone-number-id>> --region us-east-1 --debug
(notice the --debug
flag to generate verbose output), it also failed with below logs:
...
...
2023-07-19 14:17:20,359 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=AssociatePhoneNumberContactFlow) with params: {'url_path': '/phone-number/arn%3Aaws%3Aconnect%3Aus-east-1%3A<<REDACTED>>%3Ainstance%2F<<REDACTED>>%2Fphone-number%2F<<REDACTED>>/contact-flow', 'query_string': {}, 'method': 'PUT', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'aws-cli/2.11.20 Python/3.11.3 Darwin/22.5.0 exe/x86_64 prompt/off command/connect.associate-phone-number-contact-flow'}, 'body': b'{"InstanceId": "<<REDACTED>>", "ContactFlowId": "<<REDACTED>>"}', 'url': 'https://connect.us-east-1.amazonaws.com/phone-number/arn%3Aaws%3Aconnect%3Aus-east-1%3A<<REDACTED>>%3Ainstance%2F<<REDACTED>>%2Fphone-number%2F<<RDACTED>>/contact-flow', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x1114d3350>, 'has_streaming_input': False, 'auth_type': None}}
...
PUT
/phone-number/arn%253Aaws%253Aconnect%253Aus-east-1%253A<<REDACTED>>%253Ainstance%252F<<REDACTED>>%252Fphone-number%252F<<REDACTED>>/contact-flow
content-type:application/json
host:connect.us-east-1.amazonaws.com
x-amz-date:20230719T211720Z
x-amz-security-token:<
content-type;host;x-amz-date;x-amz-security-token
<
An error occurred (InvalidParameterException) when calling the AssociatePhoneNumberContactFlow operation: Invalid request parameter: PhoneNumberId
So AWS CLI also appears to escape the phone number ARN. Hence, I was just curious if the corresponding AWS CLI command works for you, or, fails with the same error as PowerShell CmdLet. It would also be helpful if you could execute the AWS CLI command with `--debug` option to see what is happening behind the scenes.
When I simply use the `PhoneNumberId` (not the full ARN), `Add-CONNPhoneNumberContactFlow` appears to work fine.
Thanks,
Ashish
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
When running the following command the ARN is not processed properly. The "/" is replaced with "%2F"
Add-CONNPhoneNumberContactFlow -PhoneNumberId "arn:aws:connect:us-west-2:111111111111:instance/2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f/phone-number/fb033ec3-57f4-419e-a4e1-43f4c77420f3" -ContactFlowId "d43590ee-f461-48b8-bd79-6a5269806e90" -InstanceId "2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f"
From the API documentation If the number is claimed to a traffic distribution group, and you are calling this API using an instance in the AWS Region where the traffic distribution group was created, you can use either a full phone number ARN or UUID value for the PhoneNumberId URI request parameter. However, if the number is claimed to a traffic distribution group and you are calling this API using an instance in the alternate AWS Region associated with the traffic distribution group, you must provide a full phone number ARN. If a UUID is provided in this scenario, you will receive a ResourceNotFoundException.
Expected Behavior
The arn should be passed to the API with the correct forward slash.
Current Behavior
The command fails and in cloudwatch the input parameters are: "requestParameters": { "ContactFlowId": "d43590ee-f461-48b8-bd79-6a5269806e90", "InstanceId": "2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f", "PhoneNumberId": "arn:aws:connect:us-west-2:619986601134:instance%2F2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f%2Fphone-number%2Ffb033ec3-57f4-419e-a4e1-43f4c77420f3" }
The forward slashes in the ARN are replaced with %2F
Reproduction Steps
Amazon Connect Global Resiliency is required to be enabled in the AWS Account Create Amazon Connect Instance in US-EAST-1 Create a replica instance in US-WEST-2 Create a traffic distribution group Assign a phone number to the traffic distribution group Use the command
Add-CONNPhoneNumberContactFlow -PhoneNumberId "arn:aws:connect:us-west-2:111111111111:instance/2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f/phone-number/fb033ec3-57f4-419e-a4e1-43f4c77420f3" -ContactFlowId "d43590ee-f461-48b8-bd79-6a5269806e90" -InstanceId "2efd0b3b-3eb4-4fd6-bf18-cc3590a7c70f"
To assign the phone number to a contact flow in the replica instance. PhoneNumberId = arn of the phone number assigned to the traffic distribution group in US-West-2 instance ContactFlowId = valid contact flow id in US-West-2 instance InstanceId = US-West-2 instance IDPossible Solution
No response
Additional Information/Context
AWS.Tools.S3 4.1.54
AWS Tools for PowerShell version used
AWS.Tools.S3 4.1.371
PowerShell version used
Name Value
PSVersion 5.1.19041.3031 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.3031 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
Operating System and version
Linux