This file contains hidden or 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
function Has-Instance | |
{ | |
$ssm_path = $Env:Programfiles + "\Amazon\SSM\sam-cli.exe" | |
if(Test-Path -Path $ssm_path -PathType Leaf) | |
{ | |
cd $Env:ProgramFiles\Amazon\SSM | |
$output = .\ssm-cli.exe get-instance-information | ConvertFrom-Json | |
if([bool] $output.psobject.properties.name -match "instance-id") | |
{ | |
$managed_instance_id = $output.psobject.properties["instance-id"].value |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
Registers this host with ssm agent | |
.DESCRIPTION | |
Downloads the agent, installs it, must be run as Administrator | |
#> | |
$JWT_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzZXJ2aWNlX2lkIjoiNGM5NjA1MmEtODVjMC00MDZlLWJjZmMtOGI0MWI3OWFiNWY3IiwiZG9tYWluIjoiMTIzNDExNyIsInNlcnZpY2VfdHlwZSI6Ik1BTkFHRURfVk1DIiwidG9rZW5faWQiOiI5OGViOWE0OC1hMjNjLTRiMjMtYWM4Mi1jOWRiNGMxMDFhZTQifQ.kX3aR8X_mO6uSjOMKygTDfNl9Xen0RvCOLHy5-zfpTWwPz7j1XjVPpE24SJztdW7RFdomLCbZ7CA9MFFrcNFv8gyFhlUpe926DIV9TGt1HcC-_KSLtm82PhK5hL8pSDhwj1esPi3xv-JROzgYgfdy_b2aTFdJk4wIxjog7xEIr09ijftfyWZSZglCN7JbmqDMglXJuS1j5fC4Ix9Ji2MUFl2Prb1KNtPLzLSsBYwPYaNi5kxKmFT5VhNJ_6V1p9-QG_vut7A-xFbi_psWJW2xPxzpe2U8sZziEFkZiLHwA1_Whd541f396xz-drJNVFyRa43iqGqGAvvO8B9L0VQDQ" | |
$error_codes = @{"UNABLE_TO_ACTIVATE"=1; "JOB_RETRIEVE_FAILURE"=2; "NO_JOB_FOUND"=3; "OS_UNSUPPORTED"=4;} |
This file contains hidden or 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
#!/usr/bin/env bash | |
request_cmd=$([[ -x "$(command -v curl)" ]] && echo "curl_request" || echo "wget_request") | |
download_cmd=$([[ -x "$(command -v curl)" ]] && echo "curl -sSO" || echo "wget -q") | |
#GOSS_ENDPOINT="https://api.goss.vdo.manage.rackspace.com/v1.0/instance/goss" | |
GOSS_ENDPOINT="https://chandra-goka.api.goss.dev.vdo.manage.rackspace.com/v1.0" | |
jwt_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJkb21haW4iOiIxMjM0MTE3Iiwic2VydmljZV90eXBlIjoiTUFOQUdFRF9WTUMiLCJzZXJ2aWNlX2lkIjoiNGM5NjA1MmEtODVjMC00MDZlLWJjZmMtOGI0MWI3OWFiNWY3IiwidG9rZW5faWQiOiI5NDg2N2JiZC00MWIzLTRiZjAtODYzYS1kNjIwMzlkMjYzZDkifQ.Apwr6nQpzglkUzOt3XXhH7y58nffszSCqeTQiGsJBcNrZnmqeqooc_JB3o-8AEwuIH0lD6TW7BN3FgttKW2eRrzK_mWwWe9Eue8swXrRupQBKaDVLGKTdK17NjWN-FzETlVQd0wCQreLWTRuPjXFf_QfeHK3v9M-P1tjO9n30fm_cDOKUi5ueJHYx61iX_XPFDD9-b2iOqRyydFnbol0hVBpoUA4jlK4sgLA7-pNnhWM5elPZO5N78MwkokfZjDkxRjw-29Zx4ia_GNZU-BWtkWsroFTlcn3CGc9VB5YXSqJM7fuerzEJEZiTx1VETBMGFzQCDntGOQpYp-kV8BFHQ | |
UNABLE_TO_ACTIVATE=1 |
NewerOlder