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::Type
|
2
4
|
class CodedeployDeploymentGroup < ResourceBase
|
3
5
|
attr_accessor :application_name
|
@@ -25,8 +27,10 @@ module Awspec::Type
|
|
25
27
|
asg.name == asg_name
|
26
28
|
end
|
27
29
|
return true if res
|
30
|
+
|
28
31
|
asg2 = find_autoscaling_group(asg_name)
|
29
32
|
return true if asgs.include? asg2.auto_scaling_group_name
|
33
|
+
|
30
34
|
false
|
31
35
|
end
|
32
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class CustomerGateway < ResourceBase
|
3
5
|
tags_allowed
|
@@ -15,12 +17,12 @@ module Awspec::Type
|
|
15
17
|
@id ||= resource_via_client.customer_gateway_id if resource_via_client
|
16
18
|
end
|
17
19
|
|
18
|
-
STATES = %w
|
20
|
+
STATES = %w[
|
19
21
|
pending available deleting deleted
|
20
|
-
|
22
|
+
]
|
21
23
|
|
22
24
|
STATES.each do |state|
|
23
|
-
define_method state.tr('-', '_')
|
25
|
+
define_method "#{state.tr('-', '_')}?" do
|
24
26
|
resource_via_client.state == state
|
25
27
|
end
|
26
28
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class DirectconnectVirtualInterface < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -13,13 +15,13 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.virtual_interface_id if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[
|
17
19
|
confirming verifying pending available
|
18
20
|
deleting deleted rejected
|
19
|
-
|
21
|
+
]
|
20
22
|
|
21
23
|
STATES.each do |state|
|
22
|
-
define_method state
|
24
|
+
define_method "#{state}?" do
|
23
25
|
resource_via_client.virtual_interface_state == state
|
24
26
|
end
|
25
27
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class DynamodbTable < ResourceBase
|
3
5
|
aws_resource Aws::DynamoDB::Table
|
@@ -10,15 +12,15 @@ module Awspec::Type
|
|
10
12
|
@id ||= resource_via_client.table_name if resource_via_client
|
11
13
|
end
|
12
14
|
|
13
|
-
STATUSES = %w
|
15
|
+
STATUSES = %w[
|
14
16
|
CREATING
|
15
17
|
UPDATING
|
16
18
|
DELETING
|
17
19
|
ACTIVE
|
18
|
-
|
20
|
+
]
|
19
21
|
|
20
22
|
STATUSES.each do |status|
|
21
|
-
define_method status.downcase
|
23
|
+
define_method "#{status.downcase}?" do
|
22
24
|
resource_via_client.table_status == status
|
23
25
|
end
|
24
26
|
end
|
data/lib/awspec/type/ebs.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Ebs < ResourceBase
|
3
5
|
aws_resource Aws::EC2::Volume
|
@@ -16,12 +18,12 @@ module Awspec::Type
|
|
16
18
|
@id ||= resource_via_client.volume_id if resource_via_client
|
17
19
|
end
|
18
20
|
|
19
|
-
STATES = %w
|
21
|
+
STATES = %w[
|
20
22
|
creating available in-use deleting deleted error
|
21
|
-
|
23
|
+
]
|
22
24
|
|
23
25
|
STATES.each do |state|
|
24
|
-
define_method state.tr('-', '_')
|
26
|
+
define_method "#{state.tr('-', '_')}?" do
|
25
27
|
resource_via_client.state == state
|
26
28
|
end
|
27
29
|
end
|
@@ -30,6 +32,7 @@ module Awspec::Type
|
|
30
32
|
instance = find_ec2(instance_id)
|
31
33
|
return false unless instance
|
32
34
|
return false unless resource_via_client.attachments
|
35
|
+
|
33
36
|
resource_via_client.attachments.first.instance_id == instance.instance_id && \
|
34
37
|
resource_via_client.attachments.first.state == 'attached'
|
35
38
|
end
|
data/lib/awspec/type/ec2.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'awspec/helper/states'
|
2
4
|
|
3
5
|
module Awspec::Type
|
@@ -50,6 +52,7 @@ module Awspec::Type
|
|
50
52
|
|
51
53
|
def has_security_groups?(sg_ids)
|
52
54
|
return true if match_group_ids?(sg_ids) || match_group_names?(sg_ids)
|
55
|
+
|
53
56
|
group_ids = resource_security_groups.map { |sg| sg.group_id }
|
54
57
|
tags = select_security_group_by_group_id(group_ids).map { |sg| sg.tags }.flatten
|
55
58
|
group_names = tags.select { |tag| tag.key == 'Name' }.map { |tag| tag.value }
|
@@ -63,8 +66,10 @@ module Awspec::Type
|
|
63
66
|
sg.group_id == sg_id || sg.group_name == sg_id
|
64
67
|
end
|
65
68
|
return true if ret
|
69
|
+
|
66
70
|
sg2 = find_security_group(sg_id)
|
67
71
|
return false unless sg2.tag_name == sg_id
|
72
|
+
|
68
73
|
sgs.find do |sg|
|
69
74
|
sg.group_id == sg2.group_id
|
70
75
|
end
|
@@ -82,9 +87,11 @@ module Awspec::Type
|
|
82
87
|
blocks = resource_via_client.block_device_mappings
|
83
88
|
ret = blocks.find do |block|
|
84
89
|
next false unless block.ebs
|
90
|
+
|
85
91
|
block.ebs.volume_id == volume_id
|
86
92
|
end
|
87
93
|
return true if ret
|
94
|
+
|
88
95
|
blocks2 = find_ebs(volume_id)
|
89
96
|
blocks2.attachments.find do |attachment|
|
90
97
|
attachment.instance_id == id
|
@@ -97,6 +104,7 @@ module Awspec::Type
|
|
97
104
|
interfaces = resource_via_client.network_interfaces
|
98
105
|
ret = interfaces.find do |interface|
|
99
106
|
next false if device_index && interface.attachment.device_index != device_index
|
107
|
+
|
100
108
|
interface.network_interface_id == res.network_interface_id
|
101
109
|
end
|
102
110
|
end
|
@@ -111,6 +119,7 @@ module Awspec::Type
|
|
111
119
|
def has_events?
|
112
120
|
status = find_ec2_status(id)
|
113
121
|
return false if status.nil?
|
122
|
+
|
114
123
|
status.events.count > 0
|
115
124
|
end
|
116
125
|
|
@@ -129,6 +138,7 @@ module Awspec::Type
|
|
129
138
|
}
|
130
139
|
classic_link_instances = ec2_client.describe_classic_link_instances(option)
|
131
140
|
return false if classic_link_instances.instances.count == 0
|
141
|
+
|
132
142
|
instances = classic_link_instances[0]
|
133
143
|
sgs = instances[0].groups
|
134
144
|
ret = sgs.find do |sg|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class EcsCluster < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -13,10 +15,10 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.cluster_name if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ACTIVE INACTIVE]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.status == state
|
21
23
|
end
|
22
24
|
end
|
@@ -38,6 +40,7 @@ module Awspec::Type
|
|
38
40
|
puts ''
|
39
41
|
warn Color.on_red(Color.white("!!! `#{__method__}` is deprecated. awspec don't provide complex result !!!"))
|
40
42
|
return @container_instances if @container_instances
|
43
|
+
|
41
44
|
arns = container_instance_arns
|
42
45
|
@container_instances ||=
|
43
46
|
arns.empty? ? [] : find_ecs_container_instances(id, arns).map! { |ci| EcsContainerInstance.new(id, ci) }
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class EcsContainerInstance < ResourceBase
|
3
5
|
attr_accessor :cluster
|
@@ -19,10 +21,10 @@ module Awspec::Type
|
|
19
21
|
@cluster || 'default'
|
20
22
|
end
|
21
23
|
|
22
|
-
STATES = %w
|
24
|
+
STATES = %w[ACTIVE INACTIVE]
|
23
25
|
|
24
26
|
STATES.each do |state|
|
25
|
-
define_method state.downcase
|
27
|
+
define_method "#{state.downcase}?" do
|
26
28
|
resource_via_client.status == state
|
27
29
|
end
|
28
30
|
end
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class EcsService < ResourceBase
|
3
5
|
attr_accessor :cluster
|
6
|
+
|
4
7
|
def initialize(service)
|
5
8
|
super
|
6
9
|
@display_name = service
|
@@ -18,10 +21,10 @@ module Awspec::Type
|
|
18
21
|
@cluster || 'default'
|
19
22
|
end
|
20
23
|
|
21
|
-
STATES = %w
|
24
|
+
STATES = %w[ACTIVE DRAINING INACTIVE]
|
22
25
|
|
23
26
|
STATES.each do |state|
|
24
|
-
define_method state.downcase
|
27
|
+
define_method "#{state.downcase}?" do
|
25
28
|
resource_via_client.status == state
|
26
29
|
end
|
27
30
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class EcsTaskDefinition < ResourceBase
|
3
5
|
def initialize(taskdef)
|
@@ -13,10 +15,10 @@ module Awspec::Type
|
|
13
15
|
@id ||= "#{resource_via_client.family}:#{resource_via_client.revision}" if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ACTIVE INACTIVE]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.status == state
|
21
23
|
end
|
22
24
|
end
|
data/lib/awspec/type/efs.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Efs < ResourceBase
|
3
5
|
def initialize(file_system_id)
|
@@ -16,6 +18,7 @@ module Awspec::Type
|
|
16
18
|
def has_tag?(tag_key, tag_value)
|
17
19
|
tag = find_efs_tags(@display_name, tag_key)
|
18
20
|
return nil if tag.value != tag_value
|
21
|
+
|
19
22
|
tag
|
20
23
|
end
|
21
24
|
end
|
data/lib/awspec/type/eip.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Eip < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -10,6 +12,7 @@ module Awspec::Type
|
|
10
12
|
|
11
13
|
def associated_to?(instance_id)
|
12
14
|
return false unless resource_via_client.last.instance_id == instance_id
|
15
|
+
|
13
16
|
resource_via_client.last.instance_id == instance_id
|
14
17
|
end
|
15
18
|
end
|
data/lib/awspec/type/eks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Eks < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -13,10 +15,10 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.name if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ACTIVE CREATING]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.status == state
|
21
23
|
end
|
22
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'set'
|
2
4
|
|
3
5
|
module Awspec::Type
|
@@ -89,10 +91,10 @@ module Awspec::Type
|
|
89
91
|
running_counter >= min_expected
|
90
92
|
end
|
91
93
|
|
92
|
-
STATES = %w
|
94
|
+
STATES = %w[ACTIVE INACTIVE]
|
93
95
|
|
94
96
|
STATES.each do |state|
|
95
|
-
define_method state.downcase
|
97
|
+
define_method "#{state.downcase}?" do
|
96
98
|
resource_via_client.status == state
|
97
99
|
end
|
98
100
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Elasticache < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -13,15 +15,15 @@ module Awspec::Type
|
|
13
15
|
@id ||= resource_via_client.cache_cluster_id if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[
|
17
19
|
available creating deleted deleting
|
18
20
|
incompatible-network modifying
|
19
21
|
rebooting-cache-cluster-nodes restore-failed
|
20
22
|
snapshotting
|
21
|
-
|
23
|
+
]
|
22
24
|
|
23
25
|
STATES.each do |state|
|
24
|
-
define_method state.tr('-', '_')
|
26
|
+
define_method "#{state.tr('-', '_')}?" do
|
25
27
|
resource_via_client.cache_cluster_status == state
|
26
28
|
end
|
27
29
|
end
|
@@ -51,6 +53,7 @@ module Awspec::Type
|
|
51
53
|
res = select_security_group_by_group_name([sg_id])
|
52
54
|
|
53
55
|
return false unless res.count == 1
|
56
|
+
|
54
57
|
has_vpc_security_group_id?(res.first.group_id)
|
55
58
|
end
|
56
59
|
|
@@ -58,6 +61,7 @@ module Awspec::Type
|
|
58
61
|
res = select_security_group_by_tag_name([sg_id])
|
59
62
|
|
60
63
|
return false unless res.count == 1
|
64
|
+
|
61
65
|
has_vpc_security_group_id?(res.first.group_id)
|
62
66
|
end
|
63
67
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class ElasticacheCacheParameterGroup < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -18,6 +20,7 @@ module Awspec::Type
|
|
18
20
|
parameters[param.parameter_name] = param.parameter_value
|
19
21
|
end
|
20
22
|
break if res.marker.nil?
|
23
|
+
|
21
24
|
res = elasticache_client.describe_cache_parameters({
|
22
25
|
cache_parameter_group_name: @display_name,
|
23
26
|
marker: res.marker
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class ElastictranscoderPipeline < 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
|
Active Paused
|
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
|
data/lib/awspec/type/elb.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Elb < ResourceBase
|
3
5
|
def resource_via_client
|
@@ -8,13 +10,13 @@ module Awspec::Type
|
|
8
10
|
@id ||= resource_via_client.load_balancer_name if resource_via_client
|
9
11
|
end
|
10
12
|
|
11
|
-
health_check_options = %w
|
13
|
+
health_check_options = %w[
|
12
14
|
target interval timeout
|
13
15
|
unhealthy_threshold healthy_threshold
|
14
|
-
|
16
|
+
]
|
15
17
|
|
16
18
|
health_check_options.each do |option|
|
17
|
-
define_method
|
19
|
+
define_method "health_check_#{option}" do
|
18
20
|
resource_via_client.health_check[option]
|
19
21
|
end
|
20
22
|
end
|
@@ -22,6 +24,7 @@ module Awspec::Type
|
|
22
24
|
def has_ec2?(id)
|
23
25
|
ec2 = find_ec2(id)
|
24
26
|
return nil unless ec2
|
27
|
+
|
25
28
|
resource_via_client.instances.find do |instance|
|
26
29
|
instance.instance_id == ec2.instance_id
|
27
30
|
end
|
@@ -33,8 +36,10 @@ module Awspec::Type
|
|
33
36
|
sg == sg_id
|
34
37
|
end
|
35
38
|
return true if ret
|
39
|
+
|
36
40
|
sg2 = find_security_group(sg_id)
|
37
41
|
return true if sgs.include? sg2.group_id
|
42
|
+
|
38
43
|
false
|
39
44
|
end
|
40
45
|
|
@@ -44,6 +49,7 @@ module Awspec::Type
|
|
44
49
|
s == subnet_id
|
45
50
|
end
|
46
51
|
return true if ret
|
52
|
+
|
47
53
|
res = find_subnet(subnet_id)
|
48
54
|
ret = subnets.find do |s|
|
49
55
|
s == res.subnet_id
|
@@ -76,6 +82,7 @@ module Awspec::Type
|
|
76
82
|
|
77
83
|
def has_access_log?(s3_bucket_name:, s3_bucket_prefix:, emit_interval:)
|
78
84
|
return false unless load_balancer_attributes.access_log.enabled
|
85
|
+
|
79
86
|
access_log = load_balancer_attributes.access_log
|
80
87
|
access_log.emit_interval == emit_interval && \
|
81
88
|
access_log.s3_bucket_name == s3_bucket_name && access_log.s3_bucket_prefix == s3_bucket_prefix
|
@@ -83,6 +90,7 @@ module Awspec::Type
|
|
83
90
|
|
84
91
|
def has_connection_draining?(timeout:)
|
85
92
|
return false unless load_balancer_attributes.connection_draining.enabled
|
93
|
+
|
86
94
|
connection_draining = load_balancer_attributes.connection_draining
|
87
95
|
connection_draining.timeout == timeout
|
88
96
|
end
|
data/lib/awspec/type/emr.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Emr < ResourceBase
|
3
5
|
attr_reader :id
|
@@ -11,12 +13,12 @@ module Awspec::Type
|
|
11
13
|
@resource_via_client ||= find_emr_cluster(@id)
|
12
14
|
end
|
13
15
|
|
14
|
-
STARTING_STATES = %w
|
15
|
-
READY_STATES = %w
|
16
|
+
STARTING_STATES = %w[STARTING BOOTSTRAPPING]
|
17
|
+
READY_STATES = %w[RUNNING WAITING]
|
16
18
|
STATES = (READY_STATES + STARTING_STATES)
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.status.state == state
|
21
23
|
end
|
22
24
|
end
|
@@ -33,8 +35,8 @@ module Awspec::Type
|
|
33
35
|
READY_STATES.include?(resource_via_client.status.state)
|
34
36
|
end
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
alias healthy? ok?
|
39
|
+
alias ready? ok?
|
40
|
+
alias bootstrapping? starting?
|
39
41
|
end
|
40
42
|
end
|
data/lib/awspec/type/firehose.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class Firehose < ResourceBase
|
3
5
|
def initialize(name)
|
@@ -13,10 +15,10 @@ module Awspec::Type
|
|
13
15
|
@id ||= @delivery_stream_name if resource_via_client
|
14
16
|
end
|
15
17
|
|
16
|
-
STATES = %w
|
18
|
+
STATES = %w[ACTIVE CREATING DELETING]
|
17
19
|
|
18
20
|
STATES.each do |state|
|
19
|
-
define_method state.downcase
|
21
|
+
define_method "#{state.downcase}?" do
|
20
22
|
resource_via_client.delivery_stream_status == 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 IamGroup < ResourceBase
|
3
5
|
aws_resource Aws::IAM::Group
|
@@ -13,6 +15,7 @@ module Awspec::Type
|
|
13
15
|
def has_iam_user?(user_id)
|
14
16
|
user = find_iam_user(user_id)
|
15
17
|
return false unless user
|
18
|
+
|
16
19
|
user_name = user.user_name
|
17
20
|
groups = select_iam_group_by_user_name(user_name)
|
18
21
|
groups.find do |group|
|
@@ -35,6 +38,7 @@ module Awspec::Type
|
|
35
38
|
policy_name: policy_name
|
36
39
|
})
|
37
40
|
return JSON.parse(URI.decode_www_form_component(res.policy_document)) == JSON.parse(document) if document
|
41
|
+
|
38
42
|
res
|
39
43
|
end
|
40
44
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'awspec/error'
|
2
4
|
|
3
5
|
module Awspec::Type
|
@@ -21,6 +23,7 @@ module Awspec::Type
|
|
21
23
|
if user_id
|
22
24
|
user = find_iam_user(user_id)
|
23
25
|
return false unless user
|
26
|
+
|
24
27
|
users.any? do |u|
|
25
28
|
u.user_name == user.user_name
|
26
29
|
end
|
@@ -35,6 +38,7 @@ module Awspec::Type
|
|
35
38
|
if group_id
|
36
39
|
group = find_iam_group(group_id)
|
37
40
|
return false unless group
|
41
|
+
|
38
42
|
groups.any? do |g|
|
39
43
|
g.group_name == group.group_name
|
40
44
|
end
|
@@ -49,6 +53,7 @@ module Awspec::Type
|
|
49
53
|
if role_id
|
50
54
|
role = find_iam_role(role_id)
|
51
55
|
return false unless role
|
56
|
+
|
52
57
|
roles.any? do |r|
|
53
58
|
r.role_name == role.role_name
|
54
59
|
end
|
data/lib/awspec/type/iam_role.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Awspec::Type
|
2
4
|
class IamRole < ResourceBase
|
3
5
|
aws_resource Aws::IAM::Role
|
@@ -25,6 +27,7 @@ module Awspec::Type
|
|
25
27
|
policy_name: policy_name
|
26
28
|
})
|
27
29
|
return JSON.parse(URI.decode_www_form_component(res.policy_document)) == JSON.parse(document) if document
|
30
|
+
|
28
31
|
res
|
29
32
|
end
|
30
33
|
|