cmonson_2ndwatch_awspec 0.85.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +12 -0
- data/.gitignore +10 -0
- data/.rubocop.yml +87 -0
- data/.tachikoma.yml +1 -0
- data/.travis.yml +12 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +126 -0
- data/Rakefile +54 -0
- data/awspec-logo.png +0 -0
- data/awspec.gemspec +35 -0
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/bin/toolbox +5 -0
- data/doc/_resource_types/acm.md +15 -0
- data/doc/_resource_types/alb.md +39 -0
- data/doc/_resource_types/alb_listener.md +29 -0
- data/doc/_resource_types/alb_target_group.md +35 -0
- data/doc/_resource_types/ami.md +19 -0
- data/doc/_resource_types/autoscaling_group.md +47 -0
- data/doc/_resource_types/cloudformation_stack.md +8 -0
- data/doc/_resource_types/cloudfront_distribution.md +44 -0
- data/doc/_resource_types/cloudtrail.md +39 -0
- data/doc/_resource_types/cloudwatch_alarm.md +39 -0
- data/doc/_resource_types/cloudwatch_logs.md +40 -0
- data/doc/_resource_types/customer_gateway.md +25 -0
- data/doc/_resource_types/directconnect_virtual_interface.md +30 -0
- data/doc/_resource_types/dynamodb_table.md +52 -0
- data/doc/_resource_types/ebs.md +49 -0
- data/doc/_resource_types/ec2.md +153 -0
- data/doc/_resource_types/ec2_account_attributes.md +8 -0
- data/doc/_resource_types/ecs_cluster.md +23 -0
- data/doc/_resource_types/ecs_container_instance.md +18 -0
- data/doc/_resource_types/ecs_service.md +15 -0
- data/doc/_resource_types/ecs_task_definition.md +15 -0
- data/doc/_resource_types/efs.md +15 -0
- data/doc/_resource_types/eip.md +23 -0
- data/doc/_resource_types/elasticache.md +57 -0
- data/doc/_resource_types/elasticache_cache_parameter_group.md +17 -0
- data/doc/_resource_types/elasticsearch.md +48 -0
- data/doc/_resource_types/elastictranscoder_pipeline.md +15 -0
- data/doc/_resource_types/elb.md +49 -0
- data/doc/_resource_types/iam_group.md +86 -0
- data/doc/_resource_types/iam_policy.md +39 -0
- data/doc/_resource_types/iam_role.md +70 -0
- data/doc/_resource_types/iam_user.md +78 -0
- data/doc/_resource_types/internet_gateway.md +31 -0
- data/doc/_resource_types/kms.md +70 -0
- data/doc/_resource_types/lambda.md +11 -0
- data/doc/_resource_types/lambda_account_settings.md +10 -0
- data/doc/_resource_types/launch_configuration.md +15 -0
- data/doc/_resource_types/nat_gateway.md +31 -0
- data/doc/_resource_types/network_acl.md +61 -0
- data/doc/_resource_types/network_interface.md +66 -0
- data/doc/_resource_types/rds.md +92 -0
- data/doc/_resource_types/rds_account_attributes.md +8 -0
- data/doc/_resource_types/rds_db_cluster_parameter_group.md +16 -0
- data/doc/_resource_types/rds_db_parameter_group.md +15 -0
- data/doc/_resource_types/route53_hosted_zone.md +25 -0
- data/doc/_resource_types/route_table.md +53 -0
- data/doc/_resource_types/s3_bucket.md +138 -0
- data/doc/_resource_types/security_group.md +44 -0
- data/doc/_resource_types/ses_identity.md +17 -0
- data/doc/_resource_types/ses_send_quota.md +9 -0
- data/doc/_resource_types/sqs.md +7 -0
- data/doc/_resource_types/subnet.md +41 -0
- data/doc/_resource_types/vpc.md +59 -0
- data/doc/_resource_types/vpn_connection.md +25 -0
- data/doc/_resource_types/vpn_gateway.md +25 -0
- data/doc/_resource_types/waf_web_acl.md +29 -0
- data/doc/contributing.md +36 -0
- data/doc/resource_types.md +2779 -0
- data/exe/awspec +5 -0
- data/lib/awspec.rb +20 -0
- data/lib/awspec/cli.rb +25 -0
- data/lib/awspec/command/generate.rb +57 -0
- data/lib/awspec/error.rb +6 -0
- data/lib/awspec/ext.rb +3 -0
- data/lib/awspec/ext/array.rb +8 -0
- data/lib/awspec/ext/hash.rb +10 -0
- data/lib/awspec/ext/struct.rb +8 -0
- data/lib/awspec/generator.rb +46 -0
- data/lib/awspec/generator/doc/type.rb +60 -0
- data/lib/awspec/generator/doc/type/account.rb +71 -0
- data/lib/awspec/generator/doc/type/account_attribute.rb +69 -0
- data/lib/awspec/generator/doc/type/account_attribute_base.rb +32 -0
- data/lib/awspec/generator/doc/type/acm.rb +19 -0
- data/lib/awspec/generator/doc/type/alb.rb +20 -0
- data/lib/awspec/generator/doc/type/alb_listener.rb +18 -0
- data/lib/awspec/generator/doc/type/alb_target_group.rb +17 -0
- data/lib/awspec/generator/doc/type/ami.rb +19 -0
- data/lib/awspec/generator/doc/type/autoscaling_group.rb +16 -0
- data/lib/awspec/generator/doc/type/base.rb +99 -0
- data/lib/awspec/generator/doc/type/cloudformation_stack.rb +17 -0
- data/lib/awspec/generator/doc/type/cloudfront_distribution.rb +20 -0
- data/lib/awspec/generator/doc/type/cloudtrail.rb +17 -0
- data/lib/awspec/generator/doc/type/cloudwatch_alarm.rb +17 -0
- data/lib/awspec/generator/doc/type/cloudwatch_event.rb +17 -0
- data/lib/awspec/generator/doc/type/cloudwatch_logs.rb +17 -0
- data/lib/awspec/generator/doc/type/customer_gateway.rb +19 -0
- data/lib/awspec/generator/doc/type/directconnect_virtual_interface.rb +21 -0
- data/lib/awspec/generator/doc/type/dynamodb_table.rb +19 -0
- data/lib/awspec/generator/doc/type/ebs.rb +19 -0
- data/lib/awspec/generator/doc/type/ec2.rb +21 -0
- data/lib/awspec/generator/doc/type/ec2_account_attributes.rb +17 -0
- data/lib/awspec/generator/doc/type/ecr_repository.rb +15 -0
- data/lib/awspec/generator/doc/type/ecs_cluster.rb +19 -0
- data/lib/awspec/generator/doc/type/ecs_container_instance.rb +19 -0
- data/lib/awspec/generator/doc/type/ecs_service.rb +19 -0
- data/lib/awspec/generator/doc/type/ecs_task_definition.rb +19 -0
- data/lib/awspec/generator/doc/type/efs.rb +17 -0
- data/lib/awspec/generator/doc/type/eip.rb +17 -0
- data/lib/awspec/generator/doc/type/elasticache.rb +22 -0
- data/lib/awspec/generator/doc/type/elasticache_cache_parameter_group.rb +17 -0
- data/lib/awspec/generator/doc/type/elasticsearch.rb +17 -0
- data/lib/awspec/generator/doc/type/elastictranscoder_pipeline.rb +21 -0
- data/lib/awspec/generator/doc/type/elb.rb +20 -0
- data/lib/awspec/generator/doc/type/iam_group.rb +17 -0
- data/lib/awspec/generator/doc/type/iam_policy.rb +17 -0
- data/lib/awspec/generator/doc/type/iam_role.rb +17 -0
- data/lib/awspec/generator/doc/type/iam_user.rb +17 -0
- data/lib/awspec/generator/doc/type/internet_gateway.rb +17 -0
- data/lib/awspec/generator/doc/type/kms.rb +17 -0
- data/lib/awspec/generator/doc/type/lambda.rb +17 -0
- data/lib/awspec/generator/doc/type/lambda_account_settings.rb +17 -0
- data/lib/awspec/generator/doc/type/launch_configuration.rb +17 -0
- data/lib/awspec/generator/doc/type/nat_gateway.rb +20 -0
- data/lib/awspec/generator/doc/type/network_acl.rb +20 -0
- data/lib/awspec/generator/doc/type/network_interface.rb +21 -0
- data/lib/awspec/generator/doc/type/rds.rb +22 -0
- data/lib/awspec/generator/doc/type/rds_account_attributes.rb +17 -0
- data/lib/awspec/generator/doc/type/rds_db_cluster_parameter_group.rb +15 -0
- data/lib/awspec/generator/doc/type/rds_db_parameter_group.rb +15 -0
- data/lib/awspec/generator/doc/type/route53_hosted_zone.rb +16 -0
- data/lib/awspec/generator/doc/type/route_table.rb +16 -0
- data/lib/awspec/generator/doc/type/s3_bucket.rb +16 -0
- data/lib/awspec/generator/doc/type/security_group.rb +16 -0
- data/lib/awspec/generator/doc/type/ses_identity.rb +22 -0
- data/lib/awspec/generator/doc/type/ses_send_quota.rb +17 -0
- data/lib/awspec/generator/doc/type/sqs.rb +17 -0
- data/lib/awspec/generator/doc/type/subnet.rb +18 -0
- data/lib/awspec/generator/doc/type/vpc.rb +19 -0
- data/lib/awspec/generator/doc/type/vpn_connection.rb +19 -0
- data/lib/awspec/generator/doc/type/vpn_gateway.rb +19 -0
- data/lib/awspec/generator/doc/type/waf_web_acl.rb +17 -0
- data/lib/awspec/generator/spec/acm.rb +27 -0
- data/lib/awspec/generator/spec/alb.rb +38 -0
- data/lib/awspec/generator/spec/cloudwatch_alarm.rb +40 -0
- data/lib/awspec/generator/spec/cloudwatch_event.rb +27 -0
- data/lib/awspec/generator/spec/cloudwatch_logs.rb +68 -0
- data/lib/awspec/generator/spec/directconnect.rb +33 -0
- data/lib/awspec/generator/spec/ebs.rb +55 -0
- data/lib/awspec/generator/spec/ec2.rb +78 -0
- data/lib/awspec/generator/spec/efs.rb +28 -0
- data/lib/awspec/generator/spec/eip.rb +30 -0
- data/lib/awspec/generator/spec/elasticsearch.rb +41 -0
- data/lib/awspec/generator/spec/elb.rb +56 -0
- data/lib/awspec/generator/spec/iam_group.rb +39 -0
- data/lib/awspec/generator/spec/iam_policy.rb +56 -0
- data/lib/awspec/generator/spec/iam_role.rb +39 -0
- data/lib/awspec/generator/spec/iam_user.rb +39 -0
- data/lib/awspec/generator/spec/internet_gateway.rb +35 -0
- data/lib/awspec/generator/spec/kms.rb +26 -0
- data/lib/awspec/generator/spec/lambda.rb +29 -0
- data/lib/awspec/generator/spec/nat_gateway.rb +39 -0
- data/lib/awspec/generator/spec/network_acl.rb +96 -0
- data/lib/awspec/generator/spec/network_interface.rb +80 -0
- data/lib/awspec/generator/spec/rds.rb +62 -0
- data/lib/awspec/generator/spec/route53_hosted_zone.rb +52 -0
- data/lib/awspec/generator/spec/route_table.rb +128 -0
- data/lib/awspec/generator/spec/s3_bucket.rb +70 -0
- data/lib/awspec/generator/spec/security_group.rb +95 -0
- data/lib/awspec/generator/spec/subnet.rb +47 -0
- data/lib/awspec/generator/spec/vpc.rb +57 -0
- data/lib/awspec/generator/template.rb +146 -0
- data/lib/awspec/helper.rb +8 -0
- data/lib/awspec/helper/color.rb +5 -0
- data/lib/awspec/helper/finder.rb +119 -0
- data/lib/awspec/helper/finder/account_attributes.rb +61 -0
- data/lib/awspec/helper/finder/acm.rb +18 -0
- data/lib/awspec/helper/finder/alb.rb +48 -0
- data/lib/awspec/helper/finder/ami.rb +22 -0
- data/lib/awspec/helper/finder/autoscaling.rb +34 -0
- data/lib/awspec/helper/finder/cloudformation.rb +12 -0
- data/lib/awspec/helper/finder/cloudfront.rb +18 -0
- data/lib/awspec/helper/finder/cloudtrail.rb +23 -0
- data/lib/awspec/helper/finder/cloudwatch.rb +30 -0
- data/lib/awspec/helper/finder/cloudwatch_event.rb +15 -0
- data/lib/awspec/helper/finder/cloudwatch_logs.rb +68 -0
- data/lib/awspec/helper/finder/directconnect.rb +19 -0
- data/lib/awspec/helper/finder/dynamodb.rb +10 -0
- data/lib/awspec/helper/finder/ebs.rb +40 -0
- data/lib/awspec/helper/finder/ec2.rb +158 -0
- data/lib/awspec/helper/finder/ecr.rb +10 -0
- data/lib/awspec/helper/finder/ecs.rb +45 -0
- data/lib/awspec/helper/finder/efs.rb +63 -0
- data/lib/awspec/helper/finder/elasticache.rb +21 -0
- data/lib/awspec/helper/finder/elasticsearch.rb +19 -0
- data/lib/awspec/helper/finder/elastictranscoder.rb +18 -0
- data/lib/awspec/helper/finder/elb.rb +21 -0
- data/lib/awspec/helper/finder/iam.rb +108 -0
- data/lib/awspec/helper/finder/kms.rb +22 -0
- data/lib/awspec/helper/finder/lambda.rb +32 -0
- data/lib/awspec/helper/finder/rds.rb +25 -0
- data/lib/awspec/helper/finder/route53.rb +31 -0
- data/lib/awspec/helper/finder/s3.rb +64 -0
- data/lib/awspec/helper/finder/security_group.rb +35 -0
- data/lib/awspec/helper/finder/ses.rb +13 -0
- data/lib/awspec/helper/finder/sqs.rb +12 -0
- data/lib/awspec/helper/finder/subnet.rb +29 -0
- data/lib/awspec/helper/finder/vpc.rb +77 -0
- data/lib/awspec/helper/finder/waf.rb +53 -0
- data/lib/awspec/helper/type.rb +67 -0
- data/lib/awspec/matcher.rb +62 -0
- data/lib/awspec/matcher/be_allowed.rb +25 -0
- data/lib/awspec/matcher/be_allowed_action.rb +19 -0
- data/lib/awspec/matcher/be_attached_to.rb +19 -0
- data/lib/awspec/matcher/be_denied.rb +25 -0
- data/lib/awspec/matcher/be_opened.rb +17 -0
- data/lib/awspec/matcher/be_opened_only.rb +17 -0
- data/lib/awspec/matcher/belong_to_alb.rb +8 -0
- data/lib/awspec/matcher/belong_to_cache_subnet_group.rb +5 -0
- data/lib/awspec/matcher/belong_to_db_subnet_group.rb +5 -0
- data/lib/awspec/matcher/belong_to_domain.rb +5 -0
- data/lib/awspec/matcher/belong_to_iam_group.rb +8 -0
- data/lib/awspec/matcher/belong_to_metric.rb +13 -0
- data/lib/awspec/matcher/belong_to_replication_group.rb +6 -0
- data/lib/awspec/matcher/belong_to_subnet.rb +31 -0
- data/lib/awspec/matcher/belong_to_vpc.rb +8 -0
- data/lib/awspec/matcher/have_attribute_definition.rb +9 -0
- data/lib/awspec/matcher/have_inline_policy.rb +9 -0
- data/lib/awspec/matcher/have_key_policy.rb +9 -0
- data/lib/awspec/matcher/have_key_schema.rb +9 -0
- data/lib/awspec/matcher/have_network_interface.rb +15 -0
- data/lib/awspec/matcher/have_origin.rb +21 -0
- data/lib/awspec/matcher/have_private_ip_address.rb +9 -0
- data/lib/awspec/matcher/have_record_set.rb +32 -0
- data/lib/awspec/matcher/have_route.rb +36 -0
- data/lib/awspec/matcher/have_rule.rb +34 -0
- data/lib/awspec/matcher/have_subscription_filter.rb +9 -0
- data/lib/awspec/matcher/have_tag.rb +9 -0
- data/lib/awspec/resource_reader.rb +54 -0
- data/lib/awspec/setup.rb +84 -0
- data/lib/awspec/shared_context.rb +25 -0
- data/lib/awspec/stub.rb +7 -0
- data/lib/awspec/stub/account.rb +146 -0
- data/lib/awspec/stub/acm.rb +20 -0
- data/lib/awspec/stub/alb.rb +252 -0
- data/lib/awspec/stub/alb_listener.rb +307 -0
- data/lib/awspec/stub/alb_target_group.rb +325 -0
- data/lib/awspec/stub/ami.rb +58 -0
- data/lib/awspec/stub/autoscaling_group.rb +241 -0
- data/lib/awspec/stub/cloudformation_stack.rb +49 -0
- data/lib/awspec/stub/cloudfront_distribution.rb +210 -0
- data/lib/awspec/stub/cloudtrail.rb +17 -0
- data/lib/awspec/stub/cloudwatch_alarm.rb +39 -0
- data/lib/awspec/stub/cloudwatch_event.rb +15 -0
- data/lib/awspec/stub/cloudwatch_logs.rb +34 -0
- data/lib/awspec/stub/customer_gateway.rb +16 -0
- data/lib/awspec/stub/directconnect_virtual_interface.rb +25 -0
- data/lib/awspec/stub/duplicated_resource_type.rb +26 -0
- data/lib/awspec/stub/dynamodb_table.rb +34 -0
- data/lib/awspec/stub/ebs.rb +67 -0
- data/lib/awspec/stub/ec2.rb +227 -0
- data/lib/awspec/stub/ec2_has_multi_security_groups.rb +21 -0
- data/lib/awspec/stub/ecr_repository.rb +13 -0
- data/lib/awspec/stub/ecs.rb +199 -0
- data/lib/awspec/stub/ecs_cluster.rb +99 -0
- data/lib/awspec/stub/ecs_container_instance.rb +78 -0
- data/lib/awspec/stub/ecs_service.rb +51 -0
- data/lib/awspec/stub/ecs_task_definition.rb +58 -0
- data/lib/awspec/stub/efs.rb +33 -0
- data/lib/awspec/stub/eip.rb +13 -0
- data/lib/awspec/stub/elasticache.rb +91 -0
- data/lib/awspec/stub/elasticache_cache_parameter_group.rb +16 -0
- data/lib/awspec/stub/elasticsearch.rb +52 -0
- data/lib/awspec/stub/elastictranscoder_pipeline.rb +63 -0
- data/lib/awspec/stub/elb.rb +129 -0
- data/lib/awspec/stub/iam_group.rb +90 -0
- data/lib/awspec/stub/iam_policy.rb +70 -0
- data/lib/awspec/stub/iam_role.rb +60 -0
- data/lib/awspec/stub/iam_user.rb +71 -0
- data/lib/awspec/stub/internet_gateway.rb +36 -0
- data/lib/awspec/stub/kms.rb +71 -0
- data/lib/awspec/stub/lambda.rb +21 -0
- data/lib/awspec/stub/launch_configuration.rb +56 -0
- data/lib/awspec/stub/nat_gateway.rb +35 -0
- data/lib/awspec/stub/network_acl.rb +97 -0
- data/lib/awspec/stub/network_interface.rb +144 -0
- data/lib/awspec/stub/rds.rb +102 -0
- data/lib/awspec/stub/rds_db_cluster_parameter_group.rb +20 -0
- data/lib/awspec/stub/rds_db_parameter_group.rb +20 -0
- data/lib/awspec/stub/route53_hosted_zone.rb +103 -0
- data/lib/awspec/stub/route_table.rb +207 -0
- data/lib/awspec/stub/s3_bucket.rb +80 -0
- data/lib/awspec/stub/security_group.rb +149 -0
- data/lib/awspec/stub/ses_identity.rb +41 -0
- data/lib/awspec/stub/sqs.rb +25 -0
- data/lib/awspec/stub/subnet.rb +33 -0
- data/lib/awspec/stub/vpc.rb +69 -0
- data/lib/awspec/stub/vpn_connection.rb +20 -0
- data/lib/awspec/stub/vpn_gateway.rb +15 -0
- data/lib/awspec/stub/waf_web_acl.rb +62 -0
- data/lib/awspec/toolbox.rb +18 -0
- data/lib/awspec/type/account.rb +35 -0
- data/lib/awspec/type/account_attribute.rb +28 -0
- data/lib/awspec/type/account_attribute_base.rb +4 -0
- data/lib/awspec/type/acm.rb +27 -0
- data/lib/awspec/type/alb.rb +42 -0
- data/lib/awspec/type/alb_listener.rb +36 -0
- data/lib/awspec/type/alb_target_group.rb +22 -0
- data/lib/awspec/type/ami.rb +25 -0
- data/lib/awspec/type/autoscaling_group.rb +46 -0
- data/lib/awspec/type/base.rb +47 -0
- data/lib/awspec/type/cloudformation_stack.rb +11 -0
- data/lib/awspec/type/cloudfront_distribution.rb +46 -0
- data/lib/awspec/type/cloudtrail.rb +29 -0
- data/lib/awspec/type/cloudwatch_alarm.rb +23 -0
- data/lib/awspec/type/cloudwatch_event.rb +19 -0
- data/lib/awspec/type/cloudwatch_logs.rb +31 -0
- data/lib/awspec/type/customer_gateway.rb +40 -0
- data/lib/awspec/type/directconnect_virtual_interface.rb +27 -0
- data/lib/awspec/type/dynamodb_table.rb +40 -0
- data/lib/awspec/type/ebs.rb +37 -0
- data/lib/awspec/type/ec2.rb +145 -0
- data/lib/awspec/type/ec2_account_attributes.rb +7 -0
- data/lib/awspec/type/ecr_repository.rb +18 -0
- data/lib/awspec/type/ecs_cluster.rb +46 -0
- data/lib/awspec/type/ecs_container_instance.rb +30 -0
- data/lib/awspec/type/ecs_service.rb +24 -0
- data/lib/awspec/type/ecs_task_definition.rb +24 -0
- data/lib/awspec/type/efs.rb +22 -0
- data/lib/awspec/type/eip.rb +16 -0
- data/lib/awspec/type/elasticache.rb +68 -0
- data/lib/awspec/type/elasticache_cache_parameter_group.rb +38 -0
- data/lib/awspec/type/elasticsearch.rb +23 -0
- data/lib/awspec/type/elastictranscoder_pipeline.rb +21 -0
- data/lib/awspec/type/elb.rb +61 -0
- data/lib/awspec/type/iam_group.rb +39 -0
- data/lib/awspec/type/iam_policy.rb +54 -0
- data/lib/awspec/type/iam_role.rb +29 -0
- data/lib/awspec/type/iam_user.rb +29 -0
- data/lib/awspec/type/internet_gateway.rb +20 -0
- data/lib/awspec/type/kms.rb +21 -0
- data/lib/awspec/type/lambda.rb +22 -0
- data/lib/awspec/type/lambda_account_settings.rb +7 -0
- data/lib/awspec/type/launch_configuration.rb +28 -0
- data/lib/awspec/type/nat_gateway.rb +27 -0
- data/lib/awspec/type/network_acl.rb +117 -0
- data/lib/awspec/type/network_interface.rb +56 -0
- data/lib/awspec/type/rds.rb +100 -0
- data/lib/awspec/type/rds_account_attributes.rb +7 -0
- data/lib/awspec/type/rds_db_cluster_parameter_group.rb +34 -0
- data/lib/awspec/type/rds_db_parameter_group.rb +34 -0
- data/lib/awspec/type/resource_base.rb +24 -0
- data/lib/awspec/type/route53_hosted_zone.rb +35 -0
- data/lib/awspec/type/route_table.rb +78 -0
- data/lib/awspec/type/s3_bucket.rb +112 -0
- data/lib/awspec/type/security_group.rb +137 -0
- data/lib/awspec/type/ses_identity.rb +70 -0
- data/lib/awspec/type/ses_send_quota.rb +7 -0
- data/lib/awspec/type/sqs.rb +31 -0
- data/lib/awspec/type/subnet.rb +39 -0
- data/lib/awspec/type/vpc.rb +36 -0
- data/lib/awspec/type/vpn_connection.rb +40 -0
- data/lib/awspec/type/vpn_gateway.rb +40 -0
- data/lib/awspec/type/waf_web_acl.rb +24 -0
- data/lib/awspec/version.rb +3 -0
- metadata +587 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
Aws.config[:sqs] = {
|
2
|
+
stub_responses: {
|
3
|
+
list_queues: {
|
4
|
+
queue_urls: [
|
5
|
+
'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue',
|
6
|
+
'https://sqs.ap-northeast-1.amazonaws.com/123456789012/my-queue2'
|
7
|
+
]
|
8
|
+
},
|
9
|
+
get_queue_attributes: {
|
10
|
+
attributes: {
|
11
|
+
'QueueArn' => 'arn:aws:sqs:ap-northeast-1:123456789012:my-queue',
|
12
|
+
'ApproximateNumberOfMessages' => '0',
|
13
|
+
'ApproximateNumberOfMessagesNotVisible' => '0',
|
14
|
+
'ApproximateNumberOfMessagesDelayed' => '0',
|
15
|
+
'CreatedTimestamp' => '1499422322',
|
16
|
+
'LastModifiedTimestamp' => '1499422322',
|
17
|
+
'VisibilityTimeout' => '30',
|
18
|
+
'MaximumMessageSize' => '262144',
|
19
|
+
'MessageRetentionPeriod' => '345600',
|
20
|
+
'DelaySeconds' => '0',
|
21
|
+
'ReceiveMessageWaitTimeSeconds' => '0'
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Aws.config[:ec2] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_vpcs: {
|
4
|
+
vpcs: [
|
5
|
+
{
|
6
|
+
vpc_id: 'vpc-ab123cde',
|
7
|
+
tags: [
|
8
|
+
{
|
9
|
+
key: 'Name',
|
10
|
+
value: 'my-vpc'
|
11
|
+
}
|
12
|
+
]
|
13
|
+
}
|
14
|
+
]
|
15
|
+
},
|
16
|
+
describe_subnets: {
|
17
|
+
subnets: [
|
18
|
+
{
|
19
|
+
state: 'available',
|
20
|
+
vpc_id: 'vpc-ab123cde',
|
21
|
+
subnet_id: 'subnet-1234a567',
|
22
|
+
cidr_block: '10.0.1.0/24',
|
23
|
+
tags: [
|
24
|
+
{
|
25
|
+
key: 'Name',
|
26
|
+
value: 'my-subnet'
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
Aws.config[:ec2] = {
|
2
|
+
stub_responses: {
|
3
|
+
describe_vpcs: {
|
4
|
+
vpcs: [
|
5
|
+
{
|
6
|
+
vpc_id: 'vpc-ab123cde',
|
7
|
+
state: 'available',
|
8
|
+
cidr_block: '10.0.0.0/16',
|
9
|
+
tags: [
|
10
|
+
{
|
11
|
+
key: 'Name',
|
12
|
+
value: 'my-vpc'
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
describe_route_tables: {
|
19
|
+
route_tables: [
|
20
|
+
{
|
21
|
+
route_table_id: 'rtb-a12bcd34',
|
22
|
+
vpc_id: 'vpc-ab123cde',
|
23
|
+
routes: [
|
24
|
+
{
|
25
|
+
destination_cidr_block: '10.0.0.0/16',
|
26
|
+
destination_prefix_list_id: nil,
|
27
|
+
gateway_id: 'local',
|
28
|
+
instance_id: nil,
|
29
|
+
instance_owner_id: nil,
|
30
|
+
network_interface_id: nil,
|
31
|
+
vpc_peering_connection_id: nil,
|
32
|
+
state: 'active'
|
33
|
+
},
|
34
|
+
{
|
35
|
+
destination_cidr_block: '0.0.0.0/0',
|
36
|
+
destination_prefix_list_id: nil,
|
37
|
+
gateway_id: 'igw-1ab2345c',
|
38
|
+
instance_id: nil,
|
39
|
+
instance_owner_id: nil,
|
40
|
+
network_interface_id: nil,
|
41
|
+
vpc_peering_connection_id: nil,
|
42
|
+
state: 'active'
|
43
|
+
}
|
44
|
+
],
|
45
|
+
tags: [
|
46
|
+
{
|
47
|
+
key: 'Name',
|
48
|
+
value: 'my-route-table'
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
52
|
+
]
|
53
|
+
},
|
54
|
+
describe_network_acls: {
|
55
|
+
network_acls: [
|
56
|
+
{
|
57
|
+
network_acl_id: 'acl-1abc2d3e',
|
58
|
+
vpc_id: 'vpc-ab123cde',
|
59
|
+
tags: [
|
60
|
+
{
|
61
|
+
key: 'Name',
|
62
|
+
value: 'my-network-acl'
|
63
|
+
}
|
64
|
+
]
|
65
|
+
}
|
66
|
+
]
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# rubocop:disable all
|
2
|
+
Aws.config[:ec2] = {
|
3
|
+
stub_responses: {
|
4
|
+
describe_vpn_connections: {
|
5
|
+
vpn_connections: [
|
6
|
+
{
|
7
|
+
vpn_connection_id: 'vpn-cg5692g4',
|
8
|
+
customer_gateway_id: 'cgw-cg5692g4',
|
9
|
+
vpn_gateway_id: 'vgw-cg5692g4',
|
10
|
+
state: 'available',
|
11
|
+
type: "ipsec.1",
|
12
|
+
tags: [
|
13
|
+
key: 'Name',
|
14
|
+
value: 'my-vpn'
|
15
|
+
]
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
Aws.config[:waf] = {
|
2
|
+
stub_responses: {
|
3
|
+
list_web_acls: {
|
4
|
+
next_marker: nil,
|
5
|
+
web_acls: [
|
6
|
+
{
|
7
|
+
web_acl_id: '1234567-abcd-1234-efgh-5678-1234567890',
|
8
|
+
name: 'my-waf-web-acl'
|
9
|
+
}
|
10
|
+
]
|
11
|
+
},
|
12
|
+
get_web_acl: {
|
13
|
+
web_acl: {
|
14
|
+
web_acl_id: '1234567-abcd-1234-efgh-5678-1234567890',
|
15
|
+
name: 'my-waf-web-acl',
|
16
|
+
metric_name: 'mywafwebacl',
|
17
|
+
default_action: {
|
18
|
+
type: 'BLOCK'
|
19
|
+
},
|
20
|
+
rules: [
|
21
|
+
{
|
22
|
+
priority: 1,
|
23
|
+
rule_id: 'aaaaaaaa-0000-5555-3333-eeeeeeeeeeee',
|
24
|
+
action: {
|
25
|
+
type: 'ALLOW'
|
26
|
+
}
|
27
|
+
},
|
28
|
+
{
|
29
|
+
priority: 2,
|
30
|
+
rule_id: 'dddddddd-1111-2222-3333-eeeeeeeeeeee',
|
31
|
+
action: {
|
32
|
+
type: 'BLOCK'
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
37
|
+
},
|
38
|
+
list_rules: {
|
39
|
+
next_marker: nil,
|
40
|
+
rules: [
|
41
|
+
{
|
42
|
+
rule_id: 'dddddddd-1111-2222-3333-eeeeeeeeeeee',
|
43
|
+
name: 'my-waf-web-acl-allowed-ips'
|
44
|
+
}
|
45
|
+
]
|
46
|
+
},
|
47
|
+
get_rule: {
|
48
|
+
rule: {
|
49
|
+
rule_id: 'dddddddd-1111-2222-3333-eeeeeeeeeeee',
|
50
|
+
name: 'my-waf-web-acl-allowed-ips',
|
51
|
+
metric_name: 'mywafwebaclallowedips',
|
52
|
+
predicates: [
|
53
|
+
{
|
54
|
+
negated: false,
|
55
|
+
type: 'IPMatch',
|
56
|
+
data_id: '22aa22bb-3333-aaaa-8888-bbbbbbbbbbbb'
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Awspec
|
2
|
+
class Toolbox < Thor
|
3
|
+
desc 'docgen > doc/resource_types.md', 'Generate doc/resource_types.md document'
|
4
|
+
def docgen
|
5
|
+
puts Awspec::Generator::Doc::Type.generate_doc
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'template [resource_type_name]', 'Generate template files'
|
9
|
+
option :account_attribute, type: :boolean, default: false, aliases: :a
|
10
|
+
def template(type)
|
11
|
+
if options[:account_attribute]
|
12
|
+
puts Awspec::Generator::Template.generate_account_attribute(type)
|
13
|
+
else
|
14
|
+
puts Awspec::Generator::Template.generate(type)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class Account < Base
|
3
|
+
REMOVE_SUFFIX_RE = /
|
4
|
+
_account_attributes|_account_settings|_send_quota
|
5
|
+
/ix
|
6
|
+
|
7
|
+
def resource_via_client
|
8
|
+
attributes = sts_client.get_caller_identity.to_h
|
9
|
+
Awspec::Helper::Type::ACCOUNT_ATTRIBUTES.each do |type|
|
10
|
+
key = type.gsub(REMOVE_SUFFIX_RE, '').to_sym
|
11
|
+
if key == 'ses'
|
12
|
+
# https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
|
13
|
+
next unless ['us-east-1', 'us-west-2', 'eu-west-1'].include?(Aws.config[:region])
|
14
|
+
end
|
15
|
+
eval "attributes[key] = Awspec::Type::#{type.camelize}.new.resource_via_client"
|
16
|
+
end
|
17
|
+
@resource_via_client ||= attributes.to_struct
|
18
|
+
end
|
19
|
+
|
20
|
+
def id
|
21
|
+
@id ||= sts_client.get_caller_identity.account
|
22
|
+
end
|
23
|
+
|
24
|
+
def lambda
|
25
|
+
resource_via_client[:lambda]
|
26
|
+
end
|
27
|
+
|
28
|
+
def method_missing(name)
|
29
|
+
name = name.to_s if name.class == Symbol
|
30
|
+
describe = name.tr('-', '_').to_sym
|
31
|
+
super unless resource_via_client.members.include?(describe)
|
32
|
+
resource_via_client[describe]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class AccountAttribute < Base
|
3
|
+
def initialize(key = nil)
|
4
|
+
@key = key.to_sym
|
5
|
+
end
|
6
|
+
|
7
|
+
def resource_via_client
|
8
|
+
attributes = nil
|
9
|
+
Awspec::Helper::Type::ACCOUNT_ATTRIBUTES.each do |type|
|
10
|
+
key = type.gsub(Awspec::Type::Account::REMOVE_SUFFIX_RE, '').to_sym
|
11
|
+
next unless key == @key
|
12
|
+
if key == 'ses'
|
13
|
+
# https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
|
14
|
+
next unless ['us-east-1', 'us-west-2', 'eu-west-1'].include?(Aws.config[:region])
|
15
|
+
end
|
16
|
+
eval "attributes = Awspec::Type::#{type.camelize}.new.resource_via_client"
|
17
|
+
end
|
18
|
+
@resource_via_client ||= attributes
|
19
|
+
end
|
20
|
+
|
21
|
+
def method_missing(name)
|
22
|
+
name = name.to_s if name.class == Symbol
|
23
|
+
describe = name.tr('-', '_').to_sym
|
24
|
+
super unless resource_via_client.members.include?(describe)
|
25
|
+
resource_via_client[describe]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class Acm < ResourceBase
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_certificate(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client.certificate_arn if resource_via_client
|
9
|
+
end
|
10
|
+
|
11
|
+
STATUSES = %w(
|
12
|
+
PENDING_VALIDATION
|
13
|
+
ISSUED
|
14
|
+
INACTIVE
|
15
|
+
EXPIRED
|
16
|
+
VALIDATION_TIMED_OUT
|
17
|
+
REVOKED
|
18
|
+
FAILED
|
19
|
+
)
|
20
|
+
|
21
|
+
STATUSES.each do |status|
|
22
|
+
define_method status.downcase + '?' do
|
23
|
+
resource_via_client.status == status
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class Alb < ResourceBase
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_alb(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client.load_balancer_name if resource_via_client
|
9
|
+
end
|
10
|
+
|
11
|
+
STATES = %w(
|
12
|
+
active provisioning failed
|
13
|
+
)
|
14
|
+
|
15
|
+
STATES.each do |state|
|
16
|
+
define_method state + '?' do
|
17
|
+
resource_via_client.state.code == state
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def has_security_group?(sg_id)
|
22
|
+
sgs = resource_via_client.security_groups
|
23
|
+
ret = sgs.find do |sg|
|
24
|
+
sg == sg_id
|
25
|
+
end
|
26
|
+
return true if ret
|
27
|
+
sg2 = find_security_group(sg_id)
|
28
|
+
return true if sgs.include? sg2.group_id
|
29
|
+
false
|
30
|
+
end
|
31
|
+
|
32
|
+
def has_subnet?(subnet_id)
|
33
|
+
azs = resource_via_client.availability_zones
|
34
|
+
ret = azs.find do |az|
|
35
|
+
az.subnet_id == subnet_id
|
36
|
+
end
|
37
|
+
return true if ret
|
38
|
+
subnet2 = find_subnet(subnet_id)
|
39
|
+
subnet2.subnet_id = subnet_id
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class AlbListener < ResourceBase
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_alb_listener(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client.listener_arn if resource_via_client
|
9
|
+
end
|
10
|
+
|
11
|
+
def has_rule?(rule_id = nil, priority = nil, conditions = nil, actions = nil)
|
12
|
+
rules = select_rule_by_alb_listener_id(id)
|
13
|
+
ret = rules.select do |rule|
|
14
|
+
conditions = [conditions] if conditions.is_a?(Hash)
|
15
|
+
actions = [actions] if actions.is_a?(Hash)
|
16
|
+
next false if !rule_id.nil? && rule.rule_arn != rule_id
|
17
|
+
next false if !priority.nil? && rule.priority != priority
|
18
|
+
next false if !conditions.nil? && rule.conditions.map(&:to_h).sort_by(&:to_s) != conditions.sort_by(&:to_s)
|
19
|
+
unless actions.nil?
|
20
|
+
actions = actions.map do |action|
|
21
|
+
if action.key?(:target_group_name)
|
22
|
+
target_group = find_alb_target_group(action[:target_group_name])
|
23
|
+
action[:target_group_arn] = target_group.target_group_arn
|
24
|
+
action.delete(:target_group_name)
|
25
|
+
end
|
26
|
+
action
|
27
|
+
end
|
28
|
+
next false if rule.actions.map(&:to_h).sort_by(&:to_s) != actions.sort_by(&:to_s)
|
29
|
+
end
|
30
|
+
true
|
31
|
+
end
|
32
|
+
ret.single_resource("rule_id = #{rule_id}, priority = #{priority}, \
|
33
|
+
conditions = #{conditions}, actions = #{actions}")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class AlbTargetGroup < ResourceBase
|
3
|
+
def resource_via_client
|
4
|
+
@resource_via_client ||= find_alb_target_group(@display_name)
|
5
|
+
end
|
6
|
+
|
7
|
+
def id
|
8
|
+
@id ||= resource_via_client.target_group_name if resource_via_client
|
9
|
+
end
|
10
|
+
|
11
|
+
def has_ec2?(id)
|
12
|
+
ec2 = find_ec2(id)
|
13
|
+
return nil unless ec2
|
14
|
+
descriptions = elbv2_client.describe_target_health(
|
15
|
+
target_group_arn: resource_via_client.target_group_arn
|
16
|
+
).target_health_descriptions
|
17
|
+
descriptions.find do |description|
|
18
|
+
description.target.id == ec2.instance_id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|