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,55 +0,0 @@
|
|
1
|
-
Feature: Associate Security Group
|
2
|
-
|
3
|
-
Scenario: Determine a security group is associated to instance by external id
|
4
|
-
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:
|
5
|
-
"""
|
6
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ], "SecurityGroups" : [ { "GroupName": "my_security_group", "GroupId":"sg-X" } ] } ] } ] }
|
7
|
-
"""
|
8
|
-
And 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=my_security_group'` with stdout:
|
9
|
-
"""
|
10
|
-
{ "SecurityGroups": [ { "GroupName": "my_security_group","GroupId":"sg-X" } ] }
|
11
|
-
"""
|
12
|
-
When I run `bundle exec zaws compute exists_security_group_assoc my_instance my_security_group --region us-west-1 --vpcid my_vpc_id`
|
13
|
-
Then the output should contain "true\n"
|
14
|
-
|
15
|
-
Scenario: Determine a security group is not associated to instance by external id
|
16
|
-
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:
|
17
|
-
"""
|
18
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ], "SecurityGroups" : [ { "GroupName": "my_security_group", "GroupId":"sg-X" } ] } ] } ] }
|
19
|
-
"""
|
20
|
-
And 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=my_security_group'` with stdout:
|
21
|
-
"""
|
22
|
-
{ "SecurityGroups": [ { "GroupName": "my_security_group","GroupId":"sg-Y" } ] }
|
23
|
-
"""
|
24
|
-
When I run `bundle exec zaws compute exists_security_group_assoc my_instance my_security_group --region us-west-1 --vpcid my_vpc_id`
|
25
|
-
Then the output should contain "false\n"
|
26
|
-
|
27
|
-
Scenario: Change security group of instance by external id
|
28
|
-
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:
|
29
|
-
"""
|
30
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ], "SecurityGroups" : [ { "GroupName": "my_security_group", "GroupId":"sg-X" } ] } ] } ] }
|
31
|
-
"""
|
32
|
-
And 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=my_security_group'` with stdout:
|
33
|
-
"""
|
34
|
-
{ "SecurityGroups": [ { "GroupName": "my_security_group","GroupId":"sg-Y" } ] }
|
35
|
-
"""
|
36
|
-
And I double `aws --region us-west-1 ec2 modify-instance-attribute --instance-id i-XXXXXXX --groups sg-Y ` with stdout:
|
37
|
-
"""
|
38
|
-
{ "return": "true" }
|
39
|
-
"""
|
40
|
-
When I run `bundle exec zaws compute assoc_security_group my_instance my_security_group --region us-west-1 --vpcid my_vpc_id`
|
41
|
-
Then the output should contain "Security Group Association Changed.\n"
|
42
|
-
|
43
|
-
Scenario: Not Change security group of instance by external id, but it is already associated
|
44
|
-
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:
|
45
|
-
"""
|
46
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ], "SecurityGroups" : [ { "GroupName": "my_security_group", "GroupId":"sg-X" } ] } ] } ] }
|
47
|
-
"""
|
48
|
-
And 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=my_security_group'` with stdout:
|
49
|
-
"""
|
50
|
-
{ "SecurityGroups": [ { "GroupName": "my_security_group","GroupId":"sg-X" } ] }
|
51
|
-
"""
|
52
|
-
When I run `bundle exec zaws compute assoc_security_group my_instance my_security_group --region us-west-1 --vpcid my_vpc_id`
|
53
|
-
Then the output should contain "Security Group Association Not Changed.\n"
|
54
|
-
|
55
|
-
|
@@ -1,138 +0,0 @@
|
|
1
|
-
Feature: Compute
|
2
|
-
|
3
|
-
Scenario: Determine a compute instance exists by instance external id
|
4
|
-
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:
|
5
|
-
"""
|
6
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
7
|
-
"""
|
8
|
-
When I run `bundle exec zaws compute exists_by_external_id my_instance --region us-west-1 --vpcid my_vpc_id`
|
9
|
-
Then the output should contain "true\n"
|
10
|
-
|
11
|
-
Scenario: Determine a compute instance DOES NOT exist by instance external id
|
12
|
-
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:
|
13
|
-
"""
|
14
|
-
{ "Reservations": [] }
|
15
|
-
"""
|
16
|
-
When I run `bundle exec zaws compute exists_by_external_id my_instance --region us-west-1 --vpcid my_vpc_id`
|
17
|
-
Then the output should contain "false\n"
|
18
|
-
|
19
|
-
Scenario: Declare a compute instance in vpc by external id, created undo file
|
20
|
-
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:
|
21
|
-
"""
|
22
|
-
{ "Reservations": [] }
|
23
|
-
"""
|
24
|
-
And I double `aws --output json --region us-west-1 ec2 describe-images --owner self --image-ids ami-abc123` with stdout:
|
25
|
-
"""
|
26
|
-
{ "Images": [
|
27
|
-
{ "RootDeviceName": "/dev/sda1",
|
28
|
-
"BlockDeviceMappings": [
|
29
|
-
{ "DeviceName": "/dev/sda1",
|
30
|
-
"Ebs": {
|
31
|
-
"DeleteOnTermination": true,
|
32
|
-
"SnapshotId": "snap-XXX",
|
33
|
-
"VolumeSize": 7,
|
34
|
-
"VolumeType": "standard" } } ] } ] }
|
35
|
-
"""
|
36
|
-
And I double `aws --output json --region us-west-1 ec2 describe-subnets --filter 'Name=vpc-id,Values=my_vpc_id'` with stdout:
|
37
|
-
"""
|
38
|
-
{ "Subnets": [
|
39
|
-
{
|
40
|
-
"VpcId": "my_vpc_id",
|
41
|
-
"CidrBlock": "10.0.1.0/24",
|
42
|
-
"MapPublicIpOnLaunch": false,
|
43
|
-
"DefaultForAz": false,
|
44
|
-
"State": "available",
|
45
|
-
"SubnetId": "subnet-XXXXXX",
|
46
|
-
"AvailableIpAddressCount": 251
|
47
|
-
},
|
48
|
-
{
|
49
|
-
"VpcId": "my_vpc_id",
|
50
|
-
"CidrBlock": "10.0.0.0/24",
|
51
|
-
"MapPublicIpOnLaunch": false,
|
52
|
-
"DefaultForAz": false,
|
53
|
-
"State": "available",
|
54
|
-
"SubnetId": "subnet-YYYYYY",
|
55
|
-
"AvailableIpAddressCount": 251
|
56
|
-
} ] }
|
57
|
-
"""
|
58
|
-
And 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=mysecuritygroup'` with stdout:
|
59
|
-
"""
|
60
|
-
{
|
61
|
-
"SecurityGroups": [
|
62
|
-
{
|
63
|
-
"Description": "My security group",
|
64
|
-
"GroupName": "my_security_group_name",
|
65
|
-
"OwnerId": "123456789012",
|
66
|
-
"GroupId": "sg-903004f8"
|
67
|
-
}
|
68
|
-
]
|
69
|
-
}
|
70
|
-
"""
|
71
|
-
And I double `aws --region us-west-1 ec2 run-instances --image-id ami-abc123 --key-name sshkey --instance-type x1-large --placement AvailabilityZone=us-west-1a --block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"DeleteOnTermination":true,"SnapshotId":"snap-XXX","VolumeSize":70,"VolumeType":"standard"}}]' --enable-api-termination --client-token test_token --network-interfaces '[{"Groups":["sg-903004f8"],"PrivateIpAddress":"10.0.0.6","DeviceIndex":0,"SubnetId":"subnet-YYYYYY"}]' --ebs-optimized` with stdout:
|
72
|
-
"""
|
73
|
-
{ "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ ] } ] }
|
74
|
-
"""
|
75
|
-
And I double `aws --output json --region us-west-1 ec2 create-tags --resources id-XXXXXXX --tags Key=externalid,Value=my_instance` with stdout:
|
76
|
-
"""
|
77
|
-
{ "return":"true" }
|
78
|
-
"""
|
79
|
-
And I double `aws --output json --region us-west-1 ec2 create-tags --resources id-XXXXXXX --tags Key=Name,Value=my_instance` with stdout:
|
80
|
-
"""
|
81
|
-
{ "return":"true" }
|
82
|
-
"""
|
83
|
-
And I double `aws --output json --region us-west-1 ec2 modify-instance-attribute --instance-id=id-XXXXXXX --no-source-dest-check` with stdout:
|
84
|
-
"""
|
85
|
-
{ "return":"true" }
|
86
|
-
"""
|
87
|
-
Given an empty file named "undo.sh.1"
|
88
|
-
When I run `bundle exec zaws compute declare my_instance ami-abc123 self x1-large 70 us-west-1a sshkey mysecuritygroup --privateip "10.0.0.6" --region us-west-1 --vpcid my_vpc_id --optimized --apiterminate --clienttoken test_token --undofile undo.sh.1 --skipruncheck --verbose`
|
89
|
-
Then the output should contain "Instance created.\n"
|
90
|
-
And the file "undo.sh.1" should contain "zaws compute delete my_instance --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
91
|
-
|
92
|
-
Scenario: Declare a compute instance in vpc by external id, skip
|
93
|
-
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:
|
94
|
-
"""
|
95
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
96
|
-
"""
|
97
|
-
When I run `bundle exec zaws compute declare my_instance ami-abc123 self x1-large 70 us-west-1a sshkey mysecuritygroup --privateip "10.0.0.6" --region us-west-1 --vpcid my_vpc_id --optimized --apiterminate --clienttoken test_token --skipruncheck`
|
98
|
-
Then the output should contain "Instance already exists. Creation skipped.\n"
|
99
|
-
|
100
|
-
|
101
|
-
Scenario: Delete
|
102
|
-
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:
|
103
|
-
"""
|
104
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
105
|
-
"""
|
106
|
-
Given I double `aws --region us-west-1 ec2 terminate-instances --instance-ids i-XXXXXXX` with stdout:
|
107
|
-
"""
|
108
|
-
{ "TerimatingInstances": [ ] }
|
109
|
-
"""
|
110
|
-
When I run `bundle exec zaws compute delete my_instance --region us-west-1 --vpcid my_vpc_id`
|
111
|
-
Then the output should contain "Instance deleted.\n"
|
112
|
-
|
113
|
-
Scenario: Delete, skip
|
114
|
-
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:
|
115
|
-
"""
|
116
|
-
{ "Reservations": [] }
|
117
|
-
"""
|
118
|
-
When I run `bundle exec zaws compute delete my_instance --region us-west-1 --vpcid my_vpc_id`
|
119
|
-
Then the output should contain "Instance does not exist. Skipping deletion.\n"
|
120
|
-
|
121
|
-
Scenario: Nagios OK
|
122
|
-
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:
|
123
|
-
"""
|
124
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
125
|
-
"""
|
126
|
-
When I run `bundle exec zaws compute declare my_instance ami-abc123 self x1-large 70 us-west-1a sshkey mysecuritygroup --privateip "10.0.0.6" --region us-west-1 --vpcid my_vpc_id --optimized --apiterminate --clienttoken test_token --nagios --skipruncheck`
|
127
|
-
Then the output should contain "OK: Instance already exists.\n"
|
128
|
-
|
129
|
-
Scenario: Nagios CRITICAL
|
130
|
-
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:
|
131
|
-
"""
|
132
|
-
{ "Reservations": [] }
|
133
|
-
"""
|
134
|
-
When I run `bundle exec zaws compute declare my_instance ami-abc123 self x1-large 70 us-west-1a sshkey mysecuritygroup --privateip "10.0.0.6" --region us-west-1 --vpcid my_vpc_id --optimized --apiterminate --clienttoken test_token --nagios --skipruncheck`
|
135
|
-
Then the output should contain "CRITICAL: Instance does not exist.\n"
|
136
|
-
|
137
|
-
|
138
|
-
|
@@ -1,107 +0,0 @@
|
|
1
|
-
Feature: Compute
|
2
|
-
|
3
|
-
Scenario: Determine secondary ip exists on instance by external ip
|
4
|
-
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:
|
5
|
-
"""
|
6
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
7
|
-
"NetworkInterfaces" : [ { "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.0" } ] } ],
|
8
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
9
|
-
"""
|
10
|
-
When I run `bundle exec zaws compute exists_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
11
|
-
Then the output should contain "true\n"
|
12
|
-
|
13
|
-
Scenario: Determine secondary ip does not exist on instance by external ip
|
14
|
-
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:
|
15
|
-
"""
|
16
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
17
|
-
"NetworkInterfaces" : [ { "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.1" } ] } ],
|
18
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
19
|
-
"""
|
20
|
-
When I run `bundle exec zaws compute exists_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
21
|
-
Then the output should contain "false\n"
|
22
|
-
|
23
|
-
Scenario: Declare secondary ip for instance by external ip
|
24
|
-
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:
|
25
|
-
"""
|
26
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
27
|
-
"NetworkInterfaces" : [ { "NetworkInterfaceId": "net-123", "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.1" } ] } ],
|
28
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
29
|
-
"""
|
30
|
-
Given I double `aws --output json --region us-west-1 ec2 assign-private-ip-addresses --network-interface-id 'net-123' --private-ip-addresses '0.0.0.0'` with stdout:
|
31
|
-
"""
|
32
|
-
{ "return" : "true" }
|
33
|
-
"""
|
34
|
-
When I run `bundle exec zaws compute declare_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
35
|
-
Then the output should contain "Secondary ip assigned.\n"
|
36
|
-
|
37
|
-
Scenario: Skip declaring secondary ip for instance by external ip because it exists already.
|
38
|
-
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:
|
39
|
-
"""
|
40
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
41
|
-
"NetworkInterfaces" : [ { "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.0" } ] } ],
|
42
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
43
|
-
"""
|
44
|
-
When I run `bundle exec zaws compute declare_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
45
|
-
Then the output should contain "Secondary ip already exists. Skipping assignment.\n"
|
46
|
-
|
47
|
-
Scenario: Delete
|
48
|
-
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:
|
49
|
-
"""
|
50
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
51
|
-
"NetworkInterfaces" : [ { "NetworkInterfaceId": "net-123", "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.0" } ] } ],
|
52
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
53
|
-
"""
|
54
|
-
Given I double `aws --output json --region us-west-1 ec2 unassign-private-ip-addresses --network-interface-id 'net-123' --private-ip-addresses '0.0.0.0'` with stdout:
|
55
|
-
"""
|
56
|
-
{ "return" : "true" }
|
57
|
-
"""
|
58
|
-
When I run `bundle exec zaws compute delete_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
59
|
-
Then the output should contain "Secondary ip deleted.\n"
|
60
|
-
|
61
|
-
Scenario: Delete, skip
|
62
|
-
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:
|
63
|
-
"""
|
64
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
65
|
-
"NetworkInterfaces" : [ { "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.1" } ] } ],
|
66
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
67
|
-
"""
|
68
|
-
When I run `bundle exec zaws compute delete_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id`
|
69
|
-
Then the output should contain "Secondary IP does not exists, skipping deletion.\n"
|
70
|
-
|
71
|
-
Scenario: Nagios OK
|
72
|
-
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:
|
73
|
-
"""
|
74
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
75
|
-
"NetworkInterfaces" : [ { "NetworkInterfaceId": "net-123", "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.0" } ] } ],
|
76
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
77
|
-
"""
|
78
|
-
When I run `bundle exec zaws compute declare_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id --nagios`
|
79
|
-
Then the output should contain "OK: Secondary ip exists.\n"
|
80
|
-
|
81
|
-
Scenario: Nagios CRITICAL
|
82
|
-
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:
|
83
|
-
"""
|
84
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
85
|
-
"NetworkInterfaces" : [ { "NetworkInterfaceId": "net-123", "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.1" } ] } ],
|
86
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
87
|
-
"""
|
88
|
-
When I run `bundle exec zaws compute declare_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id --nagios`
|
89
|
-
Then the output should contain "CRITICAL: Secondary ip does not exist.\n"
|
90
|
-
|
91
|
-
Scenario: Undo file
|
92
|
-
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:
|
93
|
-
"""
|
94
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-XXXXXXX",
|
95
|
-
"NetworkInterfaces" : [ { "NetworkInterfaceId": "net-123", "PrivateIpAddresses" : [ { "PrivateIpAddress" : "0.0.0.1" } ] } ],
|
96
|
-
"Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
97
|
-
"""
|
98
|
-
Given I double `aws --output json --region us-west-1 ec2 assign-private-ip-addresses --network-interface-id 'net-123' --private-ip-addresses '0.0.0.0'` with stdout:
|
99
|
-
"""
|
100
|
-
{ "return" : "true" }
|
101
|
-
"""
|
102
|
-
Given an empty file named "undo.sh.1"
|
103
|
-
When I run `bundle exec zaws compute declare_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1`
|
104
|
-
Then the output should contain "Secondary ip assigned.\n"
|
105
|
-
And the file "undo.sh.1" should contain "zaws compute delete_secondary_ip my_instance 0.0.0.0 --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
106
|
-
|
107
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
Feature: Compute
|
2
|
-
|
3
|
-
Scenario: Get compute instances in a human readable table.
|
4
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-instances` with "AWS Compute Output"
|
5
|
-
When I run `bundle exec zaws compute view --region us-west-1 --viewtype table`
|
6
|
-
Then the stdout should contain "AWS Compute Output\n"
|
7
|
-
|
8
|
-
Scenario: Get compute instances in a human readable table form by default
|
9
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-instances` with "AWS Compute Output"
|
10
|
-
When I run `bundle exec zaws compute view --region us-west-1`
|
11
|
-
Then the stdout should contain "AWS Compute Output\n"
|
12
|
-
|
13
|
-
Scenario: Get compute instances in JSON form
|
14
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-instances` with "AWS Compute JSON Output"
|
15
|
-
When I run `bundle exec zaws compute view --region us-west-1 --viewtype json`
|
16
|
-
Then the stdout should contain "AWS Compute JSON Output\n"
|
17
|
-
|
18
|
-
Scenario: Get compute instances from specified vpcid
|
19
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-instances --filter 'Name=vpc-id,Values=my_vpc_id'` with "AWS Compute Output"
|
20
|
-
When I run `bundle exec zaws compute view --region us-west-1 --vpcid my_vpc_id`
|
21
|
-
Then the stdout should contain "AWS Compute Output\n"
|
22
|
-
|
23
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
Feature: View images
|
2
|
-
|
3
|
-
Scenario: Get compute images in a human readable table.
|
4
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-images --owner self` with "AWS Compute Output"
|
5
|
-
When I run `bundle exec zaws compute view_images --region us-west-1 --viewtype table`
|
6
|
-
Then the stdout should contain "AWS Compute Output\n"
|
7
|
-
|
8
|
-
Scenario: Get compute images in a human readable table form by default
|
9
|
-
Given I double `aws --output table --region us-west-1 ec2 describe-images --owner self` with "AWS Compute Output"
|
10
|
-
When I run `bundle exec zaws compute view_images --region us-west-1`
|
11
|
-
Then the stdout should contain "AWS Compute Output\n"
|
12
|
-
|
13
|
-
Scenario: Get compute images in JSON form
|
14
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-images --owner self` with "AWS Compute JSON Output"
|
15
|
-
When I run `bundle exec zaws compute view_images --region us-west-1 --viewtype json`
|
16
|
-
Then the stdout should contain "AWS Compute JSON Output\n"
|
17
|
-
|
18
|
-
Scenario: Get compute images for a specific owner in JSON form
|
19
|
-
Given I double `aws --output json --region us-west-1 ec2 describe-images --owner me` with "AWS Compute JSON Output"
|
20
|
-
When I run `bundle exec zaws compute view_images --region us-west-1 --viewtype json --owner me`
|
21
|
-
Then the stdout should contain "AWS Compute JSON Output\n"
|
22
|
-
|
23
|
-
|
24
|
-
|
@@ -1,138 +0,0 @@
|
|
1
|
-
Feature: Elasticip
|
2
|
-
|
3
|
-
Scenario: Determine elasticip exists for instance
|
4
|
-
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:
|
5
|
-
"""
|
6
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
7
|
-
"""
|
8
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
9
|
-
"""
|
10
|
-
{ "Addresses": [ { "InstanceId" : "i-abc1234", "PublicIp": "198.51.100.0", "Domain": "vpc", "AssociationId":"eipassoc-abcd1234", "AllocationId":"eipalloc-abcd1234"} ] }
|
11
|
-
"""
|
12
|
-
When I run `bundle exec zaws elasticip assoc_exists my_instance --region us-west-1 --vpcid my_vpc_id`
|
13
|
-
Then the output should contain "true\n"
|
14
|
-
|
15
|
-
Scenario: Determine elasticip DOES NOT exist for instance
|
16
|
-
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:
|
17
|
-
"""
|
18
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
19
|
-
"""
|
20
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
21
|
-
"""
|
22
|
-
{ "Addresses": [ ] }
|
23
|
-
"""
|
24
|
-
When I run `bundle exec zaws elasticip assoc_exists my_instance --region us-west-1 --vpcid my_vpc_id`
|
25
|
-
Then the output should contain "false\n"
|
26
|
-
|
27
|
-
Scenario: Declare elasticip for an instance by external id
|
28
|
-
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:
|
29
|
-
"""
|
30
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
31
|
-
"""
|
32
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
33
|
-
"""
|
34
|
-
{ "Addresses": [ ] }
|
35
|
-
"""
|
36
|
-
And I double `aws --region us-west-1 ec2 allocate-address --domain vpc` with stdout:
|
37
|
-
"""
|
38
|
-
{ "PublicIp": "198.51.100.0", "Domain": "vpc", "AllocationId": "eipalloc-abcd1234", "AllocationId":"eipalloc-abcd1234" }
|
39
|
-
"""
|
40
|
-
And I double `aws --region us-west-1 ec2 associate-address --instance-id i-abc1234 --allocation-id eipalloc-abcd1234` with stdout:
|
41
|
-
"""
|
42
|
-
{ "return": "true" }
|
43
|
-
"""
|
44
|
-
When I run `bundle exec zaws elasticip declare my_instance --region us-west-1 --vpcid my_vpc_id --verbose`
|
45
|
-
Then the output should contain "New elastic ip associated to instance.\n"
|
46
|
-
|
47
|
-
Scenario: Declare elasticip for an instance by external id, Skip creation
|
48
|
-
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:
|
49
|
-
"""
|
50
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
51
|
-
"""
|
52
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
53
|
-
"""
|
54
|
-
{ "Addresses": [ { "InstanceId" : "i-abc1234", "PublicIp": "198.51.100.0", "Domain": "vpc", "AssociationId":"eipassoc-abcd1234", "AllocationId":"eipalloc-abcd1234"} ] }
|
55
|
-
"""
|
56
|
-
When I run `bundle exec zaws elasticip declare my_instance --region us-west-1 --vpcid my_vpc_id`
|
57
|
-
Then the output should contain "instance already has an elastic ip. Skipping creation.\n"
|
58
|
-
|
59
|
-
Scenario: Delete
|
60
|
-
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:
|
61
|
-
"""
|
62
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
63
|
-
"""
|
64
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
65
|
-
"""
|
66
|
-
{ "Addresses": [ { "InstanceId" : "i-abc1234", "PublicIp": "198.51.100.0", "Domain": "vpc", "AssociationId":"eipassoc-abcd1234", "AllocationId":"eipalloc-abcd1234"} ] }
|
67
|
-
"""
|
68
|
-
And I double `aws --region us-west-1 ec2 disassociate-address --association-id eipassoc-abcd1234` with stdout:
|
69
|
-
"""
|
70
|
-
{ "return": "true" }
|
71
|
-
"""
|
72
|
-
And I double `aws --region us-west-1 ec2 release-address --allocation-id eipalloc-abcd1234` with stdout:
|
73
|
-
"""
|
74
|
-
{ "return": "true" }
|
75
|
-
"""
|
76
|
-
When I run `bundle exec zaws elasticip release my_instance --region us-west-1 --vpcid my_vpc_id --verbose`
|
77
|
-
Then the output should contain "Deleted elasticip.\n"
|
78
|
-
|
79
|
-
Scenario: Delete, skip
|
80
|
-
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:
|
81
|
-
"""
|
82
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
83
|
-
"""
|
84
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
85
|
-
"""
|
86
|
-
{ "Addresses": [ ] }
|
87
|
-
"""
|
88
|
-
When I run `bundle exec zaws elasticip release my_instance --region us-west-1 --vpcid my_vpc_id`
|
89
|
-
Then the output should contain "Elasticip does not exist. Skipping deletion.\n"
|
90
|
-
|
91
|
-
Scenario: Nagios OK
|
92
|
-
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:
|
93
|
-
"""
|
94
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
95
|
-
"""
|
96
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
97
|
-
"""
|
98
|
-
{ "Addresses": [ { "InstanceId" : "i-abc1234", "PublicIp": "198.51.100.0", "Domain": "vpc", "AssociationId":"eipassoc-abcd1234", "AllocationId":"eipalloc-abcd1234"} ] }
|
99
|
-
"""
|
100
|
-
When I run `bundle exec zaws elasticip declare my_instance --region us-west-1 --vpcid my_vpc_id --nagios`
|
101
|
-
Then the output should contain "OK: Elastic Ip exists.\n"
|
102
|
-
|
103
|
-
Scenario: Nagios CRITICAL
|
104
|
-
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:
|
105
|
-
"""
|
106
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
107
|
-
"""
|
108
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
109
|
-
"""
|
110
|
-
{ "Addresses": [ ] }
|
111
|
-
"""
|
112
|
-
When I run `bundle exec zaws elasticip declare my_instance --region us-west-1 --vpcid my_vpc_id --nagios`
|
113
|
-
Then the output should contain "CRITICAL: Elastic Ip DOES NOT EXIST.\n"
|
114
|
-
|
115
|
-
Scenario: Undo file
|
116
|
-
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:
|
117
|
-
"""
|
118
|
-
{ "Reservations": [ { "Instances" : [ {"InstanceId": "i-abc1234","Tags": [ { "Value": "my_instance","Key": "externalid" } ] } ] } ] }
|
119
|
-
"""
|
120
|
-
And I double `aws --output json --region us-west-1 ec2 describe-addresses --filter 'Name=domain,Values=vpc' 'Name=instance-id,Values=i-abc1234'` with stdout:
|
121
|
-
"""
|
122
|
-
{ "Addresses": [ ] }
|
123
|
-
"""
|
124
|
-
And I double `aws --region us-west-1 ec2 allocate-address --domain vpc` with stdout:
|
125
|
-
"""
|
126
|
-
{ "PublicIp": "198.51.100.0", "Domain": "vpc", "AllocationId": "eipalloc-abcd1234", "AllocationId":"eipalloc-abcd1234" }
|
127
|
-
"""
|
128
|
-
And I double `aws --region us-west-1 ec2 associate-address --instance-id i-abc1234 --allocation-id eipalloc-abcd1234` with stdout:
|
129
|
-
"""
|
130
|
-
{ "return": "true" }
|
131
|
-
"""
|
132
|
-
Given an empty file named "undo.sh.1"
|
133
|
-
When I run `bundle exec zaws elasticip declare my_instance --region us-west-1 --vpcid my_vpc_id --undofile undo.sh.1 --verbose`
|
134
|
-
Then the output should contain "New elastic ip associated to instance.\n"
|
135
|
-
And the file "undo.sh.1" should contain "zaws elasticip release my_instance --region us-west-1 --vpcid my_vpc_id $XTRA_OPTS"
|
136
|
-
|
137
|
-
|
138
|
-
|