- Open VS Code
- Ctrl + Shift + P
- Type "user"
- Choose "Preferences: Open user Settings"
- Include following settings and restart
- Test Terminal by Ctrl + Shift +
(Command +)
| git config --global http.proxy http://myproxyserver:8080 |
| def lambda_handler(event, context): | |
| # Get Account Id from lambda function arn | |
| print "lambda arn: " + context.invoked_function_arn | |
| # Get Account ID from lambda function arn in the context | |
| ACCOUNT_ID = context.invoked_function_arn.split(":")[4] | |
| print "Account ID=" + ACCOUNT_ID | |
| # Get IAM Role name from Instance Profile Id | |
| curl http://169.254.169.254/latest/meta-data/iam/info | |
| # Get credentials | |
| curl http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name> | |
| # More info | |
| http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html | |
In this scenario we want to access predefined variable $Build.Reason from the PowerShell script. $Build.Reason will have different value based on what triggered the build.
Map $Build.Reason to env variable for the powershell script.
- powershell: |
.\scripts\git-package.ps1
Following will create service principal in Azure outputting auth creds in JSON format compatible with GitHub Actions. https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Cwindows
az ad sp create-for-rbac --name "myApp" --json-auth| # Works both with IDLE and PTVS for Visual Studio | |
| import os | |
| import boto3 | |
| os.environ['HTTPS_PROXY'] = '<proxyurl>:<port>' | |
| s3 = boto3.client('s3') | |
| s3.list_buckets() |
| Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -name Shell -Value 'PowerShell.exe -noExit' |
| "s3:DeleteReplicationConfiguration" | |
| does not work in bucket policies | |
| s3:GetObjectVersion | |
| means tha you will actually GET OBJECT = one of the object's version. |
| // requirements | |
| // aws cli has to be installed | |
| // working AWS credentials file ~/.aws/credentials | |
| // copy this file as tasks.json under the .vscode directory in your templates project directory | |
| // open your CloudFormation template and hit Ctrl + Shift + B | |
| { | |
| "version": "0.1.0", | |
| "command": "aws", | |
| "isShellCommand": true, |