Skip to content

Commit

Permalink
Release 1.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
davelemons committed Mar 30, 2023
1 parent fa3e24d commit 69b22ae
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 37 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.5.4] - 2023-03-30
### Added
- [powershell/Search-ContactFlows/] Downloads and searches Amazon Connect contact flows for a specified String
### Changed
- [go/go.mod] Dependency Updates
## [1.5.3] - 2023-01-25
### Changed
- [javascript/programmatically-create-task-example] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html)
## [1.5.2] - 2023-01-25
### Changed
- [tools/CCPLogParser] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html)
## [1.5.3] - 2023-01-25
### Changed
- [javascript/programmatically-create-task-example] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html)
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/amazon-connect/amazon-connect-samples/amazon-connect-snippets/

go 1.14

require github.com/aws/aws-sdk-go v1.30.9
require github.com/aws/aws-sdk-go v1.34.0
13 changes: 10 additions & 3 deletions go/go.sum
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
github.com/aws/aws-sdk-go v1.30.9 h1:DntpBUKkchINPDbhEzDRin1eEn1TG9TZFlzWPf0i8to=
github.com/aws/aws-sdk-go v1.30.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.34.0 h1:brux2dRrlwCF5JhTL7MUT3WUwo9zfDHZZp3+g3Mvlmo=
github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Binary file added powershell/Search-ContactFlows/Screen_Shot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions powershell/Search-ContactFlows/Search-ContactFlows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# created by rpittfie@amazon.com on 12/15/2022:
# Download and search all contact flows for a specific string.
#
# Examples:
#
# ./Search-ContactFlows -SearchString "Lambda"
# Prompts you for which instance to download flows from and search the content of the downloaded contact flows for the string "Lambda"
#
# ./Search-ContactFlows -SearchString "Lambda" -DownloadFlows $false
# Search any already downloaded contact flows for the string "Lambda"

Param(
[Parameter(Mandatory=$true)]
[string] $SearchString,
[boolean] $DownloadFlows = $true
)

Write-Host "Importing AWS.Tools.Common. hang on a sec..."
Import-Module AWS.Tools.Common
Write-Host "Importing AWS.Tools.Connect. hang on a sec..."
Import-Module AWS.Tools.Connect

if ($downloadFlows -eq $true) {

if (!(Test-Path .\flows)) {
mkdir flows
}
Write-Host `n
Write-Host "Collecting a list of instances for the current region:"
Write-Host `n
$instances = Get-ConnInstanceList
for ($i = 0; $i -lt $instances.length; $i++) {
Write-Host $i $instances[$i].InstanceAlias
}
Write-Host `n
$instanceValue = Read-Host "Enter the number of the instance you'd like to collect contact flows for"
Write-Host `n
$instanceId = $instances[$instanceValue].Id

#Write-Host $instanceId

$flowList = Get-ConnContactFlowList -InstanceId $instanceId

Write-Host "Downloading flows: "
Write-Host `n
foreach ($flow in $flowList) {
$flowDetails = Get-ConnContactFlow -InstanceId $instanceId -ContactFlowId $flow.Id -ErrorAction SilentlyContinue
$fileName = $flow.Name
$flowDetails.Content | Out-File .\flows\$fileName
Write-Host $flow.Name
}
}

Write-Host `n
Write-Host "Searching contact flows for: $SearchString"
Get-ChildItem .\flows\* | select-string $SearchString | Select-Object Filename -Unique
20 changes: 20 additions & 0 deletions powershell/Search-ContactFlows/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Downloads and searches Amazon Connect contact flows for a specified String.

CloudShell instructions:

1. Copy the script to CloudShell.
2. type in pwsh to start PowerShell
3. run the script: ./Search-ContactFlows.ps1 -SearchString "value"

Screenshot below shows sample usage in CloudShell:

![Screen_Shot](./Screen_Shot.png)

Cloud9 instructions:

1. Install PowerShell using the instructions here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.3
2. run PowerShell by typing pwsh on the shell and hitting enter.
3. Type in Install-Module AWS.Tools.Common and wait for that to complete.
4. Type in Install-Module AWS.Tools.Connect and wait for that to complete.
5. Save the contents of this file to your Cloud9 folder
6. run the script: ./Search-ContactFlows.ps1 -SearchString "value"
33 changes: 0 additions & 33 deletions tools/CCPLogParser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69b22ae

Please sign in to comment.