- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-17-2021 05:59 AM
Trying to Join 2 API: aws-ec2-describe-security-groups & aws-vpc-transit-gateway-attachment
1. List of Security Groups that allow everything:
config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-ec2-describe-security-groups' AND json.rule = isShared is false and (ipPermissions[?any((ipProtocol equals tcp or ipProtocol equals icmp or ipProtocol equals icmpv6 or ipProtocol equals udp) and (ipRanges[*] contains 0.0.0.0/0 or ipv6Ranges[*].cidrIpv6 contains ::/0))] exists) as X;
2. Extracting List of VPCs that dont have a particular Gateway AttachmentID:
config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-vpc-transit-gateway-attachment' AND json.rule = transitGatewayId does not contain "XXXXXXXXX" as Y;
final Join:
config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-ec2-describe-security-groups' AND json.rule = isShared is false and (ipPermissions[?any((ipProtocol equals tcp or ipProtocol equals icmp or ipProtocol equals icmpv6 or ipProtocol equals udp) and (ipRanges[*] contains 0.0.0.0/0 or ipv6Ranges[*].cidrIpv6 contains ::/0))] exists) as X; config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-vpc-transit-gateway-attachment' AND json.rule = transitGatewayId equals "XXXX" as Y; filter ' $.X.vpcId == $.Y.resourceId'; show X;
08-11-2022 10:47 AM
Greetings PKota1,
I hope that this note finds you well! I know that it has been a while since you had posted this question but I wanted to see if you still potentially needed any help. Thank you for your time and I hope that you have a good remainder of your day.
Kind Regards,
J. Avery King
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!