zaws 0.0.5 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +9 -18
- data/Gemfile +0 -0
- data/Gemfile.lock +26 -35
- data/Gemfile.lock.linux +69 -0
- data/Gemfile.lock.mac +81 -0
- data/Gemfile.lock.windows +77 -0
- data/LICENSE +0 -0
- data/README.md +11 -0
- data/Rakefile +1 -7
- data/archive/cloud_trail/cloud_trail.feature +124 -0
- data/bin/win_zaws.bat +2 -0
- data/lib/zaws.rb +54 -41
- data/lib/zaws/command/ai.rb +34 -0
- data/lib/zaws/command/bucket.rb +35 -0
- data/lib/zaws/command/cloud_trail.rb +43 -0
- data/lib/zaws/command/compute.rb +152 -87
- data/lib/zaws/command/config.rb +42 -0
- data/lib/zaws/command/elasticip.rb +19 -9
- data/lib/zaws/command/hosted_zone.rb +31 -18
- data/lib/zaws/command/iam.rb +37 -0
- data/lib/zaws/command/load_balancer.rb +54 -51
- data/lib/zaws/command/nessus.rb +41 -0
- data/lib/zaws/command/newrelic.rb +30 -0
- data/lib/zaws/command/route_table.rb +135 -122
- data/lib/zaws/command/security_group.rb +95 -82
- data/lib/zaws/command/subnet.rb +58 -46
- data/lib/zaws/command/sumo.rb +34 -0
- data/lib/zaws/command/vpc.rb +53 -0
- data/lib/zaws/external/awscli/awscli.rb +65 -0
- data/lib/zaws/external/awscli/commands.rb +10 -0
- data/lib/zaws/external/awscli/commands/aws.rb +40 -0
- data/lib/zaws/external/awscli/commands/ec2.rb +74 -0
- data/lib/zaws/external/awscli/commands/ec2/allocate_address.rb +42 -0
- data/lib/zaws/external/awscli/commands/ec2/assign_private_ip_addresses.rb +49 -0
- data/lib/zaws/external/awscli/commands/ec2/associate_address.rb +48 -0
- data/lib/zaws/external/awscli/commands/ec2/associate_route_table.rb +48 -0
- data/lib/zaws/external/awscli/commands/ec2/authorize_security_group_ingress.rb +70 -0
- data/lib/zaws/external/awscli/commands/ec2/create_route.rb +60 -0
- data/lib/zaws/external/awscli/commands/ec2/create_route_table.rb +40 -0
- data/lib/zaws/external/awscli/commands/ec2/create_security_group.rb +58 -0
- data/lib/zaws/external/awscli/commands/ec2/create_subnet.rb +62 -0
- data/lib/zaws/external/awscli/commands/ec2/create_tags.rb +53 -0
- data/lib/zaws/external/awscli/commands/ec2/create_vpc.rb +21 -0
- data/lib/zaws/external/awscli/commands/ec2/delete_route.rb +54 -0
- data/lib/zaws/external/awscli/commands/ec2/delete_route_table.rb +46 -0
- data/lib/zaws/external/awscli/commands/ec2/delete_security_group.rb +46 -0
- data/lib/zaws/external/awscli/commands/ec2/delete_subnet.rb +46 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_addresses.rb +41 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_images.rb +58 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_instances.rb +56 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_route_tables.rb +44 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_security_groups.rb +50 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_subnets.rb +48 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_vpc_peering_connections.rb +23 -0
- data/lib/zaws/external/awscli/commands/ec2/describe_vpcs.rb +26 -0
- data/lib/zaws/external/awscli/commands/ec2/disable_vgw_route_propagation.rb +48 -0
- data/lib/zaws/external/awscli/commands/ec2/disassociate-address.rb +42 -0
- data/lib/zaws/external/awscli/commands/ec2/disassociate_route_table.rb +41 -0
- data/lib/zaws/external/awscli/commands/ec2/enable_vgw_route_propagation.rb +48 -0
- data/lib/zaws/external/awscli/commands/ec2/filter.rb +115 -0
- data/lib/zaws/external/awscli/commands/ec2/modify_instance_attribute.rb +62 -0
- data/lib/zaws/external/awscli/commands/ec2/network_interfaces.rb +63 -0
- data/lib/zaws/external/awscli/commands/ec2/release_address.rb +42 -0
- data/lib/zaws/external/awscli/commands/ec2/revoke_security_group_ingress.rb +70 -0
- data/lib/zaws/external/awscli/commands/ec2/run_instances.rb +21 -0
- data/lib/zaws/external/awscli/commands/ec2/stop_instances.rb +21 -0
- data/lib/zaws/external/awscli/commands/ec2/terminate_instances.rb +40 -0
- data/lib/zaws/external/awscli/commands/ec2/unassign_private_ip_addresses.rb +49 -0
- data/lib/zaws/external/awscli/commands/elb.rb +19 -0
- data/lib/zaws/external/awscli/commands/elb/create_load_balancer.rb +64 -0
- data/lib/zaws/external/awscli/commands/elb/create_load_balancer_listeners.rb +47 -0
- data/lib/zaws/external/awscli/commands/elb/delete_load_balancer.rb +40 -0
- data/lib/zaws/external/awscli/commands/elb/delete_load_balancer_listeners.rb +49 -0
- data/lib/zaws/external/awscli/commands/elb/deregister_instances_with_load_balancer.rb +49 -0
- data/lib/zaws/external/awscli/commands/elb/describe_load_balancers.rb +30 -0
- data/lib/zaws/external/awscli/commands/elb/register_instances_with_load_balancer.rb +49 -0
- data/lib/zaws/external/awscli/commands/iam.rb +31 -0
- data/lib/zaws/external/awscli/commands/iam/GetPolicy.rb +21 -0
- data/lib/zaws/external/awscli/commands/iam/GetPolicyVersion.rb +21 -0
- data/lib/zaws/external/awscli/commands/iam/GetRolePolicy.rb +21 -0
- data/lib/zaws/external/awscli/commands/route53.rb +19 -0
- data/lib/zaws/external/awscli/commands/route53/list_hosted_zones.rb +30 -0
- data/lib/zaws/external/awscli/commands/route53/list_resource_record_sets.rb +41 -0
- data/lib/zaws/external/awscli/commands/s3/ls.rb +34 -0
- data/lib/zaws/external/awscli/commands/s3/mb.rb +41 -0
- data/lib/zaws/external/awscli/commands/s3/sync.rb +48 -0
- data/lib/zaws/external/awscli/credentials.rb +22 -0
- data/lib/zaws/external/awscli/data.rb +10 -0
- data/lib/zaws/external/awscli/data/ec2.rb +33 -0
- data/lib/zaws/external/awscli/data/ec2/instance.rb +162 -0
- data/lib/zaws/external/awscli/data/ec2/security_group.rb +51 -0
- data/lib/zaws/external/awscli/data/ec2/subnet.rb +59 -0
- data/lib/zaws/external/awscli/data/ec2/vpc.rb +85 -0
- data/lib/zaws/external/awscli/data/iam.rb +34 -0
- data/lib/zaws/external/awscli/data/iam/policy.rb +42 -0
- data/lib/zaws/external/awscli/data/iam/policy_document.rb +52 -0
- data/lib/zaws/external/awscli/data/iam/policy_version.rb +42 -0
- data/lib/zaws/external/awscli/data/iam/role_policy.rb +52 -0
- data/lib/zaws/external/awscli/generators/result/ec2/addresses.rb +70 -0
- data/lib/zaws/external/awscli/generators/result/ec2/allocation_id.rb +39 -0
- data/lib/zaws/external/awscli/generators/result/ec2/association_id.rb +29 -0
- data/lib/zaws/external/awscli/generators/result/ec2/images.rb +46 -0
- data/lib/zaws/external/awscli/generators/result/ec2/instances.rb +57 -0
- data/lib/zaws/external/awscli/generators/result/ec2/ip_permissions.rb +70 -0
- data/lib/zaws/external/awscli/generators/result/ec2/network_interfaces.rb +53 -0
- data/lib/zaws/external/awscli/generators/result/ec2/private_ip_addresses.rb +41 -0
- data/lib/zaws/external/awscli/generators/result/ec2/route_tables.rb +80 -0
- data/lib/zaws/external/awscli/generators/result/ec2/routes.rb +58 -0
- data/lib/zaws/external/awscli/generators/result/ec2/security_groups.rb +73 -0
- data/lib/zaws/external/awscli/generators/result/ec2/subnets.rb +88 -0
- data/lib/zaws/external/awscli/generators/result/ec2/tags.rb +34 -0
- data/lib/zaws/external/awscli/generators/result/ec2/virtual_gateway.rb +32 -0
- data/lib/zaws/external/awscli/generators/result/elb/listeners.rb +65 -0
- data/lib/zaws/external/awscli/generators/result/elb/load_balancers.rb +61 -0
- data/lib/zaws/external/awscli/generators/result/route53/hosted_zones.rb +52 -0
- data/lib/zaws/external/awscli/regions.rb +13 -0
- data/lib/zaws/external/nessusapi/data/agents.rb +36 -0
- data/lib/zaws/external/nessusapi/data/scanners.rb +35 -0
- data/lib/zaws/external/nessusapi/nessusapi.rb +57 -0
- data/lib/zaws/external/nessusapi/reources.rb +10 -0
- data/lib/zaws/external/nessusapi/resources/agents.rb +18 -0
- data/lib/zaws/external/nessusapi/resources/agents/list.rb +20 -0
- data/lib/zaws/external/nessusapi/resources/scanners.rb +18 -0
- data/lib/zaws/external/nessusapi/resources/scanners/list.rb +20 -0
- data/lib/zaws/external/newrelicapi/data/servers.rb +36 -0
- data/lib/zaws/external/newrelicapi/newrelic_client.rb +64 -0
- data/lib/zaws/external/newrelicapi/newrelic_creds.rb +60 -0
- data/lib/zaws/external/newrelicapi/newrelicapi.rb +46 -0
- data/lib/zaws/external/newrelicapi/resources/servers.rb +18 -0
- data/lib/zaws/external/newrelicapi/resources/servers/list.rb +20 -0
- data/lib/zaws/external/sumoapi/data/collectors.rb +35 -0
- data/lib/zaws/external/sumoapi/data/sources.rb +35 -0
- data/lib/zaws/external/sumoapi/resources/collectors.rb +18 -0
- data/lib/zaws/external/sumoapi/resources/collectors/list.rb +20 -0
- data/lib/zaws/external/sumoapi/resources/sources.rb +18 -0
- data/lib/zaws/external/sumoapi/resources/sources/list.rb +20 -0
- data/lib/zaws/external/sumoapi/sumo_client.rb +63 -0
- data/lib/zaws/external/sumoapi/sumo_creds.rb +67 -0
- data/lib/zaws/external/sumoapi/sumoapi.rb +56 -0
- data/lib/zaws/helper/data_lattice.rb +22 -0
- data/lib/zaws/helper/filestore.rb +48 -0
- data/lib/zaws/helper/filter.rb +15 -0
- data/lib/zaws/helper/inifile.rb +632 -0
- data/lib/zaws/helper/nessus_client.rb +143 -0
- data/lib/zaws/helper/nessus_creds.rb +67 -0
- data/lib/zaws/helper/option.rb +14 -15
- data/lib/zaws/helper/output.rb +81 -29
- data/lib/zaws/helper/process_hash.rb +47 -0
- data/lib/zaws/helper/shell.rb +0 -0
- data/lib/zaws/helper/verbose.rb +15 -0
- data/lib/zaws/helper/zfile.rb +8 -8
- data/lib/zaws/services/ai.rb +35 -0
- data/lib/zaws/services/ai/query.rb +135 -0
- data/lib/zaws/services/aws.rb +41 -0
- data/lib/zaws/services/chef.rb +0 -0
- data/lib/zaws/services/cloud_trail.rb +76 -0
- data/lib/zaws/services/config.rb +31 -0
- data/lib/zaws/services/ec2.rb +47 -0
- data/lib/zaws/services/ec2/compute.rb +352 -0
- data/lib/zaws/services/ec2/elasticip.rb +82 -0
- data/lib/zaws/services/ec2/route_table.rb +210 -0
- data/lib/zaws/services/ec2/security_group.rb +186 -0
- data/lib/zaws/services/ec2/subnet.rb +111 -0
- data/lib/zaws/services/ec2/vpc.rb +69 -0
- data/lib/zaws/{elb.rb → services/elb.rb} +3 -2
- data/lib/zaws/services/elb/load_balancer.rb +160 -0
- data/lib/zaws/services/iam.rb +25 -0
- data/lib/zaws/services/iam/policy.rb +25 -0
- data/lib/zaws/services/iam/role.rb +23 -0
- data/lib/zaws/services/nessus.rb +24 -0
- data/lib/zaws/services/nessus/agents.rb +19 -0
- data/lib/zaws/services/nessus/scanners.rb +19 -0
- data/lib/zaws/services/newrelic.rb +21 -0
- data/lib/zaws/services/newrelic/servers.rb +19 -0
- data/lib/zaws/{route53.rb → services/route53.rb} +1 -1
- data/lib/zaws/services/route53/hosted_zone.rb +36 -0
- data/lib/zaws/services/s3.rb +15 -0
- data/lib/zaws/services/s3/bucket.rb +42 -0
- data/lib/zaws/services/sumo.rb +21 -0
- data/lib/zaws/services/sumo/collectors.rb +19 -0
- data/lib/zaws/services/vmware.rb +0 -0
- data/lib/zaws/version.rb +1 -1
- data/shove_all.sh +6 -0
- data/shove_all_mac.sh +6 -0
- data/shove_all_windows.sh +6 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/zaws/command/ec2/compute/assoc_security_group_spec.rb +135 -0
- data/spec/zaws/command/ec2/compute/compute_spec.rb +321 -0
- data/spec/zaws/command/ec2/compute/images_spec.rb +69 -0
- data/spec/zaws/command/ec2/compute/management_spec.rb +364 -0
- data/spec/zaws/command/ec2/compute/network_spec.rb +93 -0
- data/spec/zaws/command/ec2/compute/node_spec.rb +70 -0
- data/spec/zaws/command/ec2/compute/secondary_ip_spec.rb +212 -0
- data/spec/zaws/command/ec2/compute/storage_spec.rb +63 -0
- data/spec/zaws/command/ec2/elasticip_spec.rb +271 -0
- data/spec/zaws/command/ec2/route_table_spec.rb +844 -0
- data/spec/zaws/command/ec2/security_group_spec.rb +710 -0
- data/spec/zaws/command/ec2/subnet_spec.rb +273 -0
- data/spec/zaws/command/ec2/vpc_spec.rb +180 -0
- data/spec/zaws/command/elb/load_balancer_spec.rb +633 -0
- data/spec/zaws/command/iam/policy_spec.rb +101 -0
- data/spec/zaws/command/iam/role_policy_spec.rb +35 -0
- data/spec/zaws/command/route53/hosted_zone_spec.rb +100 -0
- data/spec/zaws/command/s3/bucket_spec.rb +70 -0
- data/spec/zaws/external/awscli/data/ec2/instance_spec.rb +90 -0
- data/spec/zaws/external/awscli/data/iam/policy_document_spec.rb +56 -0
- data/spec/zaws/external/awscli/data/iam/role_policy_spec.rb +54 -0
- data/spec/zaws/external/awscli/get_aws_version_spec.rb +18 -0
- data/spec/zaws/helper/option_spec.rb +54 -0
- data/spec/zaws/helper/output_spec.rb +144 -0
- data/spec/zaws/helper/process_hash_spec.rb +48 -0
- data/spec/zaws/helper/shell_spec.rb +56 -0
- data/spec/zaws/nessus/scanners.json +0 -0
- data/spec/zaws/version_spec.rb +18 -0
- data/zaws.gemspec +1 -3
- metadata +260 -189
- data/feature/compute/assoc_security_group.feature +0 -55
- data/feature/compute/compute.feature +0 -138
- data/feature/compute/secondary_ip.feature +0 -107
- data/feature/compute/view.feature +0 -23
- data/feature/compute/view_images.feature +0 -24
- data/feature/elasticip/elasticip.feature +0 -138
- data/feature/elasticip/view.feature +0 -18
- data/feature/hosted_zone/view.feature +0 -17
- data/feature/hosted_zone/view_record.feature +0 -29
- data/feature/load_balancer/instance_registration.feature +0 -120
- data/feature/load_balancer/listener.feature +0 -86
- data/feature/load_balancer/load_balancer.feature +0 -101
- data/feature/load_balancer/view.feature +0 -18
- data/feature/route_table/assoc_subnet.feature +0 -128
- data/feature/route_table/route_propagation.feature +0 -93
- data/feature/route_table/route_table.feature +0 -91
- data/feature/route_table/route_to_gateway.feature +0 -69
- data/feature/route_table/route_to_instance.feature +0 -115
- data/feature/route_table/view.feature +0 -25
- data/feature/security_group/ingress_cidr.feature +0 -144
- data/feature/security_group/ingress_group.feature +0 -184
- data/feature/security_group/security_group.feature +0 -107
- data/feature/security_group/view.feature +0 -23
- data/feature/subnet/subnet.feature +0 -94
- data/feature/subnet/view.feature +0 -24
- data/feature/support/env.rb +0 -14
- data/feature/version.feature +0 -6
- data/lib/zaws/aws.rb +0 -26
- data/lib/zaws/ec2.rb +0 -40
- data/lib/zaws/ec2/compute.rb +0 -247
- data/lib/zaws/ec2/elasticip.rb +0 -79
- data/lib/zaws/ec2/route_table.rb +0 -207
- data/lib/zaws/ec2/security_group.rb +0 -154
- data/lib/zaws/ec2/subnet.rb +0 -109
- data/lib/zaws/elb/load_balancer.rb +0 -157
- data/lib/zaws/route53/hosted_zone.rb +0 -36
- data/spec/zaws/ec2/compute/add_volume_spec.rb +0 -39
- data/spec/zaws/ec2/compute/block_device_mapping_spec.rb +0 -31
- data/spec/zaws/ec2/compute/instance_id_by_external_id_spec.rb +0 -23
- data/spec/zaws/ec2/compute/instance_ping_spec.rb +0 -34
- data/spec/zaws/ec2/compute/instance_running_spec.rb +0 -47
- data/spec/zaws/ec2/compute/network_interface_json_spec.rb +0 -57
- data/spec/zaws/ec2/compute/nosdcheck_spec.rb +0 -17
- data/spec/zaws/ec2/compute/tag_instance_spec.rb +0 -21
- data/spec/zaws/ec2/security_group/id_by_name_spec.rb +0 -32
- data/spec/zaws/ec2/subnet/available_spec.rb +0 -22
- data/spec/zaws/ec2/subnet/declare_spec.rb +0 -31
- data/spec/zaws/ec2/subnet/exists_spec.rb +0 -33
- data/spec/zaws/ec2/subnet/id_array_by_cidrblock_array_spec.rb +0 -48
- data/spec/zaws/ec2/subnet/id_by_cidrblock_spec.rb +0 -35
- data/spec/zaws/ec2/subnet/id_by_ip_spec.rb +0 -42
- data/spec/zaws/ec2/subnet/view_spec.rb +0 -34
- data/spec/zaws/elb/load_balancer/calculated_listener_spec.rb +0 -18
- data/spec/zaws/helper/option/absent_spec.rb +0 -14
- data/spec/zaws/helper/option/exclusive_spec.rb +0 -14
- data/spec/zaws/helper/option/exists_spec.rb +0 -18
- data/spec/zaws/helper/option/minimum_spec.rb +0 -14
- data/spec/zaws/helper/output/binary_nagios_check_spec.rb +0 -19
- data/spec/zaws/helper/output/colorize_spec.rb +0 -30
- data/spec/zaws/helper/output/opt_exclusive_spec.rb +0 -14
- data/spec/zaws/helper/output/opt_minimum_spec.rb +0 -15
- data/spec/zaws/helper/output/opt_required_spec.rb +0 -12
- data/spec/zaws/helper/shell/cli_spec.rb +0 -33
- data/spec/zaws/helper/shell/if_then_spec.rb +0 -24
@@ -1,93 +0,0 @@
|
|
1
|
-
Feature: Route to Gateway
|
2
|
-
|
3
|
-
Scenario: Determine a route propagation exsits by virtual gateway and route table
|
4
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
5
|
-
"""
|
6
|
-
{ "RouteTables": [ { "PropagatingVgws" : [ { "GatewayId":"vgw-????????" } ] } ] }
|
7
|
-
"""
|
8
|
-
When I run `bundle exec zaws route_table propagation_exists_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
9
|
-
Then the output should contain "true\n"
|
10
|
-
|
11
|
-
Scenario: Determine a route propagation does not exsits by gateway id and route table
|
12
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
13
|
-
"""
|
14
|
-
{ "RouteTables": [ { "PropagatingVgws" : [] } ] }
|
15
|
-
"""
|
16
|
-
When I run `bundle exec zaws route_table propagation_exists_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
17
|
-
Then the output should contain "false\n"
|
18
|
-
|
19
|
-
Scenario: Declare route propagation by gateway id and route table
|
20
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
21
|
-
"""
|
22
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [] } ] }
|
23
|
-
"""
|
24
|
-
And I double `aws --region us-west-1 ec2 enable-vgw-route-propagation --route-table-id rtb-???????? --gateway-id vgw-????????` with stdout:
|
25
|
-
"""
|
26
|
-
{ "return": "true" }
|
27
|
-
"""
|
28
|
-
When I run `bundle exec zaws route_table declare_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
29
|
-
Then the output should contain "Route propagation from gateway enabled.\n"
|
30
|
-
|
31
|
-
Scenario: Declare route propagation by gateway id and route table, but skip
|
32
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
33
|
-
"""
|
34
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [ { "GatewayId":"vgw-????????" } ] } ] }
|
35
|
-
"""
|
36
|
-
When I run `bundle exec zaws route_table declare_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
37
|
-
Then the output should contain "Route propagation from gateway already enabled. Skipping propagation.\n"
|
38
|
-
|
39
|
-
Scenario: Delete route propagation from gateway.
|
40
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
41
|
-
"""
|
42
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [ { "GatewayId":"vgw-????????" } ] } ] }
|
43
|
-
"""
|
44
|
-
And I double `aws --region us-west-1 ec2 disable-vgw-route-propagation --route-table-id rtb-???????? --gateway-id vgw-????????` with stdout:
|
45
|
-
"""
|
46
|
-
{ "return": "true" }
|
47
|
-
"""
|
48
|
-
When I run `bundle exec zaws route_table delete_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
49
|
-
Then the output should contain "Deleted route propagation from gateway.\n"
|
50
|
-
|
51
|
-
Scenario: Delete route propagation from gateway, but skip it because it doesn't exist.
|
52
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
53
|
-
"""
|
54
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [ ] } ] }
|
55
|
-
"""
|
56
|
-
When I run `bundle exec zaws route_table delete_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id`
|
57
|
-
Then the output should contain "Route propagation from gateway does not exist, skipping deletion.\n"
|
58
|
-
|
59
|
-
Scenario: Nagios OK
|
60
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
61
|
-
"""
|
62
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [ { "GatewayId":"vgw-????????" } ] } ] }
|
63
|
-
"""
|
64
|
-
When I run `bundle exec zaws route_table declare_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id --nagios`
|
65
|
-
Then the output should contain "OK: Route propagation from gateway enabled.\n"
|
66
|
-
And the exit status should be 0
|
67
|
-
|
68
|
-
Scenario: Nagios CRITICAL
|
69
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
70
|
-
"""
|
71
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [] } ] }
|
72
|
-
"""
|
73
|
-
When I run `bundle exec zaws route_table declare_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id --nagios`
|
74
|
-
Then the output should contain "CRITICAL: Route propagation from gateway not enabled.\n"
|
75
|
-
And the exit status should be 2
|
76
|
-
|
77
|
-
Scenario: Undo file
|
78
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
79
|
-
"""
|
80
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-????????","PropagatingVgws" : [] } ] }
|
81
|
-
"""
|
82
|
-
And I double `aws --region us-west-1 ec2 enable-vgw-route-propagation --route-table-id rtb-???????? --gateway-id vgw-????????` with stdout:
|
83
|
-
"""
|
84
|
-
{ "return": "true" }
|
85
|
-
"""
|
86
|
-
Given an empty file named "undo.sh.1"
|
87
|
-
When I run `bundle exec zaws route_table declare_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1`
|
88
|
-
Then the output should contain "Route propagation from gateway enabled.\n"
|
89
|
-
And the file "undo.sh.1" should contain "zaws route_table delete_propagation_from_gateway my_route_table vgw-???????? --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
@@ -1,91 +0,0 @@
|
|
1
|
-
Feature: Route Table
|
2
|
-
Route Tables control network traffic in AWS between subnets and gateways.
|
3
|
-
|
4
|
-
Scenario: Determine a route table DOES NOT exists by external id
|
5
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
6
|
-
"""
|
7
|
-
{ "RouteTables": [] }
|
8
|
-
"""
|
9
|
-
When I run `bundle exec zaws route_table exists_by_external_id my_route_table --region us-west-1 --vpcid my_vpc_id`
|
10
|
-
Then the output should contain "false\n"
|
11
|
-
|
12
|
-
Scenario: Determine a route table exists by external id
|
13
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
14
|
-
"""
|
15
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } ] }
|
16
|
-
"""
|
17
|
-
When I run `bundle exec zaws route_table exists_by_external_id my_route_table --region us-west-1 --vpcid my_vpc_id`
|
18
|
-
Then the output should contain "true\n"
|
19
|
-
|
20
|
-
Scenario: Declare route table by external id
|
21
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
22
|
-
"""
|
23
|
-
{ "RouteTables": [] }
|
24
|
-
"""
|
25
|
-
And I double `aws --region us-west-1 ec2 create-route-table --vpc-id my_vpc_id` with stdout:
|
26
|
-
"""
|
27
|
-
{ "RouteTable": { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } }
|
28
|
-
"""
|
29
|
-
And I double `aws --region us-west-1 ec2 create-tags --resources rtb-XXXXXXX --tags Key=externalid,Value=my_route_table` with stdout:
|
30
|
-
"""
|
31
|
-
{ "return": "true" }
|
32
|
-
"""
|
33
|
-
When I run `bundle exec zaws route_table declare my_route_table my_vpc_id --region us-west-1`
|
34
|
-
Then the output should contain "Route table created with external id: my_route_table.\n"
|
35
|
-
|
36
|
-
Scenario: Declare route table by external id, but DO NOT create it because it exists
|
37
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
38
|
-
"""
|
39
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } ] }
|
40
|
-
"""
|
41
|
-
When I run `bundle exec zaws route_table declare my_route_table my_vpc_id --region us-west-1`
|
42
|
-
Then the output should contain "Route table exists already. Skipping Creation.\n"
|
43
|
-
|
44
|
-
Scenario: Delete a route table in a vpc, but skip it cause it does not exist
|
45
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
46
|
-
"""
|
47
|
-
{ "RouteTables": [] }
|
48
|
-
"""
|
49
|
-
When I run `bundle exec zaws route_table delete my_route_table --region us-west-1 --vpcid my_vpc_id`
|
50
|
-
Then the output should contain "Route table does not exist. Skipping deletion.\n"
|
51
|
-
|
52
|
-
Scenario: Delete a route table in a vpc
|
53
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
54
|
-
"""
|
55
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } ] }
|
56
|
-
"""
|
57
|
-
And I double `aws --region us-west-1 ec2 delete-route-table --route-table-id rtb-XXXXXXX` with stdout:
|
58
|
-
"""
|
59
|
-
{ "return": "true" }
|
60
|
-
"""
|
61
|
-
When I run `bundle exec zaws route_table delete my_route_table --region us-west-1 --vpcid my_vpc_id`
|
62
|
-
Then the output should contain "Route table deleted.\n"
|
63
|
-
|
64
|
-
Scenario: Perform a nagios check, with the result indicatin OK (exit 0), indicating declaring a route table requires no action because it exists.
|
65
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
66
|
-
"""
|
67
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } ] }
|
68
|
-
"""
|
69
|
-
When I run `bundle exec zaws route_table declare my_route_table my_vpc_id --region us-west-1 --nagios`
|
70
|
-
Then the output should contain "OK: Route table exists.\n"
|
71
|
-
And the exit status should be 0
|
72
|
-
|
73
|
-
Scenario: Perform a nagios check, with the result indicatin CRITICAL (exit 2), indicating declaring a security group requires action because it does not exist.
|
74
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
75
|
-
"""
|
76
|
-
{ "RouteTables": [ ] }
|
77
|
-
"""
|
78
|
-
When I run `bundle exec zaws route_table declare my_route_table my_vpc_id --region us-west-1 --nagios`
|
79
|
-
Then the output should contain "CRITICAL: Route table does not exist.\n"
|
80
|
-
And the exit status should be 2
|
81
|
-
|
82
|
-
Scenario: Declaring a route to an instance, should append the command to remove the security group to file.
|
83
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
84
|
-
"""
|
85
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX" } ] }
|
86
|
-
"""
|
87
|
-
Given an empty file named "undo.sh.1"
|
88
|
-
When I run `bundle exec zaws route_table declare my_route_table my_vpc_id --region us-west-1 --undofile undo.sh.1`
|
89
|
-
Then the output should contain "Route table exists already. Skipping Creation.\n"
|
90
|
-
And the file "undo.sh.1" should contain "zaws route_table delete my_route_table --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
91
|
-
|
@@ -1,69 +0,0 @@
|
|
1
|
-
Feature: Route to Gateway
|
2
|
-
|
3
|
-
Scenario: Determine a route DOES NOT exist to a gateway by a gateway id
|
4
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
5
|
-
"""
|
6
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ { "GatewayId": "igw-XXXXXXX", "DestinationCidrBlock": "0.0.0.0/0" } ] } ] }
|
7
|
-
"""
|
8
|
-
When I run `bundle exec zaws route_table route_exists_by_gatewayid my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id`
|
9
|
-
Then the output should contain "true\n"
|
10
|
-
|
11
|
-
Scenario: Determine a route to a gateway by a gateway id does not exist
|
12
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
13
|
-
"""
|
14
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ { "GatewayId": "igw-YYYYYYY", "DestinationCidrBlock": "0.0.0.0/0" } ] } ] }
|
15
|
-
"""
|
16
|
-
When I run `bundle exec zaws route_table route_exists_by_gatewayid my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id`
|
17
|
-
Then the output should contain "false\n"
|
18
|
-
|
19
|
-
Scenario: Declare route to gateway id
|
20
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
21
|
-
"""
|
22
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "GatewayId": "igw-YYYYYYY"} ] } ] }
|
23
|
-
"""
|
24
|
-
And I double `aws --region us-west-1 ec2 create-route --route-table-id rtb-XXXXXXX --destination-cidr-block 0.0.0.0/0 --gateway-id igw-XXXXXXX` with stdout:
|
25
|
-
"""
|
26
|
-
{ "return" : "true" }
|
27
|
-
"""
|
28
|
-
When I run `bundle exec zaws route_table declare_route_to_gateway my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id`
|
29
|
-
Then the output should contain "Route created to gateway.\n"
|
30
|
-
|
31
|
-
Scenario: Declare route to gateway id, but skip it because it exists
|
32
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
33
|
-
"""
|
34
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "GatewayId": "igw-XXXXXXX"} ] } ] }
|
35
|
-
"""
|
36
|
-
When I run `bundle exec zaws route_table declare_route_to_gateway my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id`
|
37
|
-
Then the output should contain "Route to gateway exists. Skipping creation.\n"
|
38
|
-
|
39
|
-
Scenario: Nagios OK
|
40
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
41
|
-
"""
|
42
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "GatewayId": "igw-XXXXXXX"} ] } ] }
|
43
|
-
"""
|
44
|
-
When I run `bundle exec zaws route_table declare_route_to_gateway my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id --nagios`
|
45
|
-
Then the output should contain "OK: Route to gateway exists.\n"
|
46
|
-
|
47
|
-
|
48
|
-
Scenario: Nagios CRITICAL
|
49
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
50
|
-
"""
|
51
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "GatewayId": "igw-YYYYYYY"} ] } ] }
|
52
|
-
"""
|
53
|
-
When I run `bundle exec zaws route_table declare_route_to_gateway my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id --nagios`
|
54
|
-
Then the output should contain "CRITICAL: Route to gateway does not exist.\n"
|
55
|
-
|
56
|
-
|
57
|
-
Scenario: Undo file
|
58
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
59
|
-
"""
|
60
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "GatewayId": "igw-XXXXXXX"} ] } ] }
|
61
|
-
"""
|
62
|
-
Given an empty file named "undo.sh.1"
|
63
|
-
When I run `bundle exec zaws route_table declare_route_to_gateway my_route_table 0.0.0.0/0 igw-XXXXXXX --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1`
|
64
|
-
Then the output should contain "Route to gateway exists. Skipping creation.\n"
|
65
|
-
And the file "undo.sh.1" should contain "zaws route_table delete_route my_route_table 0.0.0.0/0 --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
66
|
-
|
67
|
-
|
68
|
-
#Deletion and Undo file covered by route_to_instance.feature because deletion requires route table and cidrblock only.
|
69
|
-
|
@@ -1,115 +0,0 @@
|
|
1
|
-
Feature: Route Table
|
2
|
-
Route Tables control network traffic in AWS between subnets and gateways.
|
3
|
-
|
4
|
-
Scenario: Determine a route DOES NOT exist to an instance by instance external id
|
5
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
6
|
-
"""
|
7
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
8
|
-
"""
|
9
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
10
|
-
"""
|
11
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-YYYYYYY"} ] } ] }
|
12
|
-
"""
|
13
|
-
When I run `bundle exec zaws route_table route_exists_by_instance my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id`
|
14
|
-
Then the output should contain "false\n"
|
15
|
-
|
16
|
-
Scenario: Determine a route exists to an instance by instance external id
|
17
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
18
|
-
"""
|
19
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
20
|
-
"""
|
21
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
22
|
-
"""
|
23
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
24
|
-
"""
|
25
|
-
When I run `bundle exec zaws route_table route_exists_by_instance my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id`
|
26
|
-
Then the output should contain "true\n"
|
27
|
-
|
28
|
-
Scenario: Declare route to an instance by instance external id
|
29
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
30
|
-
"""
|
31
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
32
|
-
"""
|
33
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
34
|
-
"""
|
35
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-YYYYYYY"} ] } ] }
|
36
|
-
"""
|
37
|
-
And I double `aws --region us-west-1 ec2 create-route --route-table-id rtb-XXXXXXX --destination-cidr-block 0.0.0.0/0 --instance-id i-XXXXXXX` with stdout:
|
38
|
-
"""
|
39
|
-
{ "return" : "true" }
|
40
|
-
"""
|
41
|
-
When I run `bundle exec zaws route_table declare_route my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id`
|
42
|
-
Then the output should contain "Route created to instance.\n"
|
43
|
-
|
44
|
-
Scenario: Declare route to an instance by instance external id, but skip createion because it exists.
|
45
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
46
|
-
"""
|
47
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
48
|
-
"""
|
49
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
50
|
-
"""
|
51
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
52
|
-
"""
|
53
|
-
When I run `bundle exec zaws route_table declare_route my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id`
|
54
|
-
Then the output should contain "Route not created to instance. Skip creation.\n"
|
55
|
-
|
56
|
-
Scenario: Delete route
|
57
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
58
|
-
"""
|
59
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
60
|
-
"""
|
61
|
-
And I double `aws --region us-west-1 ec2 delete-route --route-table-id rtb-XXXXXXX --destination-cidr-block 0.0.0.0/0` with stdout:
|
62
|
-
"""
|
63
|
-
{ "return" : "true" }
|
64
|
-
"""
|
65
|
-
When I run `bundle exec zaws route_table delete_route my_route_table 0.0.0.0/0 --region us-west-1 --vpcid my_vpc_id`
|
66
|
-
Then the output should contain "Route deleted.\n"
|
67
|
-
|
68
|
-
Scenario: Delete route skipped because it doesn't exist
|
69
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
70
|
-
"""
|
71
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "1.1.1.1/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
72
|
-
"""
|
73
|
-
When I run `bundle exec zaws route_table delete_route my_route_table 0.0.0.0/0 --region us-west-1 --vpcid my_vpc_id`
|
74
|
-
Then the output should contain "Route does not exist. Skipping deletion.\n"
|
75
|
-
|
76
|
-
Scenario: Perform a nagios check, with the result indicatin OK (exit 0), indicating declaring a route requires no action because it exists.
|
77
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
78
|
-
"""
|
79
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
80
|
-
"""
|
81
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
82
|
-
"""
|
83
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
84
|
-
"""
|
85
|
-
When I run `bundle exec zaws route_table declare_route my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id --nagios`
|
86
|
-
Then the output should contain "OK: Route to instance exists.\n"
|
87
|
-
And the exit status should be 0
|
88
|
-
|
89
|
-
Scenario: Perform a nagios check, with the result indicatin CRITICAL (exit 2), indicating declaring a security group requires action because it does not exist.
|
90
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
91
|
-
"""
|
92
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
93
|
-
"""
|
94
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
95
|
-
"""
|
96
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-YYYYYYY"} ] } ] }
|
97
|
-
"""
|
98
|
-
When I run `bundle exec zaws route_table declare_route my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id --nagios`
|
99
|
-
Then the output should contain "CRITICAL: Route to instance does not exist.\n"
|
100
|
-
And the exit status should be 2
|
101
|
-
|
102
|
-
Scenario: Declaring a route to an instance, should append the command to remove the security group to file.
|
103
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_instance'` with stdout:
|
104
|
-
"""
|
105
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
106
|
-
"""
|
107
|
-
And I double `aws --output json --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=tag:externalid,Values=my_route_table'` with stdout:
|
108
|
-
"""
|
109
|
-
{ "RouteTables": [ { "VpcId":"my_vpc_id","RouteTableId":"rtb-XXXXXXX", "Routes":[ {"DestinationCidrBlock": "0.0.0.0/0", "InstanceId": "i-XXXXXXX"} ] } ] }
|
110
|
-
"""
|
111
|
-
Given an empty file named "undo.sh.1"
|
112
|
-
When I run `bundle exec zaws route_table declare_route my_route_table 0.0.0.0/0 my_instance --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1`
|
113
|
-
Then the output should contain "Route not created to instance. Skip creation.\n"
|
114
|
-
And the file "undo.sh.1" should contain "zaws route_table delete_route my_route_table 0.0.0.0/0 --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
115
|
-
|
@@ -1,25 +0,0 @@
|
|
1
|
-
Feature: Route Table
|
2
|
-
Route Tables control network traffic in AWS between subnets and gateways.
|
3
|
-
|
4
|
-
Scenario: Get route table in a human readable table.
|
5
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-route-tables` with "AWS Route Table Output"
|
6
|
-
When I run `bundle exec zaws route_table view --region us-west-1 --viewtype table`
|
7
|
-
Then the stdout should contain "AWS Route Table Output\n"
|
8
|
-
|
9
|
-
Scenario: Get route table in a human readable table form by default
|
10
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-route-tables` with "AWS Route Table Output"
|
11
|
-
When I run `bundle exec zaws route_table view --region us-west-1`
|
12
|
-
Then the stdout should contain "AWS Route Table Output\n"
|
13
|
-
|
14
|
-
Scenario: Get route table in JSON form
|
15
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-route-tables` with "AWS Route Table JSON Output"
|
16
|
-
When I run `bundle exec zaws route_table view --region us-west-1 --viewtype json`
|
17
|
-
Then the stdout should contain "AWS Route Table JSON Output\n"
|
18
|
-
|
19
|
-
Scenario: Get route table from specified vpcid
|
20
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-route-tables --filter 'Name=vpc-id,Values=my_vpc_id'` with "AWS Route Table Output"
|
21
|
-
When I run `bundle exec zaws route_table view --region us-west-1 --vpcid my_vpc_id`
|
22
|
-
Then the stdout should contain "AWS Route Table Output\n"
|
23
|
-
|
24
|
-
|
25
|
-
|
@@ -1,144 +0,0 @@
|
|
1
|
-
Feature: Security Group
|
2
|
-
Security Group(s) are viewable
|
3
|
-
|
4
|
-
Scenario: Determine a vpc securiry group ingress cidr rule identified by cidr and target has NOT been created
|
5
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
6
|
-
"""
|
7
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
8
|
-
"""
|
9
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
10
|
-
"""
|
11
|
-
{ "SecurityGroups": [] }
|
12
|
-
"""
|
13
|
-
When I run `bundle exec zaws security_group ingress_cidr_exists target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id`
|
14
|
-
Then the output should contain "false\n"
|
15
|
-
|
16
|
-
Scenario: Determine a vpc security group ingress cidr rule identified by cidr and target has been created
|
17
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
18
|
-
"""
|
19
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
20
|
-
"""
|
21
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
22
|
-
"""
|
23
|
-
{ "SecurityGroups": [ {
|
24
|
-
"GroupName": "target_group_name",
|
25
|
-
"GroupId": "X_target_group_name",
|
26
|
-
"IpPermissions": [ {
|
27
|
-
"ToPort": 443,
|
28
|
-
"IpProtocol": "tcp",
|
29
|
-
"IpRanges": [ { "CidrIp" : "0.0.0.0/0" } ],
|
30
|
-
"UserIdGroupPairs": [ ],
|
31
|
-
"FromPort": 443 } ] } ] }
|
32
|
-
"""
|
33
|
-
When I run `bundle exec zaws security_group ingress_cidr_exists target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id`
|
34
|
-
Then the output should contain "true\n"
|
35
|
-
|
36
|
-
Scenario: Declare a new vpc security group ingress group rule identified by source and target. Create it cause it doesn't exist. Also, should append the command to remove the security group to file.
|
37
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
38
|
-
"""
|
39
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
40
|
-
"""
|
41
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
42
|
-
"""
|
43
|
-
{ "SecurityGroups": [] }
|
44
|
-
"""
|
45
|
-
And I double `aws --region us-west-1 ec2 authorize-security-group-ingress --group-id X_target_group_name --cidr 0.0.0.0/0 --protocol tcp --port 443` with stdout:
|
46
|
-
"""
|
47
|
-
{ "return": "true" }
|
48
|
-
"""
|
49
|
-
When I run `bundle exec zaws security_group declare_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id`
|
50
|
-
Then the output should contain "Ingress cidr rule created.\n"
|
51
|
-
|
52
|
-
Scenario: Declare a new vpc security group ingress group rule identified by source and target. Do not create it because it does exist.
|
53
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
54
|
-
"""
|
55
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
56
|
-
"""
|
57
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
58
|
-
"""
|
59
|
-
{ "SecurityGroups": [ {
|
60
|
-
"GroupName": "target_group_name",
|
61
|
-
"GroupId": "X_target_group_name",
|
62
|
-
"IpPermissions": [ {
|
63
|
-
"ToPort": 443,
|
64
|
-
"IpProtocol": "tcp",
|
65
|
-
"IpRanges": [ { "CidrIp" : "0.0.0.0/0" } ],
|
66
|
-
"UserIdGroupPairs": [ ],
|
67
|
-
"FromPort": 443 } ] } ] }
|
68
|
-
"""
|
69
|
-
Given an empty file named "undo.sh.1"
|
70
|
-
When I run `bundle exec zaws security_group declare_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1`
|
71
|
-
Then the output should contain "Ingress cidr rule not created. Exists already.\n"
|
72
|
-
And the file "undo.sh.1" should contain "zaws security_group delete_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
73
|
-
|
74
|
-
Scenario: Perform a nagios check, with the result indicatin OK (exit 0), indicating declaring a vpc security group ingress cidr requires no action because it exists.
|
75
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
76
|
-
"""
|
77
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
78
|
-
"""
|
79
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
80
|
-
"""
|
81
|
-
{ "SecurityGroups": [ {
|
82
|
-
"GroupName": "target_group_name",
|
83
|
-
"GroupId": "X_target_group_name",
|
84
|
-
"IpPermissions": [ {
|
85
|
-
"ToPort": 443,
|
86
|
-
"IpProtocol": "tcp",
|
87
|
-
"IpRanges": [ { "CidrIp" : "0.0.0.0/0" } ],
|
88
|
-
"UserIdGroupPairs": [ ],
|
89
|
-
"FromPort": 443 } ] } ] }
|
90
|
-
"""
|
91
|
-
When I run `bundle exec zaws security_group declare_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id --nagios`
|
92
|
-
Then the output should contain "OK: Security group ingress cidr rule exists.\n"
|
93
|
-
And the exit status should be 0
|
94
|
-
|
95
|
-
Scenario: Perform a nagios check, with the result indicatin CRITICAL (exit 2), indicating declaring a security group ingress group requires action because it does not exist.
|
96
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
97
|
-
"""
|
98
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
99
|
-
"""
|
100
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
101
|
-
"""
|
102
|
-
{ "SecurityGroups": [] }
|
103
|
-
"""
|
104
|
-
When I run `bundle exec zaws security_group declare_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id --nagios`
|
105
|
-
Then the output should contain "CRITICAL: Security group ingress cidr rule does not exist.\n"
|
106
|
-
And the exit status should be 2
|
107
|
-
|
108
|
-
Scenario: Delete a vpc security group ingress cidr rule, but skip it cause it does not exist
|
109
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
110
|
-
"""
|
111
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
112
|
-
"""
|
113
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
114
|
-
"""
|
115
|
-
{ "SecurityGroups": [] }
|
116
|
-
"""
|
117
|
-
When I run `bundle exec zaws security_group delete_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id`
|
118
|
-
Then the output should contain "Security group ingress cidr rule does not exist. Skipping deletion.\n"
|
119
|
-
|
120
|
-
Scenario: Delete a vpc security group ingress cidr rule
|
121
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-name,Values=target_group_name'` with stdout:
|
122
|
-
"""
|
123
|
-
{ "SecurityGroups": [ { "GroupName": "target_group_name","GroupId": "X_target_group_name" } ] }
|
124
|
-
"""
|
125
|
-
And I double `aws --output json --region us-west-1 ec2 describe-security-groups --filter 'Name=vpc-id,Values=my_vpc_id' 'Name=group-id,Values=X_target_group_name' 'Name=ip-permission.cidr,Values=0.0.0.0/0' 'Name=ip-permission.protocol,Values=tcp' 'Name=ip-permission.to-port,Values=443'` with stdout:
|
126
|
-
"""
|
127
|
-
{ "SecurityGroups": [ {
|
128
|
-
"GroupName": "target_group_name",
|
129
|
-
"GroupId": "X_target_group_name",
|
130
|
-
"IpPermissions": [ {
|
131
|
-
"ToPort": 443,
|
132
|
-
"IpProtocol": "tcp",
|
133
|
-
"IpRanges": [ { "CidrIp" : "0.0.0.0/0" } ],
|
134
|
-
"UserIdGroupPairs": [ ],
|
135
|
-
"FromPort": 443 } ] } ] }
|
136
|
-
"""
|
137
|
-
And I double `aws --region us-west-1 ec2 revoke-security-group-ingress --group-id X_target_group_name --cidr 0.0.0.0/0 --protocol tcp --port 443` with stdout:
|
138
|
-
"""
|
139
|
-
{ "return": "true" }
|
140
|
-
"""
|
141
|
-
When I run `bundle exec zaws security_group delete_ingress_cidr target_group_name 0.0.0.0/0 tcp 443 --region us-west-1 --vpcid my_vpc_id`
|
142
|
-
Then the output should contain "Security group ingress cidr rule deleted.\n"
|
143
|
-
|
144
|
-
|