awspec 1.25.1 → 1.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +5 -7
- data/.rubocop.yml +66 -62
- data/Gemfile +3 -1
- data/Rakefile +5 -3
- data/awspec.gemspec +4 -2
- data/bin/console +1 -0
- data/bin/toolbox +1 -0
- data/doc/resource_types.md +17 -17
- data/exe/awspec +1 -0
- data/lib/awspec/cli.rb +2 -0
- data/lib/awspec/command/generate.rb +11 -9
- data/lib/awspec/config.rb +2 -0
- data/lib/awspec/error.rb +4 -0
- data/lib/awspec/ext/array.rb +5 -2
- data/lib/awspec/ext/hash.rb +5 -2
- data/lib/awspec/ext/string.rb +2 -0
- data/lib/awspec/ext/struct.rb +2 -0
- data/lib/awspec/ext.rb +2 -0
- data/lib/awspec/generator/doc/type/account.rb +4 -4
- data/lib/awspec/generator/doc/type/account_attribute.rb +4 -4
- data/lib/awspec/generator/doc/type/account_attribute_base.rb +3 -2
- data/lib/awspec/generator/doc/type/acm.rb +4 -2
- data/lib/awspec/generator/doc/type/alb.rb +5 -3
- data/lib/awspec/generator/doc/type/alb_listener.rb +3 -1
- data/lib/awspec/generator/doc/type/alb_target_group.rb +3 -1
- data/lib/awspec/generator/doc/type/ami.rb +4 -2
- data/lib/awspec/generator/doc/type/apigateway.rb +2 -0
- data/lib/awspec/generator/doc/type/autoscaling_group.rb +2 -0
- data/lib/awspec/generator/doc/type/base.rb +11 -8
- data/lib/awspec/generator/doc/type/batch_compute_environment.rb +6 -4
- data/lib/awspec/generator/doc/type/batch_job_definition.rb +2 -0
- data/lib/awspec/generator/doc/type/batch_job_queue.rb +2 -0
- data/lib/awspec/generator/doc/type/cloudformation_stack.rb +2 -0
- data/lib/awspec/generator/doc/type/cloudfront_distribution.rb +4 -2
- data/lib/awspec/generator/doc/type/cloudtrail.rb +2 -0
- data/lib/awspec/generator/doc/type/cloudwatch_alarm.rb +3 -1
- data/lib/awspec/generator/doc/type/cloudwatch_event.rb +2 -0
- data/lib/awspec/generator/doc/type/cloudwatch_logs.rb +2 -0
- data/lib/awspec/generator/doc/type/codebuild.rb +2 -0
- data/lib/awspec/generator/doc/type/codedeploy.rb +2 -0
- data/lib/awspec/generator/doc/type/codedeploy_deployment_group.rb +2 -0
- data/lib/awspec/generator/doc/type/cognito_identity_pool.rb +2 -0
- data/lib/awspec/generator/doc/type/cognito_user_pool.rb +2 -0
- data/lib/awspec/generator/doc/type/customer_gateway.rb +4 -2
- data/lib/awspec/generator/doc/type/directconnect_virtual_interface.rb +4 -2
- data/lib/awspec/generator/doc/type/dynamodb_table.rb +4 -2
- data/lib/awspec/generator/doc/type/ebs.rb +4 -2
- data/lib/awspec/generator/doc/type/ec2.rb +4 -2
- data/lib/awspec/generator/doc/type/ec2_account_attributes.rb +2 -0
- data/lib/awspec/generator/doc/type/ecr_repository.rb +2 -0
- data/lib/awspec/generator/doc/type/ecs_cluster.rb +4 -2
- data/lib/awspec/generator/doc/type/ecs_container_instance.rb +4 -2
- data/lib/awspec/generator/doc/type/ecs_service.rb +4 -2
- data/lib/awspec/generator/doc/type/ecs_task_definition.rb +4 -2
- data/lib/awspec/generator/doc/type/efs.rb +2 -0
- data/lib/awspec/generator/doc/type/eip.rb +2 -0
- data/lib/awspec/generator/doc/type/eks.rb +4 -2
- data/lib/awspec/generator/doc/type/eks_nodegroup.rb +4 -2
- data/lib/awspec/generator/doc/type/elasticache.rb +4 -2
- data/lib/awspec/generator/doc/type/elasticache_cache_parameter_group.rb +2 -0
- data/lib/awspec/generator/doc/type/elasticsearch.rb +2 -0
- data/lib/awspec/generator/doc/type/elastictranscoder_pipeline.rb +4 -2
- data/lib/awspec/generator/doc/type/elb.rb +5 -3
- data/lib/awspec/generator/doc/type/emr.rb +4 -2
- data/lib/awspec/generator/doc/type/firehose.rb +2 -0
- data/lib/awspec/generator/doc/type/iam_group.rb +3 -1
- data/lib/awspec/generator/doc/type/iam_policy.rb +2 -0
- data/lib/awspec/generator/doc/type/iam_role.rb +3 -1
- data/lib/awspec/generator/doc/type/iam_user.rb +3 -1
- data/lib/awspec/generator/doc/type/internet_gateway.rb +2 -0
- data/lib/awspec/generator/doc/type/kinesis.rb +2 -0
- data/lib/awspec/generator/doc/type/kms.rb +2 -0
- data/lib/awspec/generator/doc/type/lambda.rb +3 -1
- data/lib/awspec/generator/doc/type/lambda_account_settings.rb +2 -0
- data/lib/awspec/generator/doc/type/launch_configuration.rb +2 -0
- data/lib/awspec/generator/doc/type/launch_template.rb +2 -0
- data/lib/awspec/generator/doc/type/mq.rb +5 -3
- data/lib/awspec/generator/doc/type/msk.rb +2 -0
- data/lib/awspec/generator/doc/type/nat_gateway.rb +4 -2
- data/lib/awspec/generator/doc/type/network_acl.rb +4 -2
- data/lib/awspec/generator/doc/type/network_interface.rb +4 -2
- data/lib/awspec/generator/doc/type/nlb.rb +4 -2
- data/lib/awspec/generator/doc/type/nlb_listener.rb +3 -1
- data/lib/awspec/generator/doc/type/nlb_target_group.rb +3 -1
- data/lib/awspec/generator/doc/type/rds.rb +5 -3
- data/lib/awspec/generator/doc/type/rds_account_attributes.rb +2 -0
- data/lib/awspec/generator/doc/type/rds_db_cluster_parameter_group.rb +2 -0
- data/lib/awspec/generator/doc/type/rds_db_parameter_group.rb +2 -0
- data/lib/awspec/generator/doc/type/redshift.rb +5 -3
- data/lib/awspec/generator/doc/type/redshift_cluster_parameter_group.rb +2 -0
- data/lib/awspec/generator/doc/type/route53_hosted_zone.rb +2 -0
- data/lib/awspec/generator/doc/type/route_table.rb +2 -0
- data/lib/awspec/generator/doc/type/s3_bucket.rb +3 -1
- data/lib/awspec/generator/doc/type/secretsmanager.rb +2 -0
- data/lib/awspec/generator/doc/type/security_group.rb +4 -2
- data/lib/awspec/generator/doc/type/ses_identity.rb +4 -2
- data/lib/awspec/generator/doc/type/ses_send_quota.rb +2 -0
- data/lib/awspec/generator/doc/type/sns_topic.rb +5 -3
- data/lib/awspec/generator/doc/type/sqs.rb +2 -0
- data/lib/awspec/generator/doc/type/ssm_parameter.rb +2 -0
- data/lib/awspec/generator/doc/type/subnet.rb +4 -2
- data/lib/awspec/generator/doc/type/transit_gateway.rb +2 -0
- data/lib/awspec/generator/doc/type/vpc.rb +4 -2
- data/lib/awspec/generator/doc/type/vpc_endpoints.rb +2 -0
- data/lib/awspec/generator/doc/type/vpn_connection.rb +4 -2
- data/lib/awspec/generator/doc/type/vpn_gateway.rb +4 -2
- data/lib/awspec/generator/doc/type/waf_web_acl.rb +3 -1
- data/lib/awspec/generator/doc/type/wafregional_web_acl.rb +3 -1
- data/lib/awspec/generator/doc/type.rb +5 -3
- data/lib/awspec/generator/spec/acm.rb +4 -2
- data/lib/awspec/generator/spec/alb.rb +6 -4
- data/lib/awspec/generator/spec/alb_listener.rb +6 -4
- data/lib/awspec/generator/spec/autoscaling_group.rb +6 -4
- data/lib/awspec/generator/spec/cloudwatch_alarm.rb +4 -2
- data/lib/awspec/generator/spec/cloudwatch_event.rb +4 -2
- data/lib/awspec/generator/spec/cloudwatch_logs.rb +4 -2
- data/lib/awspec/generator/spec/codebuild.rb +4 -2
- data/lib/awspec/generator/spec/directconnect.rb +4 -2
- data/lib/awspec/generator/spec/ebs.rb +5 -4
- data/lib/awspec/generator/spec/ec2.rb +5 -2
- data/lib/awspec/generator/spec/efs.rb +4 -2
- data/lib/awspec/generator/spec/eip.rb +4 -2
- data/lib/awspec/generator/spec/elasticache.rb +5 -2
- data/lib/awspec/generator/spec/elasticsearch.rb +4 -2
- data/lib/awspec/generator/spec/elb.rb +8 -6
- data/lib/awspec/generator/spec/iam_group.rb +4 -2
- data/lib/awspec/generator/spec/iam_policy.rb +3 -0
- data/lib/awspec/generator/spec/iam_role.rb +4 -2
- data/lib/awspec/generator/spec/iam_user.rb +4 -2
- data/lib/awspec/generator/spec/internet_gateway.rb +6 -4
- data/lib/awspec/generator/spec/kms.rb +4 -2
- data/lib/awspec/generator/spec/lambda.rb +4 -2
- data/lib/awspec/generator/spec/nat_gateway.rb +6 -4
- data/lib/awspec/generator/spec/network_acl.rb +15 -13
- data/lib/awspec/generator/spec/network_interface.rb +13 -10
- data/lib/awspec/generator/spec/nlb.rb +6 -4
- data/lib/awspec/generator/spec/nlb_listener.rb +6 -4
- data/lib/awspec/generator/spec/rds.rb +5 -2
- data/lib/awspec/generator/spec/rds_db_cluster_parameter_group.rb +3 -2
- data/lib/awspec/generator/spec/rds_db_parameter_group.rb +3 -2
- data/lib/awspec/generator/spec/redshift.rb +5 -2
- data/lib/awspec/generator/spec/redshift_cluster_parameter_group.rb +3 -2
- data/lib/awspec/generator/spec/route53_hosted_zone.rb +4 -2
- data/lib/awspec/generator/spec/route_table.rb +12 -14
- data/lib/awspec/generator/spec/s3_bucket.rb +9 -6
- data/lib/awspec/generator/spec/security_group.rb +9 -8
- data/lib/awspec/generator/spec/subnet.rb +6 -4
- data/lib/awspec/generator/spec/vpc.rb +5 -2
- data/lib/awspec/generator/template.rb +17 -15
- data/lib/awspec/generator.rb +4 -2
- data/lib/awspec/helper/client_wrap.rb +5 -1
- data/lib/awspec/helper/color.rb +2 -0
- data/lib/awspec/helper/finder/account_attributes.rb +8 -6
- data/lib/awspec/helper/finder/acm.rb +4 -0
- data/lib/awspec/helper/finder/alb.rb +7 -5
- data/lib/awspec/helper/finder/ami.rb +4 -0
- data/lib/awspec/helper/finder/apigateway.rb +2 -0
- data/lib/awspec/helper/finder/autoscaling.rb +3 -0
- data/lib/awspec/helper/finder/batch.rb +2 -0
- data/lib/awspec/helper/finder/cloudformation.rb +2 -0
- data/lib/awspec/helper/finder/cloudfront.rb +3 -0
- data/lib/awspec/helper/finder/cloudtrail.rb +2 -0
- data/lib/awspec/helper/finder/cloudwatch.rb +3 -0
- data/lib/awspec/helper/finder/cloudwatch_event.rb +2 -0
- data/lib/awspec/helper/finder/cloudwatch_logs.rb +10 -5
- data/lib/awspec/helper/finder/codebuild.rb +3 -0
- data/lib/awspec/helper/finder/codedeploy.rb +2 -0
- data/lib/awspec/helper/finder/cognito_identity_pool.rb +2 -0
- data/lib/awspec/helper/finder/cognito_user_pool.rb +2 -0
- data/lib/awspec/helper/finder/directconnect.rb +2 -0
- data/lib/awspec/helper/finder/dynamodb.rb +2 -0
- data/lib/awspec/helper/finder/ebs.rb +5 -0
- data/lib/awspec/helper/finder/ec2.rb +16 -10
- data/lib/awspec/helper/finder/ecr.rb +2 -0
- data/lib/awspec/helper/finder/ecs.rb +5 -2
- data/lib/awspec/helper/finder/efs.rb +5 -4
- data/lib/awspec/helper/finder/eks.rb +2 -0
- data/lib/awspec/helper/finder/elasticache.rb +3 -1
- data/lib/awspec/helper/finder/elasticsearch.rb +3 -1
- data/lib/awspec/helper/finder/elastictranscoder.rb +3 -0
- data/lib/awspec/helper/finder/elb.rb +6 -4
- data/lib/awspec/helper/finder/emr.rb +2 -0
- data/lib/awspec/helper/finder/firehose.rb +2 -0
- data/lib/awspec/helper/finder/iam.rb +16 -12
- data/lib/awspec/helper/finder/kinesis.rb +2 -0
- data/lib/awspec/helper/finder/kms.rb +3 -1
- data/lib/awspec/helper/finder/lambda.rb +3 -0
- data/lib/awspec/helper/finder/mq.rb +3 -1
- data/lib/awspec/helper/finder/msk.rb +2 -0
- data/lib/awspec/helper/finder/nlb.rb +11 -8
- data/lib/awspec/helper/finder/rds.rb +4 -1
- data/lib/awspec/helper/finder/redshift.rb +4 -1
- data/lib/awspec/helper/finder/route53.rb +4 -1
- data/lib/awspec/helper/finder/s3.rb +4 -2
- data/lib/awspec/helper/finder/secretsmanager.rb +2 -0
- data/lib/awspec/helper/finder/security_group.rb +2 -0
- data/lib/awspec/helper/finder/ses.rb +2 -0
- data/lib/awspec/helper/finder/sns_topic.rb +5 -3
- data/lib/awspec/helper/finder/sqs.rb +2 -0
- data/lib/awspec/helper/finder/ssm_parameter.rb +4 -1
- data/lib/awspec/helper/finder/subnet.rb +3 -0
- data/lib/awspec/helper/finder/vpc.rb +12 -6
- data/lib/awspec/helper/finder/vpc_endpoints.rb +2 -0
- data/lib/awspec/helper/finder/waf.rb +5 -0
- data/lib/awspec/helper/finder/wafregional.rb +5 -0
- data/lib/awspec/helper/finder.rb +3 -1
- data/lib/awspec/helper/states.rb +4 -2
- data/lib/awspec/helper/type.rb +8 -4
- data/lib/awspec/helper.rb +2 -0
- data/lib/awspec/matcher/be_allowed.rb +2 -0
- data/lib/awspec/matcher/be_allowed_action.rb +2 -0
- data/lib/awspec/matcher/be_attached_to.rb +3 -0
- data/lib/awspec/matcher/be_connected_to_vpc.rb +2 -0
- data/lib/awspec/matcher/be_denied.rb +2 -0
- data/lib/awspec/matcher/be_opened.rb +2 -0
- data/lib/awspec/matcher/be_opened_only.rb +2 -0
- data/lib/awspec/matcher/belong_to_alb.rb +4 -0
- data/lib/awspec/matcher/belong_to_cache_subnet_group.rb +2 -0
- data/lib/awspec/matcher/belong_to_cluster_subnet_group.rb +2 -0
- data/lib/awspec/matcher/belong_to_db_subnet_group.rb +2 -0
- data/lib/awspec/matcher/belong_to_domain.rb +2 -0
- data/lib/awspec/matcher/belong_to_iam_group.rb +2 -0
- data/lib/awspec/matcher/belong_to_metric.rb +2 -0
- data/lib/awspec/matcher/belong_to_nlb.rb +4 -0
- data/lib/awspec/matcher/belong_to_replication_group.rb +2 -0
- data/lib/awspec/matcher/belong_to_subnet.rb +5 -0
- data/lib/awspec/matcher/belong_to_subnets.rb +2 -0
- data/lib/awspec/matcher/belong_to_vpc.rb +4 -0
- data/lib/awspec/matcher/have_attribute_definition.rb +2 -0
- data/lib/awspec/matcher/have_cluster_parameter_group.rb +2 -0
- data/lib/awspec/matcher/have_custom_response_error_code.rb +3 -2
- data/lib/awspec/matcher/have_db_parameter_group.rb +2 -0
- data/lib/awspec/matcher/have_env_var.rb +2 -0
- data/lib/awspec/matcher/have_env_var_value.rb +2 -0
- data/lib/awspec/matcher/have_env_vars.rb +2 -0
- data/lib/awspec/matcher/have_inline_policy.rb +2 -0
- data/lib/awspec/matcher/have_key_policy.rb +2 -0
- data/lib/awspec/matcher/have_key_schema.rb +2 -0
- data/lib/awspec/matcher/have_metric_filter.rb +2 -0
- data/lib/awspec/matcher/have_network_interface.rb +2 -0
- data/lib/awspec/matcher/have_option_group.rb +2 -0
- data/lib/awspec/matcher/have_origin.rb +3 -2
- data/lib/awspec/matcher/have_private_ip_address.rb +2 -0
- data/lib/awspec/matcher/have_record_set.rb +3 -1
- data/lib/awspec/matcher/have_route.rb +5 -3
- data/lib/awspec/matcher/have_rule.rb +3 -0
- data/lib/awspec/matcher/have_subscription_attributes.rb +3 -0
- data/lib/awspec/matcher/have_subscription_filter.rb +2 -0
- data/lib/awspec/matcher/have_tag.rb +2 -0
- data/lib/awspec/matcher/have_vpc_peering_connection.rb +2 -0
- data/lib/awspec/matcher/include_subscribed.rb +2 -0
- data/lib/awspec/matcher.rb +2 -0
- data/lib/awspec/resource_reader.rb +3 -0
- data/lib/awspec/setup.rb +7 -5
- data/lib/awspec/shared_context.rb +3 -0
- data/lib/awspec/stub/account.rb +2 -0
- data/lib/awspec/stub/acm.rb +2 -0
- data/lib/awspec/stub/alb.rb +3 -1
- data/lib/awspec/stub/alb_listener.rb +4 -3
- data/lib/awspec/stub/alb_target_group.rb +3 -1
- data/lib/awspec/stub/ami.rb +2 -0
- data/lib/awspec/stub/apigateway.rb +2 -0
- data/lib/awspec/stub/autoscaling_group.rb +6 -4
- data/lib/awspec/stub/batch_compute_environment.rb +2 -0
- data/lib/awspec/stub/batch_job_definition.rb +2 -0
- data/lib/awspec/stub/batch_job_queue.rb +2 -0
- data/lib/awspec/stub/cloudformation_stack.rb +4 -2
- data/lib/awspec/stub/cloudfront_distribution.rb +6 -4
- data/lib/awspec/stub/cloudtrail.rb +2 -0
- data/lib/awspec/stub/cloudwatch_logs.rb +2 -0
- data/lib/awspec/stub/codebuild.rb +5 -3
- data/lib/awspec/stub/codedeploy.rb +2 -0
- data/lib/awspec/stub/codedeploy_deployment_group.rb +2 -0
- data/lib/awspec/stub/cognito_identity_pool.rb +2 -0
- data/lib/awspec/stub/cognito_user_pool.rb +2 -0
- data/lib/awspec/stub/directconnect_virtual_interface.rb +2 -0
- data/lib/awspec/stub/duplicated_resource_type.rb +2 -0
- data/lib/awspec/stub/dynamodb_table.rb +2 -0
- data/lib/awspec/stub/ebs.rb +2 -0
- data/lib/awspec/stub/ec2.rb +2 -0
- data/lib/awspec/stub/ec2_has_multi_security_groups.rb +2 -0
- data/lib/awspec/stub/ec2_non_existing.rb +2 -0
- data/lib/awspec/stub/ecr_repository.rb +2 -0
- data/lib/awspec/stub/ecs.rb +13 -22
- data/lib/awspec/stub/ecs_cluster.rb +4 -4
- data/lib/awspec/stub/ecs_container_instance.rb +3 -2
- data/lib/awspec/stub/ecs_service.rb +4 -4
- data/lib/awspec/stub/ecs_task_definition.rb +9 -14
- data/lib/awspec/stub/efs.rb +2 -0
- data/lib/awspec/stub/eip.rb +2 -0
- data/lib/awspec/stub/eks.rb +5 -3
- data/lib/awspec/stub/eks_nodegroup.rb +2 -0
- data/lib/awspec/stub/elasticache.rb +2 -0
- data/lib/awspec/stub/elasticache_cache_parameter_group.rb +2 -0
- data/lib/awspec/stub/elasticsearch.rb +2 -0
- data/lib/awspec/stub/elastictranscoder_pipeline.rb +2 -0
- data/lib/awspec/stub/elb.rb +2 -0
- data/lib/awspec/stub/emr.rb +2 -0
- data/lib/awspec/stub/firehose.rb +2 -0
- data/lib/awspec/stub/iam_group.rb +3 -2
- data/lib/awspec/stub/iam_policy.rb +2 -0
- data/lib/awspec/stub/iam_role.rb +3 -2
- data/lib/awspec/stub/iam_user.rb +3 -2
- data/lib/awspec/stub/internet_gateway.rb +2 -0
- data/lib/awspec/stub/kinesis.rb +8 -6
- data/lib/awspec/stub/kms.rb +2 -0
- data/lib/awspec/stub/lambda.rb +2 -0
- data/lib/awspec/stub/launch_configuration.rb +2 -0
- data/lib/awspec/stub/launch_template.rb +2 -0
- data/lib/awspec/stub/mq.rb +5 -3
- data/lib/awspec/stub/msk.rb +5 -3
- data/lib/awspec/stub/nat_gateway.rb +2 -0
- data/lib/awspec/stub/network_acl.rb +2 -0
- data/lib/awspec/stub/network_interface.rb +2 -0
- data/lib/awspec/stub/nlb.rb +3 -1
- data/lib/awspec/stub/nlb_listener.rb +4 -3
- data/lib/awspec/stub/nlb_target_group.rb +3 -1
- data/lib/awspec/stub/rds.rb +2 -0
- data/lib/awspec/stub/rds_db_cluster_parameter_group.rb +2 -0
- data/lib/awspec/stub/rds_db_parameter_group.rb +2 -0
- data/lib/awspec/stub/redshift.rb +2 -0
- data/lib/awspec/stub/redshift_cluster_parameter_group.rb +2 -0
- data/lib/awspec/stub/route53_hosted_zone.rb +2 -0
- data/lib/awspec/stub/route_table.rb +2 -0
- data/lib/awspec/stub/s3_bucket.rb +2 -0
- data/lib/awspec/stub/secretsmanager.rb +2 -0
- data/lib/awspec/stub/security_group.rb +2 -0
- data/lib/awspec/stub/ses_identity.rb +2 -0
- data/lib/awspec/stub/sns_topic.rb +3 -1
- data/lib/awspec/stub/sns_topic_error.rb +6 -2
- data/lib/awspec/stub/sqs.rb +2 -0
- data/lib/awspec/stub/ssm_parameter.rb +2 -0
- data/lib/awspec/stub/subnet.rb +2 -0
- data/lib/awspec/stub/transit_gateway.rb +2 -0
- data/lib/awspec/stub/vpc.rb +2 -0
- data/lib/awspec/stub/vpc_endpoints.rb +2 -0
- data/lib/awspec/stub/waf_web_acl.rb +2 -0
- data/lib/awspec/stub/wafregional_web_acl.rb +2 -0
- data/lib/awspec/stub.rb +3 -1
- data/lib/awspec/toolbox.rb +2 -0
- data/lib/awspec/type/account.rb +4 -2
- data/lib/awspec/type/account_attribute.rb +5 -2
- data/lib/awspec/type/account_attribute_base.rb +2 -0
- data/lib/awspec/type/acm.rb +8 -6
- data/lib/awspec/type/alb.rb +8 -3
- data/lib/awspec/type/alb_listener.rb +4 -0
- data/lib/awspec/type/alb_target_group.rb +3 -0
- data/lib/awspec/type/ami.rb +5 -3
- data/lib/awspec/type/apigateway.rb +9 -3
- data/lib/awspec/type/autoscaling_group.rb +3 -0
- data/lib/awspec/type/base.rb +6 -3
- data/lib/awspec/type/batch_compute_environment.rb +6 -4
- data/lib/awspec/type/batch_job_definition.rb +2 -0
- data/lib/awspec/type/batch_job_queue.rb +4 -2
- data/lib/awspec/type/cloudformation_stack.rb +2 -0
- data/lib/awspec/type/cloudfront_distribution.rb +11 -5
- data/lib/awspec/type/cloudtrail.rb +2 -0
- data/lib/awspec/type/cloudwatch_alarm.rb +2 -0
- data/lib/awspec/type/cloudwatch_event.rb +2 -0
- data/lib/awspec/type/cloudwatch_logs.rb +2 -0
- data/lib/awspec/type/codebuild.rb +2 -0
- data/lib/awspec/type/codedeploy.rb +2 -0
- data/lib/awspec/type/codedeploy_deployment_group.rb +4 -0
- data/lib/awspec/type/cognito_identity_pool.rb +2 -0
- data/lib/awspec/type/cognito_user_pool.rb +2 -0
- data/lib/awspec/type/customer_gateway.rb +5 -3
- data/lib/awspec/type/directconnect_virtual_interface.rb +5 -3
- data/lib/awspec/type/dynamodb_table.rb +5 -3
- data/lib/awspec/type/ebs.rb +6 -3
- data/lib/awspec/type/ec2.rb +10 -0
- data/lib/awspec/type/ec2_account_attributes.rb +2 -0
- data/lib/awspec/type/ecr_repository.rb +2 -0
- data/lib/awspec/type/ecs_cluster.rb +5 -2
- data/lib/awspec/type/ecs_container_instance.rb +4 -2
- data/lib/awspec/type/ecs_service.rb +5 -2
- data/lib/awspec/type/ecs_task_definition.rb +4 -2
- data/lib/awspec/type/efs.rb +3 -0
- data/lib/awspec/type/eip.rb +3 -0
- data/lib/awspec/type/eks.rb +4 -2
- data/lib/awspec/type/eks_nodegroup.rb +4 -2
- data/lib/awspec/type/elasticache.rb +7 -3
- data/lib/awspec/type/elasticache_cache_parameter_group.rb +3 -0
- data/lib/awspec/type/elasticsearch.rb +2 -0
- data/lib/awspec/type/elastictranscoder_pipeline.rb +5 -3
- data/lib/awspec/type/elb.rb +11 -3
- data/lib/awspec/type/emr.rb +8 -6
- data/lib/awspec/type/firehose.rb +4 -2
- data/lib/awspec/type/iam_group.rb +4 -0
- data/lib/awspec/type/iam_policy.rb +5 -0
- data/lib/awspec/type/iam_role.rb +3 -0
- data/lib/awspec/type/iam_user.rb +3 -0
- data/lib/awspec/type/internet_gateway.rb +2 -0
- data/lib/awspec/type/kinesis.rb +3 -0
- data/lib/awspec/type/kms.rb +3 -0
- data/lib/awspec/type/lambda.rb +2 -0
- data/lib/awspec/type/lambda_account_settings.rb +2 -0
- data/lib/awspec/type/launch_configuration.rb +3 -0
- data/lib/awspec/type/launch_template.rb +3 -0
- data/lib/awspec/type/mq.rb +7 -3
- data/lib/awspec/type/msk.rb +5 -3
- data/lib/awspec/type/nat_gateway.rb +5 -3
- data/lib/awspec/type/network_acl.rb +9 -2
- data/lib/awspec/type/network_interface.rb +9 -3
- data/lib/awspec/type/nlb.rb +6 -3
- data/lib/awspec/type/nlb_listener.rb +4 -0
- data/lib/awspec/type/nlb_target_group.rb +3 -0
- data/lib/awspec/type/rds.rb +7 -3
- data/lib/awspec/type/rds_account_attributes.rb +2 -0
- data/lib/awspec/type/rds_db_cluster_parameter_group.rb +3 -0
- data/lib/awspec/type/rds_db_parameter_group.rb +5 -1
- data/lib/awspec/type/redshift.rb +7 -3
- data/lib/awspec/type/redshift_cluster_parameter_group.rb +2 -0
- data/lib/awspec/type/resource_base.rb +2 -0
- data/lib/awspec/type/route53_hosted_zone.rb +7 -2
- data/lib/awspec/type/route_table.rb +12 -0
- data/lib/awspec/type/s3_bucket.rb +6 -3
- data/lib/awspec/type/secretsmanager.rb +2 -0
- data/lib/awspec/type/security_group.rb +14 -2
- data/lib/awspec/type/ses_identity.rb +8 -6
- data/lib/awspec/type/ses_send_quota.rb +2 -0
- data/lib/awspec/type/sns_topic.rb +4 -0
- data/lib/awspec/type/sqs.rb +4 -0
- data/lib/awspec/type/ssm_parameter.rb +3 -0
- data/lib/awspec/type/subnet.rb +6 -3
- data/lib/awspec/type/transit_gateway.rb +2 -0
- data/lib/awspec/type/vpc.rb +7 -3
- data/lib/awspec/type/vpc_endpoints.rb +5 -3
- data/lib/awspec/type/vpn_connection.rb +5 -3
- data/lib/awspec/type/vpn_gateway.rb +5 -3
- data/lib/awspec/type/waf_web_acl.rb +3 -0
- data/lib/awspec/type/wafregional_web_acl.rb +3 -0
- data/lib/awspec/version.rb +3 -1
- data/lib/awspec.rb +2 -0
- metadata +16 -16
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Doc
|
3
5
|
module Type
|
@@ -9,7 +11,7 @@ module Awspec::Generator
|
|
9
11
|
@ret = @type.resource_via_client
|
10
12
|
@matchers = []
|
11
13
|
@ignore_matchers = []
|
12
|
-
@describes = %w
|
14
|
+
@describes = %w[default_action]
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Doc
|
3
5
|
module Type
|
@@ -7,7 +9,7 @@ module Awspec::Generator
|
|
7
9
|
types = Awspec::Helper::Type::TYPES
|
8
10
|
types.delete('base')
|
9
11
|
links = types.sort.map do |type|
|
10
|
-
|
12
|
+
"[#{type}](##{type})"
|
11
13
|
end
|
12
14
|
links.push('[account](#account)') # add account
|
13
15
|
header = <<-'EOF'
|
@@ -44,10 +46,10 @@ EOF
|
|
44
46
|
EOF
|
45
47
|
|
46
48
|
links = attributes.map do |type|
|
47
|
-
|
49
|
+
"[#{type}](##{type})"
|
48
50
|
end
|
49
51
|
|
50
|
-
doc += links.join("\n| ")
|
52
|
+
doc += "#{links.join("\n| ")}\n"
|
51
53
|
|
52
54
|
attributes.map do |type|
|
53
55
|
doc += eval "Awspec::Generator::Doc::Type::#{type.camelize}.new.generate_doc"
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Acm
|
@@ -5,11 +7,12 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
certificates = select_all_certificates
|
7
9
|
raise 'Not Found Certificates' if certificates.empty?
|
10
|
+
|
8
11
|
ERB.new(acm_spec_template, nil, '-').result(binding).chomp
|
9
12
|
end
|
10
13
|
|
11
14
|
def acm_spec_template
|
12
|
-
|
15
|
+
<<-'EOF'
|
13
16
|
<% certificates.each do |certificate| %>
|
14
17
|
describe acm('<%= certificate.domain_name %>') do
|
15
18
|
it { should exist }
|
@@ -36,7 +39,6 @@ describe acm('<%= certificate.domain_name %>') do
|
|
36
39
|
end
|
37
40
|
<% end %>
|
38
41
|
EOF
|
39
|
-
template
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
@@ -1,13 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Alb
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
8
|
+
describes = %w[
|
7
9
|
load_balancer_name
|
8
|
-
|
10
|
+
]
|
9
11
|
vpc = find_vpc(vpc_id)
|
10
12
|
raise 'Not Found VPC' unless vpc
|
13
|
+
|
11
14
|
@vpc_id = vpc[:vpc_id]
|
12
15
|
@vpc_tag_name = vpc.tag_name
|
13
16
|
albs = select_alb_by_vpc_id(@vpc_id)
|
@@ -19,7 +22,7 @@ module Awspec::Generator
|
|
19
22
|
end
|
20
23
|
|
21
24
|
def alb_spec_template
|
22
|
-
|
25
|
+
<<-'EOF'
|
23
26
|
describe alb('<%= alb.load_balancer_name %>') do
|
24
27
|
it { should exist }
|
25
28
|
its(:load_balancer_arn) { should eq '<%= alb.load_balancer_arn %>' }
|
@@ -31,7 +34,6 @@ describe alb('<%= alb.load_balancer_name %>') do
|
|
31
34
|
its(:ip_address_type) { should eq '<%= alb.ip_address_type %>' }
|
32
35
|
end
|
33
36
|
EOF
|
34
|
-
template
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
@@ -1,13 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class AlbListener
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
8
|
+
describes = %w[
|
7
9
|
load_balancer_arn port protocol ssl_policy
|
8
|
-
|
10
|
+
]
|
9
11
|
vpc = find_vpc(vpc_id)
|
10
12
|
raise 'Not Found VPC' unless vpc
|
13
|
+
|
11
14
|
@vpc_id = vpc[:vpc_id]
|
12
15
|
@vpc_tag_name = vpc.tag_name
|
13
16
|
albs = select_alb_by_vpc_id(@vpc_id)
|
@@ -77,7 +80,7 @@ module Awspec::Generator
|
|
77
80
|
end
|
78
81
|
|
79
82
|
def alb_listener_spec_template
|
80
|
-
|
83
|
+
<<-'EOF'
|
81
84
|
describe alb_listener('<%= listener.listener_arn %>') do
|
82
85
|
it { should exist }
|
83
86
|
<%- describes.each do |describe| -%>
|
@@ -103,7 +106,6 @@ describe alb_listener('<%= listener.listener_arn %>') do
|
|
103
106
|
<%- end -%>
|
104
107
|
end
|
105
108
|
EOF
|
106
|
-
template
|
107
109
|
end
|
108
110
|
end
|
109
111
|
end
|
@@ -1,15 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class AutoscalingGroup
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
8
|
+
describes = %w[
|
7
9
|
auto_scaling_group_name auto_scaling_group_arn min_size max_size desired_capacity
|
8
10
|
default_cooldown availability_zones health_check_type health_check_grace_period
|
9
11
|
vpc_zone_identifier termination_policies new_instances_protected_from_scale_in
|
10
|
-
|
12
|
+
]
|
11
13
|
vpc = find_vpc(vpc_id)
|
12
14
|
raise 'Not Found VPC' unless vpc
|
15
|
+
|
13
16
|
@vpc_id = vpc[:vpc_id]
|
14
17
|
@vpc_tag_name = vpc.tag_name
|
15
18
|
autoscaling_groups = select_autoscaling_group_by_vpc_id(@vpc_id)
|
@@ -20,7 +23,7 @@ module Awspec::Generator
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def autoscaling_group_spec_template
|
23
|
-
|
26
|
+
<<-'EOF'
|
24
27
|
describe autoscaling_group('<%= autoscaling_group.auto_scaling_group_name %>') do
|
25
28
|
it { should exist }
|
26
29
|
<% describes.each do |describe| %>
|
@@ -49,7 +52,6 @@ describe autoscaling_group('<%= autoscaling_group.auto_scaling_group_name %>') d
|
|
49
52
|
<% end %>
|
50
53
|
end
|
51
54
|
EOF
|
52
|
-
template
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class CloudwatchAlarm
|
@@ -5,11 +7,12 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
alarms = select_all_cloudwatch_alarms
|
7
9
|
raise 'Not Found alarm' if alarms.empty?
|
10
|
+
|
8
11
|
ERB.new(alarm_spec_template, nil, '-').result(binding).chomp
|
9
12
|
end
|
10
13
|
|
11
14
|
def alarm_spec_template
|
12
|
-
|
15
|
+
<<-'EOF'
|
13
16
|
<% alarms.each do |alarm| %>
|
14
17
|
describe cloudwatch_alarm('<%= alarm.alarm_name %>') do
|
15
18
|
it { should exist }
|
@@ -36,7 +39,6 @@ describe cloudwatch_alarm('<%= alarm.alarm_name %>') do
|
|
36
39
|
end
|
37
40
|
<% end %>
|
38
41
|
EOF
|
39
|
-
template
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class CloudwatchEvent
|
@@ -5,11 +7,12 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
events = select_all_cloudwatch_events
|
7
9
|
raise 'Not Found event' if events.empty?
|
10
|
+
|
8
11
|
ERB.new(event_spec_template, nil, '-').result(binding).chomp
|
9
12
|
end
|
10
13
|
|
11
14
|
def event_spec_template
|
12
|
-
|
15
|
+
<<-'EOF'
|
13
16
|
<% events.each do |event| %>
|
14
17
|
describe cloudwatch_event('<%= event.name %>') do
|
15
18
|
it { should exist }
|
@@ -20,7 +23,6 @@ describe cloudwatch_event('<%= event.name %>') do
|
|
20
23
|
end
|
21
24
|
<% end %>
|
22
25
|
EOF
|
23
|
-
template
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class CloudwatchLogs
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
log_groups = select_all_cloudwatch_logs_log_groups
|
7
9
|
raise 'Not Found Log Group' if log_groups.empty?
|
10
|
+
|
8
11
|
specs = log_groups.map do |log_group|
|
9
12
|
log_stream_line = generate_log_stream_spec(log_group.log_group_name)
|
10
13
|
metric_filter_lines = generate_log_metric_filters_specs(log_group.log_group_name)
|
@@ -48,7 +51,7 @@ module Awspec::Generator
|
|
48
51
|
end
|
49
52
|
|
50
53
|
def cloudwatch_logs_spec_template
|
51
|
-
|
54
|
+
<<-'EOF'
|
52
55
|
describe cloudwatch_logs('<%= log_group.log_group_name %>') do
|
53
56
|
it { should exist }
|
54
57
|
<%- unless log_group.retention_in_days.nil? -%>
|
@@ -65,7 +68,6 @@ describe cloudwatch_logs('<%= log_group.log_group_name %>') do
|
|
65
68
|
<% end %>
|
66
69
|
end
|
67
70
|
EOF
|
68
|
-
template
|
69
71
|
end
|
70
72
|
end
|
71
73
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Codebuild
|
@@ -5,18 +7,18 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
projects = select_all_codebuild_projects
|
7
9
|
raise 'Not Found CodeBuild Project' if projects.empty?
|
10
|
+
|
8
11
|
ERB.new(codebuild_spec_template, nil, '-').result(binding).chomp
|
9
12
|
end
|
10
13
|
|
11
14
|
def codebuild_spec_template
|
12
|
-
|
15
|
+
<<-'EOF'
|
13
16
|
<% projects.each do |project| %>
|
14
17
|
describe codebuild('<%= project %>') do
|
15
18
|
it { should exist }
|
16
19
|
end
|
17
20
|
<% end %>
|
18
21
|
EOF
|
19
|
-
template
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Directconnect
|
@@ -9,11 +11,12 @@ module Awspec::Generator
|
|
9
11
|
def generate_virtual_interface_all
|
10
12
|
virtual_interfaces = select_virtual_interfaces
|
11
13
|
raise 'Not Found virtual_interfaces' if virtual_interfaces.empty?
|
14
|
+
|
12
15
|
ERB.new(virtual_interface_spec_template, nil, '-').result(binding).chomp
|
13
16
|
end
|
14
17
|
|
15
18
|
def virtual_interface_spec_template
|
16
|
-
|
19
|
+
<<-'EOF'
|
17
20
|
<% virtual_interfaces.each do |interface| %>
|
18
21
|
describe directconnect_virtual_interface('<%= interface.virtual_interface_name %>') do
|
19
22
|
it { should exist }
|
@@ -26,7 +29,6 @@ describe directconnect_virtual_interface('<%= interface.virtual_interface_name %
|
|
26
29
|
end
|
27
30
|
<% end %>
|
28
31
|
EOF
|
29
|
-
template
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Ebs
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
volumes = select_all_attached_ebs
|
7
9
|
raise 'Not Found EBS' if volumes.empty?
|
10
|
+
|
8
11
|
specs = volumes.map do |volume|
|
9
12
|
attachment_specs = generate_attachment_specs(volume)
|
10
13
|
content = ERB.new(ebs_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
@@ -22,18 +25,17 @@ module Awspec::Generator
|
|
22
25
|
end
|
23
26
|
|
24
27
|
def attachment_linetemplate
|
25
|
-
|
28
|
+
<<-'EOF'
|
26
29
|
<%- if instance.tag_name -%>
|
27
30
|
it { should be_attached_to('<%= instance.tag_name %>') }
|
28
31
|
<%- else -%>
|
29
32
|
it { should be_attached_to('<%= instance.instance_id %>') }
|
30
33
|
<%- end -%>
|
31
34
|
EOF
|
32
|
-
template
|
33
35
|
end
|
34
36
|
|
35
37
|
def ebs_spec_template
|
36
|
-
|
38
|
+
<<-'EOF'
|
37
39
|
<%- if volume.tag_name -%>
|
38
40
|
describe ebs('<%= volume.tag_name %>') do
|
39
41
|
<%- else -%>
|
@@ -48,7 +50,6 @@ describe ebs('<%= volume.volume_id %>') do
|
|
48
50
|
<% end %>
|
49
51
|
end
|
50
52
|
EOF
|
51
|
-
template
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
@@ -1,14 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Ec2
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
8
|
+
describes = %w[
|
7
9
|
instance_id image_id private_dns_name public_dns_name
|
8
10
|
instance_type private_ip_address public_ip_address
|
9
|
-
|
11
|
+
]
|
10
12
|
vpc = find_vpc(vpc_id)
|
11
13
|
raise 'Not Found VPC' unless vpc
|
14
|
+
|
12
15
|
@vpc_id = vpc[:vpc_id]
|
13
16
|
@vpc_tag_name = vpc.tag_name
|
14
17
|
instances = select_ec2_by_vpc_id(@vpc_id)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Efs
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
file_systems = select_all_file_systems
|
7
9
|
raise 'EFS not found' if file_systems.empty?
|
10
|
+
|
8
11
|
specs = file_systems.map do |file_system|
|
9
12
|
file_system.name = get_name_by_id(file_system.file_system_id)
|
10
13
|
content = ERB.new(file_system_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
@@ -13,7 +16,7 @@ module Awspec::Generator
|
|
13
16
|
end
|
14
17
|
|
15
18
|
def file_system_spec_template
|
16
|
-
|
19
|
+
<<-'EOF'
|
17
20
|
describe efs('<%= file_system.name %>') do
|
18
21
|
it { should exist }
|
19
22
|
its(:number_of_mount_targets) { should eq <%= file_system.number_of_mount_targets %> }
|
@@ -21,7 +24,6 @@ describe efs('<%= file_system.name %>') do
|
|
21
24
|
its(:performance_mode) { should eq '<%= file_system.performance_mode %>' }
|
22
25
|
end
|
23
26
|
EOF
|
24
|
-
template
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Eip
|
@@ -10,11 +12,12 @@ module Awspec::Generator
|
|
10
12
|
def generate_all
|
11
13
|
eips = select_all_addresses
|
12
14
|
raise 'Not Found Elastic IP addresses.' if eips.empty?
|
15
|
+
|
13
16
|
ERB.new(eip_spec_template, nil, '-').result(binding).chomp
|
14
17
|
end
|
15
18
|
|
16
19
|
def eip_spec_template
|
17
|
-
|
20
|
+
<<-'EOF'
|
18
21
|
<% eips.each do |eip| %>
|
19
22
|
describe eip('<%= eip.public_ip %>') do
|
20
23
|
it { should exist }
|
@@ -23,7 +26,6 @@ describe eip('<%= eip.public_ip %>') do
|
|
23
26
|
end
|
24
27
|
<% end %>
|
25
28
|
EOF
|
26
|
-
template
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Elasticache
|
@@ -9,14 +11,16 @@ module Awspec::Generator
|
|
9
11
|
res = elasticache_client.describe_cache_clusters(opt)
|
10
12
|
clusters.push(*res.cache_clusters)
|
11
13
|
break if res.marker.nil?
|
14
|
+
|
12
15
|
opt = { marker: res.marker }
|
13
16
|
end
|
14
17
|
raise 'Not Found Cache Clusters' if clusters.empty?
|
18
|
+
|
15
19
|
ERB.new(cache_clusters_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
16
20
|
end
|
17
21
|
|
18
22
|
def cache_clusters_spec_template
|
19
|
-
|
23
|
+
<<-'EOF'
|
20
24
|
<% clusters.each do |cluster| %>
|
21
25
|
describe elasticache('<%= cluster.cache_cluster_id %>') do
|
22
26
|
it { should exist }
|
@@ -36,7 +40,6 @@ describe elasticache('<%= cluster.cache_cluster_id %>') do
|
|
36
40
|
end
|
37
41
|
<% end %>
|
38
42
|
EOF
|
39
|
-
template
|
40
43
|
end
|
41
44
|
end
|
42
45
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Elasticsearch
|
@@ -5,11 +7,12 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
domains = select_all_elasticsearch_domains
|
7
9
|
raise 'Not Found Domain' if domains.empty?
|
10
|
+
|
8
11
|
ERB.new(domain_spec_template, nil, '-').result(binding).gsub(/^\n/, '')
|
9
12
|
end
|
10
13
|
|
11
14
|
def domain_spec_template
|
12
|
-
|
15
|
+
<<-'EOF'
|
13
16
|
<% domains.each do |domain| %>
|
14
17
|
describe elasticsearch('<%= domain.domain_status.domain_name %>') do
|
15
18
|
it { should exist }
|
@@ -34,7 +37,6 @@ describe elasticsearch('<%= domain.domain_status.domain_name %>') do
|
|
34
37
|
end
|
35
38
|
<% end %>
|
36
39
|
EOF
|
37
|
-
template
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
@@ -1,17 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class Elb
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
8
|
+
describes = %w[
|
7
9
|
load_balancer_name
|
8
|
-
|
9
|
-
health_check_options = %w
|
10
|
+
]
|
11
|
+
health_check_options = %w[
|
10
12
|
target interval timeout
|
11
13
|
unhealthy_threshold healthy_threshold
|
12
|
-
|
14
|
+
]
|
13
15
|
vpc = find_vpc(vpc_id)
|
14
16
|
raise 'Not Found VPC' unless vpc
|
17
|
+
|
15
18
|
@vpc_id = vpc[:vpc_id]
|
16
19
|
@vpc_tag_name = vpc.tag_name
|
17
20
|
lbs = select_elb_by_vpc_id(@vpc_id)
|
@@ -23,7 +26,7 @@ module Awspec::Generator
|
|
23
26
|
end
|
24
27
|
|
25
28
|
def elb_spec_template
|
26
|
-
|
29
|
+
<<-'EOF'
|
27
30
|
describe elb('<%= lb.load_balancer_name %>') do
|
28
31
|
it { should exist }
|
29
32
|
<% describes.each do |describe| %>
|
@@ -52,7 +55,6 @@ describe elb('<%= lb.load_balancer_name %>') do
|
|
52
55
|
<% end %>
|
53
56
|
end
|
54
57
|
EOF
|
55
|
-
template
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class IamGroup
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
groups = select_all_iam_groups
|
7
9
|
raise 'Not Found IAM Group' if groups.empty?
|
10
|
+
|
8
11
|
specs = groups.map do |group|
|
9
12
|
inline_policies = select_inline_policy_by_group_name(group.group_name).map do |policy_name|
|
10
13
|
res = iam_client.get_group_policy({
|
@@ -20,7 +23,7 @@ module Awspec::Generator
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def iam_group_spec_template
|
23
|
-
|
26
|
+
<<-'EOF'
|
24
27
|
describe iam_group('<%= group.group_name %>') do
|
25
28
|
it { should exist }
|
26
29
|
its(:arn) { should eq '<%= group.arn %>' }
|
@@ -32,7 +35,6 @@ describe iam_group('<%= group.group_name %>') do
|
|
32
35
|
<%- end -%>
|
33
36
|
end
|
34
37
|
EOF
|
35
|
-
template
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class IamPolicy
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
policies = select_all_attached_policies
|
7
9
|
raise 'Not Found policy' if policies.empty?
|
10
|
+
|
8
11
|
ERB.new(policy_spec_template, nil, '-').result(binding).chomp
|
9
12
|
end
|
10
13
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class IamRole
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
roles = select_all_iam_roles
|
7
9
|
raise 'Not Found IAM Role' if roles.empty?
|
10
|
+
|
8
11
|
specs = roles.map do |role|
|
9
12
|
inline_policies = select_inline_policy_by_role_name(role.role_name).map do |policy_name|
|
10
13
|
res = iam_client.get_role_policy({
|
@@ -20,7 +23,7 @@ module Awspec::Generator
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def iam_role_spec_template
|
23
|
-
|
26
|
+
<<-'EOF'
|
24
27
|
describe iam_role('<%= role.role_name %>') do
|
25
28
|
it { should exist }
|
26
29
|
its(:arn) { should eq '<%= role.arn %>' }
|
@@ -32,7 +35,6 @@ describe iam_role('<%= role.role_name %>') do
|
|
32
35
|
<%- end -%>
|
33
36
|
end
|
34
37
|
EOF
|
35
|
-
template
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class IamUser
|
@@ -5,6 +7,7 @@ module Awspec::Generator
|
|
5
7
|
def generate_all
|
6
8
|
users = select_all_iam_users
|
7
9
|
raise 'Not Found IAM User' if users.empty?
|
10
|
+
|
8
11
|
specs = users.map do |user|
|
9
12
|
inline_policies = select_inline_policy_by_user_name(user.user_name).map do |policy_name|
|
10
13
|
res = iam_client.get_user_policy({
|
@@ -20,7 +23,7 @@ module Awspec::Generator
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def iam_user_spec_template
|
23
|
-
|
26
|
+
<<-'EOF'
|
24
27
|
describe iam_user('<%= user.user_name %>') do
|
25
28
|
it { should exist }
|
26
29
|
its(:arn) { should eq '<%= user.arn %>' }
|
@@ -32,7 +35,6 @@ describe iam_user('<%= user.user_name %>') do
|
|
32
35
|
<%- end -%>
|
33
36
|
end
|
34
37
|
EOF
|
35
|
-
template
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
@@ -1,12 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Generator
|
2
4
|
module Spec
|
3
5
|
class InternetGateway
|
4
6
|
include Awspec::Helper::Finder
|
5
7
|
def generate_by_vpc_id(vpc_id)
|
6
|
-
describes = %w
|
7
|
-
|
8
|
+
describes = %w[
|
9
|
+
]
|
8
10
|
vpc = find_vpc(vpc_id)
|
9
11
|
raise 'Not Found VPC' unless vpc
|
12
|
+
|
10
13
|
@vpc_id = vpc[:vpc_id]
|
11
14
|
@vpc_tag_name = vpc.tag_name
|
12
15
|
internet_gateways = select_internet_gateway_by_vpc_id(@vpc_id)
|
@@ -18,7 +21,7 @@ module Awspec::Generator
|
|
18
21
|
end
|
19
22
|
|
20
23
|
def internet_gateway_spec_template
|
21
|
-
|
24
|
+
<<-'EOF'
|
22
25
|
describe internet_gateway('<%= internet_gateway_id %>') do
|
23
26
|
it { should exist }
|
24
27
|
<%- if @vpc_tag_name -%>
|
@@ -28,7 +31,6 @@ describe internet_gateway('<%= internet_gateway_id %>') do
|
|
28
31
|
<%- end -%>
|
29
32
|
end
|
30
33
|
EOF
|
31
|
-
template
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|