-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa3e24d
commit 69b22ae
Showing
7 changed files
with
98 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.