Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Last active November 6, 2018 00:49
Show Gist options
  • Save chewmanfoo/a6677743d8b7d8075af5d82537b4133d to your computer and use it in GitHub Desktop.
Save chewmanfoo/a6677743d8b7d8075af5d82537b4133d to your computer and use it in GitHub Desktop.
$ aws cloudformation list-stack-resources --stack-name $stack_name --query "StackResourceSummaries[][?ResourceType=='AWS::EC2::Instance'][]" --region $reg --profile $acct
[]
$ aws cloudformation list-stack-resources --stack-name $stack_name --query "StackResourceSummaries[][?ResourceType=='AWS::EC2::Instance'][*]" --region $reg --profile $acct
[]
$ aws cloudformation list-stack-resources --stack-name $stack_name --query 'StackResourceSummaries[*][?contains(ResourceType,`Instance`) == true].[ResourceType,ResourceStatus,LogicalResourceId]' --region $reg --profile $acct
[]
$ aws cloudformation list-stack-resources --stack-name $stack_name --region $reg --profile $acct
{
"StackResourceSummaries": [
{
"ResourceType": "AWS::EC2::Instance",
"PhysicalResourceId": "i-0fed57248f4f716b3",
"LastUpdatedTimestamp": "2018-10-29T21:56:43.420Z",
"ResourceStatus": "CREATE_COMPLETE",
"LogicalResourceId": "ADDC01"
},
{
"ResourceType": "AWS::CloudWatch::Alarm",
"PhysicalResourceId": "cf-teo-active-directory-ADDC01CPUAlarm-XRX2LLZSIV6H",
"LastUpdatedTimestamp": "2018-10-29T21:57:03.651Z",
"ResourceStatus": "CREATE_COMPLETE",
"LogicalResourceId": "ADDC01CPUAlarm"
},
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment