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/stub/nlb.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: {
|
@@ -85,8 +87,7 @@ Aws.config[:elasticloadbalancingv2] = {
|
|
85
87
|
type: 'forward'
|
86
88
|
}
|
87
89
|
],
|
88
|
-
conditions: [
|
89
|
-
],
|
90
|
+
conditions: [],
|
90
91
|
is_default: true,
|
91
92
|
priority: 'default',
|
92
93
|
rule_arn: 'arn:aws:elasticloadbalancing:ap-northeast-1:1234567890:listener-rule/app/my-nlb/1aa1bb1cc1ddee11/f2f7dc8efc522ab2/defaaaaaaaultbbbb'
|
data/lib/awspec/stub/rds.rb
CHANGED
data/lib/awspec/stub/redshift.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
OWNER = '123456789'
|
2
4
|
REGION = 'us-east-1'
|
3
5
|
TOPIC_ARN = "arn:aws:sns:#{REGION}:#{OWNER}:foobar"
|
@@ -9,7 +11,7 @@ Aws.config[:sns] = {
|
|
9
11
|
stub_responses: {
|
10
12
|
get_topic_attributes: {
|
11
13
|
attributes: {
|
12
|
-
# rubocop:disable LineLength
|
14
|
+
# rubocop:disable Layout/LineLength
|
13
15
|
'Policy' => "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:GetTopicAttributes\",\"SNS:SetTopicAttributes\",\"SNS:AddPermission\",\"SNS:RemovePermission\",\"SNS:DeleteTopic\",\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:Publish\",\"SNS:Receive\"],\"Resource\":\"arn:aws:sns:#{REGION}:#{OWNER}:foobar-lambda-sample\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"#{OWNER}\"}}}]}",
|
14
16
|
'Owner' => OWNER,
|
15
17
|
'SubscriptionsPending' => '0',
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
OWNER = '123456789'
|
2
4
|
REGION = 'us-east-1'
|
3
5
|
TOPIC_ARN = "arn:aws:sns:#{REGION}:#{OWNER}:invalid"
|
@@ -6,8 +8,10 @@ TOPIC_SUBS_ARN = "arn:aws:sns:us-east-1:#{OWNER}:Foobar:3dbf4999-b3e2-4345-bd11-
|
|
6
8
|
Aws.config[:sns] = {
|
7
9
|
stub_responses: {
|
8
10
|
get_topic_attributes: Aws::SNS::Errors::NotFound.new(
|
9
|
-
TOPIC_ARN, 'no such topic'
|
11
|
+
TOPIC_ARN, 'no such topic'
|
12
|
+
),
|
10
13
|
list_subscriptions_by_topic: Aws::SNS::Errors::NotFound.new(
|
11
|
-
TOPIC_SUBS_ARN, 'no such topic'
|
14
|
+
TOPIC_SUBS_ARN, 'no such topic'
|
15
|
+
)
|
12
16
|
}
|
13
17
|
}
|
data/lib/awspec/stub/sqs.rb
CHANGED
data/lib/awspec/stub/subnet.rb
CHANGED
data/lib/awspec/stub/vpc.rb
CHANGED
data/lib/awspec/stub.rb
CHANGED
data/lib/awspec/toolbox.rb
CHANGED
data/lib/awspec/type/account.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Account < Base
|
3
5
|
REMOVE_SUFFIX_RE = /
|
@@ -10,7 +12,7 @@ module Awspec::Type
|
|
10
12
|
key = type.gsub(REMOVE_SUFFIX_RE, '').to_sym
|
11
13
|
if key == 'ses'
|
12
14
|
# https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
|
13
|
-
next unless [
|
15
|
+
next unless %w[us-east-1 us-west-2 eu-west-1].include?(Aws.config[:region])
|
14
16
|
end
|
15
17
|
eval "attributes[key] = Awspec::Type::#{type.camelize}.new.resource_via_client"
|
16
18
|
end
|
@@ -30,7 +32,7 @@ module Awspec::Type
|
|
30
32
|
end
|
31
33
|
|
32
34
|
def method_missing(name)
|
33
|
-
name = name.to_s if name.
|
35
|
+
name = name.to_s if name.instance_of?(Symbol)
|
34
36
|
describe = name.tr('-', '_').to_sym
|
35
37
|
super unless resource_via_client.members.include?(describe)
|
36
38
|
resource_via_client[describe]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class AccountAttribute < Base
|
3
5
|
def initialize(key = nil)
|
@@ -9,9 +11,10 @@ module Awspec::Type
|
|
9
11
|
Awspec::Helper::Type::ACCOUNT_ATTRIBUTES.each do |type|
|
10
12
|
key = type.gsub(Awspec::Type::Account::REMOVE_SUFFIX_RE, '').to_sym
|
11
13
|
next unless key == @key
|
14
|
+
|
12
15
|
if key == 'ses'
|
13
16
|
# https://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html
|
14
|
-
next unless [
|
17
|
+
next unless %w[us-east-1 us-west-2 eu-west-1].include?(Aws.config[:region])
|
15
18
|
end
|
16
19
|
eval "attributes = Awspec::Type::#{type.camelize}.new.resource_via_client"
|
17
20
|
end
|
@@ -19,7 +22,7 @@ module Awspec::Type
|
|
19
22
|
end
|
20
23
|
|
21
24
|
def method_missing(name)
|
22
|
-
name = name.to_s if name.
|
25
|
+
name = name.to_s if name.instance_of?(Symbol)
|
23
26
|
describe = name.tr('-', '_').to_sym
|
24
27
|
super unless resource_via_client.members.include?(describe)
|
25
28
|
resource_via_client[describe]
|
data/lib/awspec/type/acm.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Acm < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -8,7 +10,7 @@ module Awspec::Type
|
|
8
10
|
@id ||= resource_via_client.certificate_arn if resource_via_client
|
9
11
|
end
|
10
12
|
|
11
|
-
STATUSES = %w
|
13
|
+
STATUSES = %w[
|
12
14
|
PENDING_VALIDATION
|
13
15
|
ISSUED
|
14
16
|
INACTIVE
|
@@ -16,25 +18,25 @@ module Awspec::Type
|
|
16
18
|
VALIDATION_TIMED_OUT
|
17
19
|
REVOKED
|
18
20
|
FAILED
|
19
|
-
|
21
|
+
]
|
20
22
|
|
21
23
|
STATUSES.each do |status|
|
22
|
-
define_method status.downcase
|
24
|
+
define_method "#{status.downcase}?" do
|
23
25
|
resource_via_client.status == status
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
27
29
|
def has_domain_name?(domain)
|
28
30
|
resource_via_client.domain_name == domain && \
|
29
|
-
|
31
|
+
resource_via_client.certificate_arn == id
|
30
32
|
end
|
31
33
|
|
32
34
|
def has_domain_validation_option?(domain_name:, validation_method:, validation_status: nil)
|
33
35
|
resource_via_client.domain_validation_options.find do |domain_validation_option|
|
34
36
|
validation_status ||= domain_validation_option.validation_status
|
35
37
|
domain_validation_option.domain_name == domain_name && \
|
36
|
-
|
37
|
-
|
38
|
+
domain_validation_option.validation_method == validation_method && \
|
39
|
+
domain_validation_option.validation_status == validation_status
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
data/lib/awspec/type/alb.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Alb < ResourceBase
|
3
5
|
tags_allowed
|
@@ -9,12 +11,12 @@ module Awspec::Type
|
|
9
11
|
@id ||= resource_via_client.load_balancer_name if resource_via_client
|
10
12
|
end
|
11
13
|
|
12
|
-
STATES = %w
|
14
|
+
STATES = %w[
|
13
15
|
active provisioning failed
|
14
|
-
|
16
|
+
]
|
15
17
|
|
16
18
|
STATES.each do |state|
|
17
|
-
define_method state
|
19
|
+
define_method "#{state}?" do
|
18
20
|
check_existence
|
19
21
|
resource_via_client.state.code == state
|
20
22
|
end
|
@@ -27,8 +29,10 @@ module Awspec::Type
|
|
27
29
|
sg == sg_id
|
28
30
|
end
|
29
31
|
return true if ret
|
32
|
+
|
30
33
|
sg2 = find_security_group(sg_id)
|
31
34
|
return true if sgs.include? sg2.group_id
|
35
|
+
|
32
36
|
false
|
33
37
|
end
|
34
38
|
|
@@ -39,6 +43,7 @@ module Awspec::Type
|
|
39
43
|
az.subnet_id == subnet_id
|
40
44
|
end
|
41
45
|
return true if ret
|
46
|
+
|
42
47
|
subnet2 = find_subnet(subnet_id)
|
43
48
|
subnet2.subnet_id = subnet_id
|
44
49
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class AlbListener < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -15,11 +17,13 @@ module Awspec::Type
|
|
15
17
|
actions = [actions] if actions.is_a?(Hash)
|
16
18
|
next false if !rule_id.nil? && rule.rule_arn != rule_id
|
17
19
|
next false if !priority.nil? && rule.priority != priority
|
20
|
+
|
18
21
|
unless conditions.nil?
|
19
22
|
next false unless conditions.map do |condition|
|
20
23
|
rule_conds = rule.conditions.select { |rule_cond| rule_cond[:field] == condition[:field] }
|
21
24
|
next if rule_conds.empty?
|
22
25
|
next unless rule_conds.reject { |rule_cond| condition[:values] == rule_cond[:values] }.empty?
|
26
|
+
|
23
27
|
condition
|
24
28
|
end.compact.size == conditions.size
|
25
29
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class AlbTargetGroup < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -11,6 +13,7 @@ module Awspec::Type
|
|
11
13
|
def has_ec2?(id)
|
12
14
|
ec2 = find_ec2(id)
|
13
15
|
return nil unless ec2
|
16
|
+
|
14
17
|
descriptions = elbv2_client.describe_target_health(
|
15
18
|
target_group_arn: resource_via_client.target_group_arn
|
16
19
|
).target_health_descriptions
|
data/lib/awspec/type/ami.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Ami < ResourceBase
|
3
5
|
aws_resource Aws::EC2::Image
|
@@ -11,13 +13,13 @@ module Awspec::Type
|
|
11
13
|
@id ||= resource_via_client.image_id if resource_via_client
|
12
14
|
end
|
13
15
|
|
14
|
-
STATES = %w
|
16
|
+
STATES = %w[
|
15
17
|
pending available invalid deregistered
|
16
18
|
transient failed error
|
17
|
-
|
19
|
+
]
|
18
20
|
|
19
21
|
STATES.each do |state|
|
20
|
-
define_method state
|
22
|
+
define_method "#{state}?" do
|
21
23
|
resource_via_client.state == state
|
22
24
|
end
|
23
25
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'addressable/uri'
|
2
4
|
|
3
5
|
module Awspec::Type
|
@@ -7,6 +9,7 @@ module Awspec::Type
|
|
7
9
|
def resource_via_client
|
8
10
|
@resource_via_client ||= find_apigateway_by_id(@display_name)
|
9
11
|
return @resource_via_client if @resource_via_client
|
12
|
+
|
10
13
|
@resource_via_client = find_apigateway_by_name(@display_name)
|
11
14
|
end
|
12
15
|
|
@@ -20,7 +23,7 @@ module Awspec::Type
|
|
20
23
|
|
21
24
|
def has_path?(path)
|
22
25
|
check_existence
|
23
|
-
|
26
|
+
api_resources.each do |resource|
|
24
27
|
return resource if resource.path == path
|
25
28
|
end
|
26
29
|
nil
|
@@ -28,11 +31,12 @@ module Awspec::Type
|
|
28
31
|
|
29
32
|
def has_integration_path?(path)
|
30
33
|
check_existence
|
31
|
-
|
34
|
+
api_resources.each do |resource|
|
32
35
|
next if resource.resource_methods.nil?
|
36
|
+
|
33
37
|
resource.resource_methods.each do |_, method|
|
34
38
|
if method.method_integration.http_method == 'AWS'
|
35
|
-
aws_path = method.method_integration.uri.match(%r{(
|
39
|
+
aws_path = method.method_integration.uri.match(%r{(/[^?]+)\??.*$}).captures[0] # Matches for ARN type path
|
36
40
|
return resource if aws_path == path
|
37
41
|
end
|
38
42
|
uri = Addressable::URI.parse(method.method_integration.uri)
|
@@ -46,6 +50,7 @@ module Awspec::Type
|
|
46
50
|
check_existence
|
47
51
|
resource_to_check = has_path?(path)
|
48
52
|
return nil if resource_to_check.nil?
|
53
|
+
|
49
54
|
resource_to_check.resource_methods.each do |_, method|
|
50
55
|
return resource_to_check if method.http_method == http_method
|
51
56
|
end
|
@@ -56,6 +61,7 @@ module Awspec::Type
|
|
56
61
|
check_existence
|
57
62
|
integration_resource_to_check = has_integration_path?(integration_path)
|
58
63
|
return nil if integration_resource_to_check.nil?
|
64
|
+
|
59
65
|
integration_resource_to_check.resource_methods.each do |_, method|
|
60
66
|
return integration_resource_to_check if method.method_integration.http_method == http_method
|
61
67
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class AutoscalingGroup < ResourceBase
|
3
5
|
aws_resource Aws::AutoScaling::AutoScalingGroup
|
@@ -20,6 +22,7 @@ module Awspec::Type
|
|
20
22
|
def has_ec2?(id)
|
21
23
|
ec2 = find_ec2(id)
|
22
24
|
return nil unless ec2
|
25
|
+
|
23
26
|
resource_via_client.instances.one? do |instance|
|
24
27
|
instance.instance_id == ec2.instance_id
|
25
28
|
end
|
data/lib/awspec/type/base.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'aws-sdk'
|
2
4
|
require 'awspec/resource_reader'
|
3
5
|
require 'awspec/helper/finder'
|
@@ -34,12 +36,13 @@ module Awspec::Type
|
|
34
36
|
tags = resource_via_client.tag_set
|
35
37
|
end
|
36
38
|
return false unless tags
|
39
|
+
|
37
40
|
tags.any? { |t| t['key'] == key && t['value'] == value }
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
41
44
|
def method_missing(name)
|
42
|
-
name_str = name.to_s if name.
|
45
|
+
name_str = name.to_s if name.instance_of?(Symbol)
|
43
46
|
describe = name_str.tr('-', '_').to_sym
|
44
47
|
|
45
48
|
if !resource_via_client.nil? && resource_via_client.members.include?(describe)
|
@@ -47,12 +50,12 @@ module Awspec::Type
|
|
47
50
|
elsif resource_via_client.nil?
|
48
51
|
raise Awspec::NoExistingResource.new(self.class, @display_name)
|
49
52
|
else
|
50
|
-
super unless
|
53
|
+
super unless respond_to?(:resource)
|
51
54
|
method_missing_via_black_list(name, delegate_to: resource)
|
52
55
|
end
|
53
56
|
end
|
54
57
|
|
55
|
-
undef :timeout
|
58
|
+
undef :timeout if Gem::Version.create(RUBY_VERSION) < Gem::Version.create('3.1.0')
|
56
59
|
|
57
60
|
private
|
58
61
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class BatchComputeEnvironment < ResourceBase
|
3
5
|
def initialize(compenv)
|
@@ -13,18 +15,18 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.compute_environment_name if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ENABLED DISABLED]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.state == state
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
TYPES = %w
|
26
|
+
TYPES = %w[MANAGED UNMANAGED]
|
25
27
|
|
26
28
|
TYPES.each do |type|
|
27
|
-
define_method type.downcase
|
29
|
+
define_method "#{type.downcase}?" do
|
28
30
|
resource_via_client.type == type
|
29
31
|
end
|
30
32
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class BatchJobQueue < ResourceBase
|
3
5
|
def initialize(jobqueue)
|
@@ -13,10 +15,10 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.job_queue_name if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ENABLED DISABLED]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.state == state
|
21
23
|
end
|
22
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class CloudfrontDistribution < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -8,12 +10,12 @@ module Awspec::Type
|
|
8
10
|
@id ||= resource_via_client.id if resource_via_client
|
9
11
|
end
|
10
12
|
|
11
|
-
STATUSES = %w
|
13
|
+
STATUSES = %w[
|
12
14
|
InProgress Deployed
|
13
|
-
|
15
|
+
]
|
14
16
|
|
15
17
|
STATUSES.each do |status|
|
16
|
-
define_method status.underscore
|
18
|
+
define_method "#{status.underscore}?" do
|
17
19
|
resource_via_client.status == status
|
18
20
|
end
|
19
21
|
end
|
@@ -23,12 +25,14 @@ module Awspec::Type
|
|
23
25
|
origin_path: nil,
|
24
26
|
origin_access_identity: nil)
|
25
27
|
return false unless [origin_id, domain_name].any?
|
28
|
+
|
26
29
|
resource_via_client.origins.items.find do |origin|
|
27
30
|
next false if !origin_id.nil? && origin.id != origin_id
|
28
31
|
next false if !domain_name.nil? && origin.domain_name != domain_name
|
29
32
|
next false if !origin_path.nil? && origin.origin_path != origin_path
|
30
33
|
next false if !origin_access_identity.nil? && \
|
31
34
|
origin.s3_origin_config.origin_access_identity != origin_access_identity
|
35
|
+
|
32
36
|
true
|
33
37
|
end
|
34
38
|
end
|
@@ -38,8 +42,8 @@ module Awspec::Type
|
|
38
42
|
end
|
39
43
|
|
40
44
|
def has_origin_domain_name_and_path?(domain_name_and_path)
|
41
|
-
domain_name = domain_name_and_path.gsub(%r
|
42
|
-
origin_path = domain_name_and_path.gsub(%r
|
45
|
+
domain_name = domain_name_and_path.gsub(%r{/.*\z}, '')
|
46
|
+
origin_path = domain_name_and_path.gsub(%r{\A[^/]*}, '')
|
43
47
|
has_origin?(nil, domain_name: domain_name, origin_path: origin_path)
|
44
48
|
end
|
45
49
|
|
@@ -48,11 +52,13 @@ module Awspec::Type
|
|
48
52
|
response_code: nil,
|
49
53
|
error_caching_min_ttl: nil)
|
50
54
|
return false unless [error_code, domain_name].any?
|
55
|
+
|
51
56
|
resource_via_client.custom_error_responses.items.find do |error|
|
52
57
|
next false if !error_code.nil? && error.error_code != error_code
|
53
58
|
next false if !response_page_path.nil? && error.response_page_path != response_page_path
|
54
59
|
next false if !response_code.nil? && error.response_code != response_code.to_s
|
55
60
|
next false if !error_caching_min_ttl.nil? && error.error_caching_min_ttl != error_caching_min_ttl
|
61
|
+
|
56
62
|
true
|
57
63
|
end
|
58
64
|
end
|