geoengineer 0.1.3 → 0.1.4
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +8 -6
- data/lib/geoengineer.rb +2 -0
- data/lib/geoengineer/cli/geo_cli.rb +1 -4
- data/lib/geoengineer/cli/terraform_commands.rb +4 -2
- data/lib/geoengineer/environment.rb +14 -1
- data/lib/geoengineer/provider.rb +38 -0
- data/lib/geoengineer/resource.rb +29 -15
- data/lib/geoengineer/resources/api_gateway/helpers.rb +107 -0
- data/lib/geoengineer/resources/aws_alb.rb +39 -0
- data/lib/geoengineer/resources/aws_alb_listener.rb +39 -0
- data/lib/geoengineer/resources/aws_alb_listener_rule.rb +42 -0
- data/lib/geoengineer/resources/aws_alb_target_group.rb +30 -0
- data/lib/geoengineer/resources/aws_api_gateway_account.rb +18 -0
- data/lib/geoengineer/resources/aws_api_gateway_api_key.rb +20 -0
- data/lib/geoengineer/resources/aws_api_gateway_authorizer.rb +20 -0
- data/lib/geoengineer/resources/aws_api_gateway_base_path_mapping.rb +20 -0
- data/lib/geoengineer/resources/aws_api_gateway_client_certificate.rb +24 -0
- data/lib/geoengineer/resources/aws_api_gateway_deployment.rb +65 -0
- data/lib/geoengineer/resources/aws_api_gateway_domain_name.rb +27 -0
- data/lib/geoengineer/resources/aws_api_gateway_integration.rb +58 -0
- data/lib/geoengineer/resources/aws_api_gateway_integration_response.rb +68 -0
- data/lib/geoengineer/resources/aws_api_gateway_method.rb +59 -0
- data/lib/geoengineer/resources/aws_api_gateway_method_response.rb +69 -0
- data/lib/geoengineer/resources/aws_api_gateway_model.rb +19 -0
- data/lib/geoengineer/resources/aws_api_gateway_resource.rb +47 -0
- data/lib/geoengineer/resources/aws_api_gateway_rest_api.rb +79 -0
- data/lib/geoengineer/resources/aws_api_gateway_usage_plan.rb +27 -0
- data/lib/geoengineer/resources/aws_cloudfront_distribution.rb +25 -0
- data/lib/geoengineer/resources/aws_cloudtrail.rb +2 -2
- data/lib/geoengineer/resources/aws_cloudwatch_event_rule.rb +12 -3
- data/lib/geoengineer/resources/aws_cloudwatch_event_target.rb +2 -2
- data/lib/geoengineer/resources/aws_cloudwatch_metric_alarm.rb +10 -8
- data/lib/geoengineer/resources/aws_customer_gateway.rb +4 -2
- data/lib/geoengineer/resources/aws_db_instance.rb +2 -2
- data/lib/geoengineer/resources/aws_db_parameter_group.rb +4 -2
- data/lib/geoengineer/resources/aws_dynamodb_table.rb +2 -2
- data/lib/geoengineer/resources/aws_eip.rb +2 -2
- data/lib/geoengineer/resources/aws_elasticache_cluster.rb +2 -2
- data/lib/geoengineer/resources/aws_elasticache_parameter_group.rb +2 -2
- data/lib/geoengineer/resources/aws_elasticache_replication_group.rb +2 -2
- data/lib/geoengineer/resources/aws_elasticache_subnet_group.rb +2 -2
- data/lib/geoengineer/resources/aws_elasticsearch_domain.rb +2 -2
- data/lib/geoengineer/resources/aws_elb.rb +4 -2
- data/lib/geoengineer/resources/aws_iam_account_password_policy.rb +2 -1
- data/lib/geoengineer/resources/aws_iam_group.rb +2 -2
- data/lib/geoengineer/resources/aws_iam_group_membership.rb +1 -1
- data/lib/geoengineer/resources/aws_iam_instance_profile.rb +3 -3
- data/lib/geoengineer/resources/aws_iam_policy.rb +6 -4
- data/lib/geoengineer/resources/aws_iam_policy_attachment.rb +1 -1
- data/lib/geoengineer/resources/aws_iam_role.rb +2 -2
- data/lib/geoengineer/resources/aws_iam_role_policy.rb +10 -9
- data/lib/geoengineer/resources/aws_iam_user.rb +4 -4
- data/lib/geoengineer/resources/aws_instance.rb +3 -3
- data/lib/geoengineer/resources/aws_internet_gateway.rb +3 -2
- data/lib/geoengineer/resources/aws_kinesis_stream.rb +4 -4
- data/lib/geoengineer/resources/aws_kms_key.rb +5 -3
- data/lib/geoengineer/resources/aws_lambda_alias.rb +7 -7
- data/lib/geoengineer/resources/aws_lambda_event_source_mapping.rb +2 -2
- data/lib/geoengineer/resources/aws_lambda_function.rb +2 -2
- data/lib/geoengineer/resources/aws_lambda_permission.rb +9 -8
- data/lib/geoengineer/resources/aws_lb_cookie_stickiness_policy.rb +47 -0
- data/lib/geoengineer/resources/aws_load_balancer_backend_server_policy.rb +2 -2
- data/lib/geoengineer/resources/aws_load_balancer_policy.rb +5 -5
- data/lib/geoengineer/resources/aws_main_route_table_association.rb +2 -2
- data/lib/geoengineer/resources/aws_nat_gateway.rb +2 -2
- data/lib/geoengineer/resources/aws_network_acl.rb +2 -2
- data/lib/geoengineer/resources/aws_network_acl_rule.rb +2 -2
- data/lib/geoengineer/resources/aws_proxy_protocol_policy.rb +1 -1
- data/lib/geoengineer/resources/aws_redshift_cluster.rb +2 -2
- data/lib/geoengineer/resources/aws_route.rb +2 -2
- data/lib/geoengineer/resources/aws_route53_record.rb +6 -6
- data/lib/geoengineer/resources/aws_route53_zone.rb +2 -2
- data/lib/geoengineer/resources/aws_route_table.rb +2 -2
- data/lib/geoengineer/resources/aws_route_table_association.rb +2 -2
- data/lib/geoengineer/resources/aws_s3_bucket.rb +2 -2
- data/lib/geoengineer/resources/aws_s3_bucket_notification.rb +38 -0
- data/lib/geoengineer/resources/aws_security_group.rb +2 -2
- data/lib/geoengineer/resources/aws_ses_receipt_rule.rb +2 -2
- data/lib/geoengineer/resources/aws_ses_receipt_rule_set.rb +2 -2
- data/lib/geoengineer/resources/aws_sns_topic.rb +2 -2
- data/lib/geoengineer/resources/aws_sns_topic_subscription.rb +5 -5
- data/lib/geoengineer/resources/aws_sqs_queue.rb +2 -2
- data/lib/geoengineer/resources/aws_subnet.rb +2 -2
- data/lib/geoengineer/resources/aws_vpc.rb +2 -2
- data/lib/geoengineer/resources/aws_vpc_dhcp_options.rb +2 -2
- data/lib/geoengineer/resources/aws_vpc_dhcp_options_association.rb +2 -2
- data/lib/geoengineer/resources/aws_vpc_endpoint.rb +2 -2
- data/lib/geoengineer/resources/aws_vpc_peering_connection.rb +2 -2
- data/lib/geoengineer/resources/aws_vpn_connection.rb +3 -2
- data/lib/geoengineer/resources/aws_vpn_connection_route.rb +2 -2
- data/lib/geoengineer/resources/aws_vpn_gateway.rb +2 -2
- data/lib/geoengineer/resources/aws_vpn_gateway_attachment.rb +2 -2
- data/lib/geoengineer/template.rb +3 -1
- data/lib/geoengineer/templates/json_rest_api.rb +197 -0
- data/lib/geoengineer/utils/aws_clients.rb +129 -38
- data/lib/geoengineer/utils/has_templates.rb +1 -1
- data/lib/geoengineer/version.rb +1 -1
- data/spec/environment_spec.rb +1 -1
- data/spec/resource_spec.rb +24 -10
- data/spec/resources/aws_alb_listener_rule_spec.rb +45 -0
- data/spec/resources/aws_alb_listener_spec.rb +33 -0
- data/spec/resources/aws_alb_spec.rb +33 -0
- data/spec/resources/aws_alb_target_group_spec.rb +35 -0
- data/spec/resources/aws_api_gateway_account_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_api_key_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_authorizer_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_base_path_mapping_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_client_certificate_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_deployment_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_domain_name_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_integration_response_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_integration_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_method_response_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_method_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_model_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_resource_spec.rb +6 -0
- data/spec/resources/aws_api_gateway_rest_api_spec.rb +6 -0
- data/spec/resources/aws_cloudfront_distribution_spec.rb +50 -0
- data/spec/resources/aws_cloudtrail_spec.rb +3 -3
- data/spec/resources/aws_cloudwatch_event_rule_spec.rb +3 -3
- data/spec/resources/aws_cloudwatch_event_target_spec.rb +4 -6
- data/spec/resources/aws_cloudwatch_metric_alarm_spec.rb +3 -6
- data/spec/resources/aws_customer_gateway_spec.rb +4 -3
- data/spec/resources/aws_db_instance_spec.rb +3 -3
- data/spec/resources/aws_db_parameter_group_spec.rb +3 -3
- data/spec/resources/aws_dynamodb_table_spec.rb +3 -3
- data/spec/resources/aws_eip_spec.rb +3 -3
- data/spec/resources/aws_elasticache_replication_group_spec.rb +3 -6
- data/spec/resources/aws_elasticache_subnet_group_spec.rb +4 -6
- data/spec/resources/aws_elasticcache_cluster_spec.rb +3 -3
- data/spec/resources/aws_elasticcache_parameter_group_spec.rb +3 -6
- data/spec/resources/aws_elasticsearch_domain_spec.rb +3 -3
- data/spec/resources/aws_elb_spec.rb +3 -3
- data/spec/resources/aws_iam_account_password_policy_spec.rb +2 -6
- data/spec/resources/aws_iam_group_membership_spec.rb +2 -6
- data/spec/resources/aws_iam_group_spec.rb +3 -3
- data/spec/resources/aws_iam_instance_profile_spec.rb +3 -6
- data/spec/resources/aws_iam_policy_attachment_spec.rb +2 -6
- data/spec/resources/aws_iam_policy_spec.rb +3 -5
- data/spec/resources/aws_iam_role_spec.rb +3 -4
- data/spec/resources/aws_iam_rule_policy_spec.rb +2 -5
- data/spec/resources/aws_iam_user_spec.rb +3 -4
- data/spec/resources/aws_instance_spec.rb +3 -3
- data/spec/resources/aws_internet_gateway_spec.rb +3 -3
- data/spec/resources/aws_kinesis_stream_spec.rb +3 -4
- data/spec/resources/aws_kms_key_spec.rb +3 -3
- data/spec/resources/aws_lambda_alias_spec.rb +2 -3
- data/spec/resources/aws_lambda_event_source_mapping_spec.rb +2 -5
- data/spec/resources/aws_lambda_function_spec.rb +3 -4
- data/spec/resources/aws_lambda_permission_spec.rb +1 -1
- data/spec/resources/aws_lb_cookie_stickiness_policy_spec.rb +38 -0
- data/spec/resources/aws_load_balancer_backend_server_policy_spec.rb +2 -3
- data/spec/resources/aws_load_balancer_policy_spec.rb +3 -4
- data/spec/resources/aws_main_route_table_association_spec.rb +2 -5
- data/spec/resources/aws_nat_gateway_spec.rb +3 -4
- data/spec/resources/aws_network_acl_rule_spec.rb +2 -3
- data/spec/resources/aws_network_acl_spec.rb +3 -3
- data/spec/resources/aws_proxy_protocol_policy_spec.rb +2 -2
- data/spec/resources/aws_redshift_cluster_spec.rb +3 -3
- data/spec/resources/aws_route53_record_spec.rb +3 -4
- data/spec/resources/aws_route53_zone_spec.rb +3 -4
- data/spec/resources/aws_route_spec.rb +3 -6
- data/spec/resources/aws_route_table_association_spec.rb +4 -6
- data/spec/resources/aws_route_table_spec.rb +3 -3
- data/spec/resources/aws_s3_bucket_notification_spec.rb +4 -0
- data/spec/resources/aws_s3_bucket_spec.rb +3 -3
- data/spec/resources/aws_security_group_spec.rb +5 -5
- data/spec/resources/aws_ses_receipt_rule_set_spec.rb +3 -4
- data/spec/resources/aws_ses_receipt_rule_spec.rb +3 -4
- data/spec/resources/aws_sns_topic_spec.rb +10 -6
- data/spec/resources/aws_sns_topic_subscription_spec.rb +8 -7
- data/spec/resources/aws_sqs_queue_spec.rb +3 -3
- data/spec/resources/aws_subnet_spec.rb +3 -3
- data/spec/resources/aws_vpc_dhcp_options_association_spec.rb +3 -6
- data/spec/resources/aws_vpc_dhcp_options_spec.rb +3 -3
- data/spec/resources/aws_vpc_endpoint_spec.rb +3 -6
- data/spec/resources/aws_vpc_peering_connection_spec.rb +4 -6
- data/spec/resources/aws_vpc_spec.rb +3 -3
- data/spec/resources/aws_vpn_connection_route_spec.rb +3 -6
- data/spec/resources/aws_vpn_connection_spec.rb +3 -3
- data/spec/resources/aws_vpn_gateway_attachment_spec.rb +4 -6
- data/spec/resources/aws_vpn_gateway_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -1
- data/spec/support/normalize_indent.rb +12 -0
- metadata +92 -22
- metadata.gz.sig +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
common_resource_tests(
|
3
|
+
describe GeoEngineer::Resources::AwsElasticsearchDomain do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
5
|
|
6
6
|
describe "#_fetch_remote_resources" do
|
7
7
|
it 'should create list of hashes from returned AWS SDK' do
|
@@ -15,7 +15,7 @@ describe("GeoEngineer::Resources::AwsElasticsearchDomain") do
|
|
15
15
|
}
|
16
16
|
)
|
17
17
|
AwsClients.elasticsearch.stub_responses(:list_domain_names, stub)
|
18
|
-
remote_resources = GeoEngineer::Resources::AwsElasticsearchDomain._fetch_remote_resources
|
18
|
+
remote_resources = GeoEngineer::Resources::AwsElasticsearchDomain._fetch_remote_resources(nil)
|
19
19
|
expect(remote_resources.length).to eq 2
|
20
20
|
end
|
21
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
common_resource_tests(
|
3
|
+
describe GeoEngineer::Resources::AwsElb do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
5
|
|
6
6
|
describe "validations" do
|
7
7
|
it 'should validate unique lb ports for listeners' do
|
@@ -58,7 +58,7 @@ describe("GeoEngineer::Resources::AwsElb") do
|
|
58
58
|
}
|
59
59
|
)
|
60
60
|
elb.stub_responses(:describe_load_balancers, stub)
|
61
|
-
remote_resources = GeoEngineer::Resources::AwsElb._fetch_remote_resources
|
61
|
+
remote_resources = GeoEngineer::Resources::AwsElb._fetch_remote_resources(nil)
|
62
62
|
expect(remote_resources.length).to eq 2
|
63
63
|
end
|
64
64
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamAccountPasswordPolicy do
|
4
4
|
let(:aws_client) { AwsClients.iam }
|
5
5
|
|
6
6
|
before { aws_client.setup_stubbing }
|
@@ -12,11 +12,7 @@ describe 'GeoEngineer::Resources::AwsIamAccountPasswordPolicy' do
|
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
|
-
common_resource_tests(
|
16
|
-
GeoEngineer::Resources::AwsIamAccountPasswordPolicy,
|
17
|
-
'aws_iam_account_password_policy',
|
18
|
-
false
|
19
|
-
)
|
15
|
+
common_resource_tests(described_class, described_class.type_from_class_name, false)
|
20
16
|
|
21
17
|
let(:password_policy_params) do
|
22
18
|
{ require_symbols: true,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamGroupMembership do
|
4
4
|
let(:aws_client) { AwsClients.iam }
|
5
5
|
|
6
6
|
let!(:iam_user) do
|
@@ -27,11 +27,7 @@ describe "GeoEngineer::Resources::AwsIamGroupMembership" do
|
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
30
|
-
common_resource_tests(
|
31
|
-
GeoEngineer::Resources::AwsIamGroupMembership,
|
32
|
-
'aws_iam_group_membership',
|
33
|
-
false
|
34
|
-
)
|
30
|
+
common_resource_tests(described_class, described_class.type_from_class_name, false)
|
35
31
|
|
36
32
|
before do
|
37
33
|
aws_client.stub_responses(
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
common_resource_tests(
|
3
|
+
describe GeoEngineer::Resources::AwsIamGroup do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
5
|
|
6
6
|
let(:aws_client) { AwsClients.iam }
|
7
7
|
|
@@ -32,7 +32,7 @@ describe "GeoEngineer::Resource::AwsIamGroup" do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should create a list of hashes returned AWS SDK' do
|
35
|
-
resources = GeoEngineer::Resources::AwsIamGroup._fetch_remote_resources
|
35
|
+
resources = GeoEngineer::Resources::AwsIamGroup._fetch_remote_resources(nil)
|
36
36
|
expect(resources.count).to eql(2)
|
37
37
|
|
38
38
|
test_iam_group = resources.first
|
@@ -1,16 +1,13 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamInstanceProfile do
|
4
4
|
let(:aws_client) { AwsClients.iam }
|
5
5
|
|
6
6
|
before do
|
7
7
|
aws_client.setup_stubbing
|
8
8
|
end
|
9
9
|
|
10
|
-
common_resource_tests(
|
11
|
-
GeoEngineer::Resources::AwsIamInstanceProfile,
|
12
|
-
'aws_iam_instance_profile'
|
13
|
-
)
|
10
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
14
11
|
|
15
12
|
describe "#_fetch_remote_resources" do
|
16
13
|
before do
|
@@ -33,7 +30,7 @@ describe("GeoEngineer::Resources::AwsIamInstanceProfile") do
|
|
33
30
|
end
|
34
31
|
|
35
32
|
it 'should create list of profiles from returned AWS SDK' do
|
36
|
-
remote_resources = GeoEngineer::Resources::AwsIamInstanceProfile._fetch_remote_resources
|
33
|
+
remote_resources = GeoEngineer::Resources::AwsIamInstanceProfile._fetch_remote_resources(nil)
|
37
34
|
expect(remote_resources.length).to eq 1
|
38
35
|
end
|
39
36
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamPolicy do
|
4
4
|
let(:aws_client) { AwsClients.iam }
|
5
5
|
|
6
6
|
let(:iam_policy) do
|
@@ -18,11 +18,7 @@ describe "GeoEngineer::Resources::AwsIamPolicy" do
|
|
18
18
|
}
|
19
19
|
end
|
20
20
|
|
21
|
-
common_resource_tests(
|
22
|
-
GeoEngineer::Resources::AwsIamPolicyAttachment,
|
23
|
-
'aws_iam_policy_attachment',
|
24
|
-
false
|
25
|
-
)
|
21
|
+
common_resource_tests(described_class, described_class.type_from_class_name, false)
|
26
22
|
|
27
23
|
describe '#remote_resource' do
|
28
24
|
before do
|
@@ -1,11 +1,9 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamPolicy do
|
4
4
|
let(:iam_client) { AwsClients.iam }
|
5
5
|
|
6
|
-
common_resource_tests(
|
7
|
-
'aws_iam_policy')
|
8
|
-
|
6
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
9
7
|
before { iam_client.setup_stubbing }
|
10
8
|
|
11
9
|
describe "#_fetch_remote_resources" do
|
@@ -29,7 +27,7 @@ describe "GeoEngineer::Resources::AwsIamPolicy" do
|
|
29
27
|
]
|
30
28
|
}
|
31
29
|
)
|
32
|
-
remote_resources = GeoEngineer::Resources::AwsIamPolicy._fetch_remote_resources
|
30
|
+
remote_resources = GeoEngineer::Resources::AwsIamPolicy._fetch_remote_resources(nil)
|
33
31
|
expect(remote_resources.length).to eq 2
|
34
32
|
end
|
35
33
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe GeoEngineer::Resources::AwsIamRole do
|
4
4
|
let(:aws_client) { AwsClients.iam }
|
5
5
|
|
6
|
-
common_resource_tests(
|
7
|
-
|
6
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
8
7
|
before { aws_client.setup_stubbing }
|
9
8
|
|
10
9
|
describe "#_fetch_remote_resources" do
|
@@ -35,7 +34,7 @@ describe "GeoEngineer::Resources::AwsIamRole" do
|
|
35
34
|
end
|
36
35
|
|
37
36
|
it 'should create a list of hashes from the AWS SDK' do
|
38
|
-
remote_resources = GeoEngineer::Resources::AwsIamRole._fetch_remote_resources
|
37
|
+
remote_resources = GeoEngineer::Resources::AwsIamRole._fetch_remote_resources(nil)
|
39
38
|
expect(remote_resources.length).to eql 2
|
40
39
|
|
41
40
|
test_role = remote_resources.first
|
@@ -3,10 +3,7 @@ require_relative '../spec_helper'
|
|
3
3
|
describe GeoEngineer::Resources::AwsIamRolePolicy do
|
4
4
|
let(:iam_client) { AwsClients.iam }
|
5
5
|
|
6
|
-
common_resource_tests(
|
7
|
-
GeoEngineer::Resources::AwsIamRolePolicy,
|
8
|
-
'aws_iam_role_policy'
|
9
|
-
)
|
6
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
10
7
|
|
11
8
|
before { iam_client.setup_stubbing }
|
12
9
|
|
@@ -42,7 +39,7 @@ describe GeoEngineer::Resources::AwsIamRolePolicy do
|
|
42
39
|
policy_document: "{ Some Policy Here... }"
|
43
40
|
}
|
44
41
|
)
|
45
|
-
remote_resources = GeoEngineer::Resources::AwsIamRolePolicy._fetch_remote_resources
|
42
|
+
remote_resources = GeoEngineer::Resources::AwsIamRolePolicy._fetch_remote_resources(nil)
|
46
43
|
expect(remote_resources.length).to eq 1
|
47
44
|
end
|
48
45
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe(
|
3
|
+
describe(GeoEngineer::Resources::AwsIamUser) do
|
4
4
|
let(:iam_client) { AwsClients.iam }
|
5
5
|
|
6
|
-
common_resource_tests(
|
7
|
-
'aws_iam_user')
|
6
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
8
7
|
|
9
8
|
before { iam_client.setup_stubbing }
|
10
9
|
|
@@ -31,7 +30,7 @@ describe("GeoEngineer::Resources::AwsIamUser") do
|
|
31
30
|
]
|
32
31
|
}
|
33
32
|
)
|
34
|
-
remote_resources = GeoEngineer::Resources::AwsIamUser._fetch_remote_resources
|
33
|
+
remote_resources = GeoEngineer::Resources::AwsIamUser._fetch_remote_resources(nil)
|
35
34
|
expect(remote_resources.length).to eq 2
|
36
35
|
end
|
37
36
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe(
|
4
|
-
common_resource_tests(
|
3
|
+
describe(GeoEngineer::Resources::AwsInstance) do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
5
|
name_tag_geo_id_tests(GeoEngineer::Resources::AwsInstance)
|
6
6
|
|
7
7
|
describe "#_fetch_remote_resources" do
|
@@ -19,7 +19,7 @@ describe("GeoEngineer::Resources::AwsInstance") do
|
|
19
19
|
}
|
20
20
|
)
|
21
21
|
ec2.stub_responses(:describe_instances, stub)
|
22
|
-
remote_resources = GeoEngineer::Resources::AwsInstance._fetch_remote_resources
|
22
|
+
remote_resources = GeoEngineer::Resources::AwsInstance._fetch_remote_resources(nil)
|
23
23
|
expect(remote_resources.length).to eq 2
|
24
24
|
end
|
25
25
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe(
|
4
|
-
common_resource_tests(
|
3
|
+
describe(GeoEngineer::Resources::AwsInternetGateway) do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
5
|
name_tag_geo_id_tests(GeoEngineer::Resources::AwsInternetGateway)
|
6
6
|
|
7
7
|
describe "#_fetch_remote_resources" do
|
@@ -17,7 +17,7 @@ describe("GeoEngineer::Resources::AwsInternetGateway") do
|
|
17
17
|
}
|
18
18
|
)
|
19
19
|
ec2.stub_responses(:describe_internet_gateways, stub)
|
20
|
-
remote_resources = GeoEngineer::Resources::AwsInternetGateway._fetch_remote_resources
|
20
|
+
remote_resources = GeoEngineer::Resources::AwsInternetGateway._fetch_remote_resources(nil)
|
21
21
|
expect(remote_resources.length).to eq(2)
|
22
22
|
end
|
23
23
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe(
|
3
|
+
describe(GeoEngineer::Resources::AwsKinesisStream) do
|
4
4
|
let(:aws_client) { AwsClients.kinesis }
|
5
5
|
|
6
6
|
before do
|
@@ -14,8 +14,7 @@ describe("GeoEngineer::Resources::AwsKinesisStream") do
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
-
common_resource_tests(
|
18
|
-
|
17
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
19
18
|
describe "#_fetch_remote_resources" do
|
20
19
|
before do
|
21
20
|
aws_client.stub_responses(
|
@@ -46,7 +45,7 @@ describe("GeoEngineer::Resources::AwsKinesisStream") do
|
|
46
45
|
end
|
47
46
|
|
48
47
|
it 'should create list of hashes from returned AWS SDK' do
|
49
|
-
remote_resources = GeoEngineer::Resources::AwsKinesisStream._fetch_remote_resources
|
48
|
+
remote_resources = GeoEngineer::Resources::AwsKinesisStream._fetch_remote_resources(nil)
|
50
49
|
expect(remote_resources.length).to eq 1
|
51
50
|
end
|
52
51
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
require 'ostruct'
|
3
3
|
|
4
|
-
describe
|
4
|
+
describe GeoEngineer::Resources::AwsKmsKey do
|
5
5
|
let(:aws_client) { AwsClients.kms }
|
6
6
|
|
7
7
|
before { aws_client.setup_stubbing }
|
8
|
-
common_resource_tests(
|
8
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
9
9
|
|
10
10
|
let(:key_geo_id) { 'myid' }
|
11
11
|
let(:key_id) { 'some-key-id' }
|
@@ -32,7 +32,7 @@ describe "GeoEngineer::Resources::AwsKmsKey" do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should create an array of hashes from the AWS response' do
|
35
|
-
resources = GeoEngineer::Resources::AwsKmsKey._fetch_remote_resources
|
35
|
+
resources = GeoEngineer::Resources::AwsKmsKey._fetch_remote_resources(nil)
|
36
36
|
expect(resources.count).to eql 1
|
37
37
|
|
38
38
|
test_key = resources.first
|
@@ -5,8 +5,7 @@ describe GeoEngineer::Resources::AwsLambdaAlias do
|
|
5
5
|
|
6
6
|
before { aws_client.setup_stubbing }
|
7
7
|
|
8
|
-
common_resource_tests(
|
9
|
-
|
8
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
10
9
|
describe "#_fetch_remote_resources" do
|
11
10
|
before do
|
12
11
|
aws_client.stub_responses(
|
@@ -42,7 +41,7 @@ describe GeoEngineer::Resources::AwsLambdaAlias do
|
|
42
41
|
end
|
43
42
|
|
44
43
|
it 'should create list of hashes from returned AWS SDK' do
|
45
|
-
remote_resources = GeoEngineer::Resources::AwsLambdaAlias._fetch_remote_resources
|
44
|
+
remote_resources = GeoEngineer::Resources::AwsLambdaAlias._fetch_remote_resources(nil)
|
46
45
|
expect(remote_resources.length).to eq(2)
|
47
46
|
end
|
48
47
|
|
@@ -5,10 +5,7 @@ describe GeoEngineer::Resources::AwsLambdaEventSourceMapping do
|
|
5
5
|
|
6
6
|
before { aws_client.setup_stubbing }
|
7
7
|
|
8
|
-
common_resource_tests(
|
9
|
-
GeoEngineer::Resources::AwsLambdaEventSourceMapping,
|
10
|
-
'aws_lambda_event_source_mapping'
|
11
|
-
)
|
8
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
12
9
|
|
13
10
|
describe '#_fetch_remote_resources' do
|
14
11
|
before do
|
@@ -33,7 +30,7 @@ describe GeoEngineer::Resources::AwsLambdaEventSourceMapping do
|
|
33
30
|
after { aws_client.stub_responses(:list_event_source_mappings, {}) }
|
34
31
|
|
35
32
|
it 'should create an array of hashes from the AWS response' do
|
36
|
-
resources = GeoEngineer::Resources::AwsLambdaEventSourceMapping._fetch_remote_resources
|
33
|
+
resources = GeoEngineer::Resources::AwsLambdaEventSourceMapping._fetch_remote_resources(nil)
|
37
34
|
expect(resources.count).to eql(2)
|
38
35
|
end
|
39
36
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
require_relative '../spec_helper'
|
2
2
|
|
3
|
-
describe(
|
3
|
+
describe(GeoEngineer::Resources::AwsLambdaFunction) do
|
4
4
|
let(:aws_client) { AwsClients.lambda }
|
5
5
|
|
6
6
|
before { aws_client.setup_stubbing }
|
7
7
|
|
8
|
-
common_resource_tests(
|
9
|
-
|
8
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
10
9
|
describe '#_fetch_remote_resources' do
|
11
10
|
before do
|
12
11
|
aws_client.stub_responses(
|
@@ -22,7 +21,7 @@ describe("GeoEngineer::Resources::AwsLambdaFunction") do
|
|
22
21
|
after { aws_client.stub_responses(:list_functions, {}) }
|
23
22
|
|
24
23
|
it 'should create an array of hashes from the AWS response' do
|
25
|
-
resources = GeoEngineer::Resources::AwsLambdaFunction._fetch_remote_resources
|
24
|
+
resources = GeoEngineer::Resources::AwsLambdaFunction._fetch_remote_resources(nil)
|
26
25
|
expect(resources.count).to eql(2)
|
27
26
|
end
|
28
27
|
end
|
@@ -30,7 +30,7 @@ describe GeoEngineer::Resources::AwsLambdaPermission do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should create list of hashes from returned AWS SDK' do
|
33
|
-
remote_resources = GeoEngineer::Resources::AwsLambdaPermission._fetch_remote_resources
|
33
|
+
remote_resources = GeoEngineer::Resources::AwsLambdaPermission._fetch_remote_resources(nil)
|
34
34
|
expect(remote_resources.length).to eq(2)
|
35
35
|
end
|
36
36
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe GeoEngineer::Resources::AwsLbCookieStickinessPolicy do
|
4
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
5
|
+
|
6
|
+
describe "#_fetch_remote_resources" do
|
7
|
+
it 'should create list of hashes from returned AWS SDK' do
|
8
|
+
elb = AwsClients.elb
|
9
|
+
stub = elb.stub_data(
|
10
|
+
:describe_load_balancers,
|
11
|
+
{
|
12
|
+
load_balancer_descriptions: [
|
13
|
+
{
|
14
|
+
load_balancer_name: 'name1',
|
15
|
+
listener_descriptions: [
|
16
|
+
{ listener: { load_balancer_port: 443 }, policy_names: ['foo-bar'] }
|
17
|
+
],
|
18
|
+
policies: {
|
19
|
+
lb_cookie_stickiness_policies: [
|
20
|
+
{ policy_name: 'foo-bar', cookie_expiration_period: 0 }
|
21
|
+
]
|
22
|
+
}
|
23
|
+
},
|
24
|
+
{
|
25
|
+
load_balancer_name: 'name2',
|
26
|
+
policies: {
|
27
|
+
lb_cookie_stickiness_policies: []
|
28
|
+
}
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
)
|
33
|
+
elb.stub_responses(:describe_load_balancers, stub)
|
34
|
+
remote_resources = described_class._fetch_remote_resources(nil)
|
35
|
+
expect(remote_resources.length).to eq 1
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -3,8 +3,7 @@ require_relative '../spec_helper'
|
|
3
3
|
describe GeoEngineer::Resources::AwsLoadBalancerBackendServerPolicy do
|
4
4
|
let(:elb_client) { AwsClients.elb }
|
5
5
|
|
6
|
-
common_resource_tests(
|
7
|
-
'aws_load_balancer_backend_server_policy')
|
6
|
+
common_resource_tests(described_class, described_class.type_from_class_name)
|
8
7
|
|
9
8
|
before { elb_client.setup_stubbing }
|
10
9
|
|
@@ -35,7 +34,7 @@ describe GeoEngineer::Resources::AwsLoadBalancerBackendServerPolicy do
|
|
35
34
|
]
|
36
35
|
}
|
37
36
|
)
|
38
|
-
remote_resources = described_class._fetch_remote_resources
|
37
|
+
remote_resources = described_class._fetch_remote_resources(nil)
|
39
38
|
expect(remote_resources.length).to eq 2
|
40
39
|
end
|
41
40
|
end
|