Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Created February 7, 2019 00:16
Show Gist options
  • Save allenmichael/afbddc354ecfd99ccf3c54bfd1b2a71b to your computer and use it in GitHub Desktop.
Save allenmichael/afbddc354ecfd99ccf3c54bfd1b2a71b to your computer and use it in GitHub Desktop.
Import-Module AWSLambdaPSCore
Import-Module AWSPowerShell.NetCore
$region = 'eu-west-2'
New-AWSPowerShellLambdaPackage -ScriptPath ./rek/DetectLabels.ps1 -OutputPackage DetectLabels.zip
Write-S3Object -BucketName amsxbg-dotnet-eu -File ./DetectLabels.zip
New-CFNStack -StackName DetectLabelsPS -Capabilities @("CAPABILITY_IAM","CAPABILITY_AUTO_EXPAND") -TemplateBody $(Get-Content ./serverless.template.json | Out-String) -Region $region
Wait-CFNStack -StackName DetectLabelPS
Get-CFNStack -StackName DetectLabelsPS -Region $region | Select-Object -ExpandProperty Outputs | Select-Object -Property @{Name='BucketName'; Expression={$_.OutputValue}} | Write-S3Object -File /Users/amsg/Documents/laser.jpg
Get-CFNStack -StackName DetectLabelsPS -Region $region | Select-Object -ExpandProperty Outputs | Select-Object -Property @{Name='BucketName'; Expression={$_.OutputValue}} | Get-S3ObjectTagSet -Key laser.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment