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
data/lib/awspec/helper/type.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec
|
2
4
|
module Helper
|
3
5
|
module Type
|
@@ -7,7 +9,7 @@ module Awspec
|
|
7
9
|
require 'awspec/type/account'
|
8
10
|
require 'awspec/type/account_attribute'
|
9
11
|
|
10
|
-
TYPES = %w
|
12
|
+
TYPES = %w[
|
11
13
|
alb alb_listener alb_target_group ami apigateway autoscaling_group
|
12
14
|
batch_compute_environment batch_job_definition batch_job_queue cloudtrail
|
13
15
|
cloudwatch_alarm cloudwatch_event directconnect_virtual_interface
|
@@ -21,11 +23,11 @@ module Awspec
|
|
21
23
|
internet_gateway acm cloudwatch_logs dynamodb_table eip sqs ssm_parameter cloudformation_stack
|
22
24
|
codebuild sns_topic redshift redshift_cluster_parameter_group codedeploy codedeploy_deployment_group
|
23
25
|
secretsmanager msk transit_gateway cognito_identity_pool cognito_user_pool vpc_endpoints
|
24
|
-
|
26
|
+
]
|
25
27
|
|
26
|
-
ACCOUNT_ATTRIBUTES = %w
|
28
|
+
ACCOUNT_ATTRIBUTES = %w[
|
27
29
|
ec2_account_attributes rds_account_attributes lambda_account_settings ses_send_quota
|
28
|
-
|
30
|
+
]
|
29
31
|
|
30
32
|
TYPES.each do |type|
|
31
33
|
require "awspec/type/#{type}"
|
@@ -33,6 +35,7 @@ module Awspec
|
|
33
35
|
unless Object.const_get("Awspec::Type::#{type.camelize}").superclass.to_s == 'Awspec::Type::ResourceBase'
|
34
36
|
raise "Awspec::Type::#{type.camelize} should extend Awspec::Type::ResourceBase"
|
35
37
|
end
|
38
|
+
|
36
39
|
name = args.first
|
37
40
|
eval "Awspec::Type::#{type.camelize}.new(name)"
|
38
41
|
end
|
@@ -45,6 +48,7 @@ module Awspec
|
|
45
48
|
== 'Awspec::Type::AccountAttributeBase'
|
46
49
|
raise "Awspec::Type::#{type.camelize} should extend Awspec::Type::AccountAttributeBase"
|
47
50
|
end
|
51
|
+
|
48
52
|
eval "Awspec::Type::#{type.camelize}.new"
|
49
53
|
end
|
50
54
|
end
|
data/lib/awspec/helper.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :be_attached_to do |instance_id|
|
2
4
|
match do |type|
|
3
5
|
# NetworkInterface
|
4
6
|
if type.instance_of?(Awspec::Type::NetworkInterface)
|
5
7
|
return type.attached_to?(instance_id, @device_index)
|
6
8
|
end
|
9
|
+
|
7
10
|
type.attached_to?(instance_id)
|
8
11
|
end
|
9
12
|
|
@@ -1,8 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :belong_to_alb do |alb_arn|
|
2
4
|
match do |type|
|
3
5
|
return true if type.load_balancer_arns.include?(alb_arn)
|
6
|
+
|
4
7
|
ret = type.find_alb(alb_arn)
|
5
8
|
return false unless ret
|
9
|
+
|
6
10
|
type.load_balancer_arns.include?(ret.load_balancer_arn)
|
7
11
|
end
|
8
12
|
end
|
@@ -1,8 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :belong_to_nlb do |nlb_arn|
|
2
4
|
match do |type|
|
3
5
|
return true if type.load_balancer_arns.include?(nlb_arn)
|
6
|
+
|
4
7
|
ret = type.find_nlb(nlb_arn)
|
5
8
|
return false unless ret
|
9
|
+
|
6
10
|
type.load_balancer_arns.include?(ret.load_balancer_arn)
|
7
11
|
end
|
8
12
|
end
|
@@ -1,10 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :belong_to_subnet do |subnet_id|
|
2
4
|
match do |type|
|
3
5
|
# EC2, NetworkInterface
|
4
6
|
if type.instance_of?(Awspec::Type::Ec2) || type.instance_of?(Awspec::Type::NetworkInterface)
|
5
7
|
return true if type.subnet_id == subnet_id
|
8
|
+
|
6
9
|
subnet = type.find_subnet(subnet_id)
|
7
10
|
return false unless subnet
|
11
|
+
|
8
12
|
return subnet[:subnet_id] == type.subnet_id
|
9
13
|
end
|
10
14
|
|
@@ -21,6 +25,7 @@ RSpec::Matchers.define :belong_to_subnet do |subnet_id|
|
|
21
25
|
filters: [{ name: 'tag:Name', values: [subnet_id] }]
|
22
26
|
})
|
23
27
|
return false unless res
|
28
|
+
|
24
29
|
ret = subnets.find do |s|
|
25
30
|
s[:subnet_identifier] == res[:subnets][0][:subnet_id]
|
26
31
|
end
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_custom_response_error_code do |error_code|
|
2
4
|
match do |cloudfront_distribution|
|
3
5
|
cloudfront_distribution.has_custom_response_error_code?(error_code,
|
4
6
|
response_page_path: @response_page_path,
|
5
7
|
response_code: @response_code,
|
6
|
-
error_caching_min_ttl: @error_caching_min_ttl
|
7
|
-
)
|
8
|
+
error_caching_min_ttl: @error_caching_min_ttl)
|
8
9
|
end
|
9
10
|
|
10
11
|
chain :response_page_path do |response_page_path|
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_origin do |origin_id|
|
2
4
|
match do |cloudfront_distribution|
|
3
5
|
cloudfront_distribution.has_origin?(origin_id,
|
4
6
|
domain_name: @domain_name,
|
5
7
|
origin_path: @origin_path,
|
6
|
-
origin_access_identity: @origin_access_identity
|
7
|
-
)
|
8
|
+
origin_access_identity: @origin_access_identity)
|
8
9
|
end
|
9
10
|
|
10
11
|
chain :domain_name do |domain_name|
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_record_set do |name|
|
2
4
|
match do |hosted_zone|
|
3
5
|
hosted_zone.has_record_set?(name, @type, @value, @options)
|
4
6
|
end
|
5
7
|
|
6
|
-
%w
|
8
|
+
%w[soa a txt ns cname mx ptr srv spf aaaa caa].each do |type|
|
7
9
|
chain type do |value|
|
8
10
|
@type = type
|
9
11
|
@value = value
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_route do |destination|
|
2
4
|
match do |route_table|
|
3
5
|
if !is_ipaddr?(destination) && @use_destination # for deprecated usage
|
@@ -16,10 +18,10 @@ RSpec::Matchers.define :have_route do |destination|
|
|
16
18
|
end
|
17
19
|
|
18
20
|
chain :destination do |dest|
|
19
|
-
# rubocop:disable
|
21
|
+
# rubocop:disable Layout/LineLength
|
20
22
|
puts ''
|
21
23
|
warn Color.on_red(Color.white('!!! route_table destination is deprecated. see https://github.com/k1LoW/awspec/pull/65 !!!'))
|
22
|
-
# rubocop:enable
|
24
|
+
# rubocop:enable Layout/LineLength
|
23
25
|
@use_destination = true
|
24
26
|
@destination = dest
|
25
27
|
end
|
@@ -28,7 +30,7 @@ RSpec::Matchers.define :have_route do |destination|
|
|
28
30
|
|
29
31
|
def is_ipaddr?(str)
|
30
32
|
IPAddr.new(str)
|
31
|
-
rescue
|
33
|
+
rescue StandardError
|
32
34
|
false
|
33
35
|
end
|
34
36
|
end
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_rule do |rule_id|
|
2
4
|
match do |type|
|
3
5
|
return type.has_rule?(rule_id, @priority, @action) if type.instance_of?(Awspec::Type::WafWebAcl)
|
4
6
|
return type.has_rule?(rule_id, @priority, @action) if type.instance_of?(Awspec::Type::WafregionalWebAcl)
|
5
7
|
return type.has_rule?(rule_id, @priority, @conditions, @actions) if type.instance_of?(Awspec::Type::AlbListener)
|
8
|
+
|
6
9
|
type.has_rule?(rule_id, @priority, @conditions, @actions) if type.instance_of?(Awspec::Type::NlbListener)
|
7
10
|
end
|
8
11
|
|
@@ -1,8 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec::Matchers.define :have_subscription_attributes do |expected_attribs|
|
2
4
|
match do |sns_topic|
|
3
5
|
unless expected_attribs.key?(:subscription_arn)
|
4
6
|
raise '"subscription_arn" is the only required attribute to validate'
|
5
7
|
end
|
8
|
+
|
6
9
|
subscribed = sns_topic.subscribed(expected_attribs[:subscription_arn])
|
7
10
|
temp = subscribed.to_h
|
8
11
|
to_remove = temp.keys - expected_attribs.keys
|
data/lib/awspec/matcher.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec
|
2
4
|
module BlackListForwardable
|
3
5
|
class CalledMethodInBlackList < StandardError
|
@@ -8,6 +10,7 @@ module Awspec
|
|
8
10
|
if match_black_list?(name) && !match_white_list?(name)
|
9
11
|
raise CalledMethodInBlackList, "Method call #{name.inspect} is black-listed"
|
10
12
|
end
|
13
|
+
|
11
14
|
attr = delegate_to.send(name)
|
12
15
|
if !attr.is_a?(Struct) && attr.class.name.match(/^Aws::/)
|
13
16
|
ResourceReader.new(attr)
|
data/lib/awspec/setup.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
require 'yaml'
|
3
5
|
|
@@ -18,7 +20,7 @@ EOF
|
|
18
20
|
dir = 'spec'
|
19
21
|
if File.exist? dir
|
20
22
|
unless File.directory? dir
|
21
|
-
|
23
|
+
warn "!! #{dir} already exists and is not a directory"
|
22
24
|
end
|
23
25
|
else
|
24
26
|
FileUtils.mkdir dir
|
@@ -26,7 +28,7 @@ EOF
|
|
26
28
|
end
|
27
29
|
|
28
30
|
if File.exist? 'spec/spec_helper.rb'
|
29
|
-
|
31
|
+
warn '!! spec/spec_helper.rb already exists'
|
30
32
|
else
|
31
33
|
File.open('spec/spec_helper.rb', 'w') do |f|
|
32
34
|
f.puts content
|
@@ -43,7 +45,7 @@ task :default => :spec
|
|
43
45
|
EOF
|
44
46
|
|
45
47
|
if File.exist? 'Rakefile'
|
46
|
-
|
48
|
+
warn '!! Rakefile already exists'
|
47
49
|
else
|
48
50
|
File.open('Rakefile', 'w') do |f|
|
49
51
|
f.puts content
|
@@ -57,7 +59,7 @@ EOF
|
|
57
59
|
secrets.yml
|
58
60
|
EOF
|
59
61
|
if File.exist? 'spec/.gitignore'
|
60
|
-
|
62
|
+
warn '!! spec/.gitignore already exists'
|
61
63
|
else
|
62
64
|
File.open('spec/.gitignore', 'w') do |f|
|
63
65
|
f.puts content
|
@@ -72,7 +74,7 @@ EOF
|
|
72
74
|
--format documentation
|
73
75
|
EOF
|
74
76
|
if File.exist? '.rspec'
|
75
|
-
|
77
|
+
warn '!! .rspec already exists'
|
76
78
|
else
|
77
79
|
File.open('.rspec', 'w') do |f|
|
78
80
|
f.puts content
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
shared_context 'region', :region do
|
2
4
|
before do |example|
|
3
5
|
region = example.metadata[:region]
|
@@ -14,6 +16,7 @@ shared_context 'account', :account do
|
|
14
16
|
before do |example|
|
15
17
|
sts_client = Aws::STS::Client.new
|
16
18
|
raise Awspec::InvalidAccountError unless sts_client.get_caller_identity.account == example.metadata[:account]
|
19
|
+
|
17
20
|
example.metadata[:described_class].account = example.metadata[:account]
|
18
21
|
end
|
19
22
|
end
|
data/lib/awspec/stub/account.rb
CHANGED
data/lib/awspec/stub/acm.rb
CHANGED
data/lib/awspec/stub/alb.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Layout/LineLength
|
2
4
|
Aws.config[:elasticloadbalancingv2] = {
|
3
5
|
stub_responses: {
|
4
6
|
describe_load_balancers: {
|
@@ -129,8 +131,7 @@ Aws.config[:elasticloadbalancingv2] = {
|
|
129
131
|
type: 'forward'
|
130
132
|
}
|
131
133
|
],
|
132
|
-
conditions: [
|
133
|
-
],
|
134
|
+
conditions: [],
|
134
135
|
is_default: true,
|
135
136
|
priority: 'default',
|
136
137
|
rule_arn: 'arn:aws:elasticloadbalancing:ap-northeast-1:1234567890:listener-rule/app/my-alb/1aa1bb1cc1ddee11/f2f7dc8efc522ab2/defaaaaaaaultbbbb'
|
data/lib/awspec/stub/ami.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop:disable Layout/LineLength
|
2
4
|
Aws.config[:autoscaling] = {
|
3
5
|
stub_responses: {
|
4
6
|
describe_auto_scaling_groups: {
|
@@ -11,9 +13,9 @@ Aws.config[:autoscaling] = {
|
|
11
13
|
max_size: 20,
|
12
14
|
desired_capacity: 4,
|
13
15
|
default_cooldown: 300,
|
14
|
-
availability_zones: [
|
15
|
-
|
16
|
-
|
16
|
+
availability_zones: %w[
|
17
|
+
ap-northeast-1a
|
18
|
+
ap-northeast-1c
|
17
19
|
],
|
18
20
|
load_balancer_names: [
|
19
21
|
'my-elb'
|