Created
December 13, 2017 14:41
-
-
Save lalyos/f5a04b00581dc5b4101a1175bc5a2897 to your computer and use it in GitHub Desktop.
aws graphQL examples
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
| query instances($AWS_DEFAULT_REGION: String, $AWS_ACCESS_KEY_ID: String, $AWS_SECRET_ACCESS_KEY: String) { | |
| aws(config: {accessKeyId: $AWS_ACCESS_KEY_ID, secretAccessKey: $AWS_SECRET_ACCESS_KEY, region: $AWS_DEFAULT_REGION}) { | |
| ec2 { | |
| describeInstances { | |
| Reservations { | |
| Instances { | |
| InstanceId | |
| PublicIpAddress | |
| VpcId | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
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
| query vpcrelations($vpc_id:String, $AWS_DEFAULT_REGION: String, $AWS_ACCESS_KEY_ID: String, $AWS_SECRET_ACCESS_KEY: String) { | |
| aws(config: {accessKeyId: $AWS_ACCESS_KEY_ID, secretAccessKey: $AWS_SECRET_ACCESS_KEY, region: $AWS_DEFAULT_REGION}) { | |
| ec2 { | |
| describeInstances( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}) { | |
| Reservations { | |
| Instances { | |
| InstanceId | |
| PublicIpAddress | |
| VpcId | |
| } | |
| } | |
| } | |
| describeVpcs( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}){ | |
| Vpcs{ | |
| VpcId | |
| IsDefault | |
| DhcpOptionsId | |
| } | |
| } | |
| describeSubnets( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}) { | |
| Subnets{ | |
| VpcId | |
| SubnetId | |
| Tags{ | |
| Key | |
| Value | |
| } | |
| } | |
| } | |
| describeRouteTables( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}){ | |
| RouteTables{ | |
| RouteTableId | |
| VpcId | |
| } | |
| } | |
| describeInternetGateways( input: {Filters:{Name:"attachment.vpc-id",Values:[$vpc_id]}}){ | |
| InternetGateways{ | |
| InternetGatewayId | |
| Attachments{ | |
| VpcId | |
| } | |
| } | |
| } | |
| describeNetworkAcls( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}){ | |
| NetworkAcls{ | |
| NetworkAclId | |
| } | |
| } | |
| describeNetworkInterfaces( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}){ | |
| NetworkInterfaces{ | |
| NetworkInterfaceId | |
| } | |
| } | |
| describeSecurityGroups( input: {Filters:{Name:"vpc-id",Values:[$vpc_id]}}){ | |
| SecurityGroups{ | |
| GroupId | |
| } | |
| } | |
| describeVpnGateways( input: {Filters:{Name:"attachment.vpc-id",Values:[$vpc_id]}}){ | |
| VpnGateways{ | |
| VpnGatewayId | |
| VpcAttachments{ | |
| VpcId | |
| State | |
| } | |
| } | |
| } | |
| describeVpcPeeringConnections{ | |
| VpcPeeringConnections{ | |
| VpcPeeringConnectionId | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment