Module: Awspec::Helper::Finder

Includes:
AccountAttributes, Acm, Alb, Ami, Apigateway, Autoscaling, Batch, Cloudformation, Cloudfront, Cloudtrail, Cloudwatch, CloudwatchEvent, CloudwatchLogs, Codebuild, Codedeploy, CognitoIdentityPool, CognitoUserPool, Directconnect, Dynamodb, Ebs, Ec2, Ecr, Ecs, Efs, Eip, Eks, Elasticache, Elasticsearch, Elastictranscoder, Elb, Emr, Firehose, Iam, Kinesis, Kms, Lambda, Mq, Msk, Nlb, Rds, Redshift, Route53, S3, SNSTopic, Secretsmanager, SecurityGroup, Ses, Sqs, SsmParameter, Subnet, Transfer, Vpc, VpcEndpoints, Waf, WafRegional
Included in:
Generator::Spec::Acm, Generator::Spec::Alb, Generator::Spec::AlbListener, Generator::Spec::AutoscalingGroup, Generator::Spec::CloudwatchAlarm, Generator::Spec::CloudwatchEvent, Generator::Spec::CloudwatchLogs, Generator::Spec::Codebuild, Generator::Spec::Directconnect, Generator::Spec::Ebs, Generator::Spec::Ec2, Generator::Spec::Efs, Generator::Spec::Eip, Generator::Spec::Elasticache, Generator::Spec::Elasticsearch, Generator::Spec::Elb, Generator::Spec::IamGroup, Generator::Spec::IamPolicy, Generator::Spec::IamRole, Generator::Spec::IamUser, Generator::Spec::InternetGateway, Generator::Spec::Kms, Generator::Spec::Lambda, Generator::Spec::NatGateway, Generator::Spec::NetworkAcl, Generator::Spec::NetworkInterface, Generator::Spec::Nlb, Generator::Spec::NlbListener, Generator::Spec::Rds, Generator::Spec::RdsDbCluster, Generator::Spec::RdsDbClusterParameterGroup, Generator::Spec::RdsDbParameterGroup, Generator::Spec::RdsGlobalCluster, Generator::Spec::RdsProxy, Generator::Spec::Redshift, Generator::Spec::RedshiftClusterParameterGroup, Generator::Spec::Route53HostedZone, Generator::Spec::RouteTable, Generator::Spec::S3Bucket, Generator::Spec::SecurityGroup, Generator::Spec::Subnet, Generator::Spec::Vpc, Type::Base
Defined in:
lib/awspec/helper/finder.rb,
lib/awspec/helper/finder/mq.rb,
lib/awspec/helper/finder/s3.rb,
lib/awspec/helper/finder/acm.rb,
lib/awspec/helper/finder/alb.rb,
lib/awspec/helper/finder/ami.rb,
lib/awspec/helper/finder/ebs.rb,
lib/awspec/helper/finder/ec2.rb,
lib/awspec/helper/finder/ecr.rb,
lib/awspec/helper/finder/ecs.rb,
lib/awspec/helper/finder/efs.rb,
lib/awspec/helper/finder/eip.rb,
lib/awspec/helper/finder/eks.rb,
lib/awspec/helper/finder/elb.rb,
lib/awspec/helper/finder/emr.rb,
lib/awspec/helper/finder/iam.rb,
lib/awspec/helper/finder/kms.rb,
lib/awspec/helper/finder/msk.rb,
lib/awspec/helper/finder/nlb.rb,
lib/awspec/helper/finder/rds.rb,
lib/awspec/helper/finder/ses.rb,
lib/awspec/helper/finder/sqs.rb,
lib/awspec/helper/finder/vpc.rb,
lib/awspec/helper/finder/waf.rb,
lib/awspec/helper/finder/batch.rb,
lib/awspec/helper/finder/lambda.rb,
lib/awspec/helper/finder/subnet.rb,
lib/awspec/helper/finder/kinesis.rb,
lib/awspec/helper/finder/route53.rb,
lib/awspec/helper/finder/dynamodb.rb,
lib/awspec/helper/finder/firehose.rb,
lib/awspec/helper/finder/redshift.rb,
lib/awspec/helper/finder/transfer.rb,
lib/awspec/helper/finder/codebuild.rb,
lib/awspec/helper/finder/sns_topic.rb,
lib/awspec/helper/finder/apigateway.rb,
lib/awspec/helper/finder/cloudfront.rb,
lib/awspec/helper/finder/cloudtrail.rb,
lib/awspec/helper/finder/cloudwatch.rb,
lib/awspec/helper/finder/codedeploy.rb,
lib/awspec/helper/finder/autoscaling.rb,
lib/awspec/helper/finder/elasticache.rb,
lib/awspec/helper/finder/wafregional.rb,
lib/awspec/helper/finder/directconnect.rb,
lib/awspec/helper/finder/elasticsearch.rb,
lib/awspec/helper/finder/ssm_parameter.rb,
lib/awspec/helper/finder/vpc_endpoints.rb,
lib/awspec/helper/finder/cloudformation.rb,
lib/awspec/helper/finder/secretsmanager.rb,
lib/awspec/helper/finder/security_group.rb,
lib/awspec/helper/finder/cloudwatch_logs.rb,
lib/awspec/helper/finder/cloudwatch_event.rb,
lib/awspec/helper/finder/cognito_user_pool.rb,
lib/awspec/helper/finder/elastictranscoder.rb,
lib/awspec/helper/finder/account_attributes.rb,
lib/awspec/helper/finder/cognito_identity_pool.rb

Defined Under Namespace

Modules: AccountAttributes, Acm, Alb, Ami, Apigateway, Autoscaling, Batch, Cloudformation, Cloudfront, Cloudtrail, Cloudwatch, CloudwatchEvent, CloudwatchLogs, Codebuild, Codedeploy, CognitoIdentityPool, CognitoUserPool, Directconnect, Dynamodb, Ebs, Ec2, Ecr, Ecs, Efs, Eip, Eks, Elasticache, Elasticsearch, Elastictranscoder, Elb, Emr, Firehose, Iam, Kinesis, Kms, Lambda, Mq, Msk, Nlb, Rds, Redshift, Route53, S3, SNSTopic, Secretsmanager, SecurityGroup, Ses, Sqs, SsmParameter, Subnet, Transfer, Vpc, VpcEndpoints, Waf, WafRegional

Constant Summary collapse

CLIENTS =
{
  ec2_client: Aws::EC2::Client,
  ecr_client: Aws::ECR::Client,
  ecs_client: Aws::ECS::Client,
  efs_client: Aws::EFS::Client,
  firehose_client: Aws::Firehose::Client,
  rds_client: Aws::RDS::Client,
  route53_client: Aws::Route53::Client,
  s3_client: Aws::S3::Client,
  autoscaling_client: Aws::AutoScaling::Client,
  elb_client: Aws::ElasticLoadBalancing::Client,
  elbv2_client: Aws::ElasticLoadBalancingV2::Client,
  lambda_client: Aws::Lambda::Client,
  iam_client: Aws::IAM::Client,
  kms_client: Aws::KMS::Client,
  elasticache_client: Aws::ElastiCache::Client,
  cloudwatch_client: Aws::CloudWatch::Client,
  cloudwatch_event_client: Aws::CloudWatchEvents::Client,
  ses_client: Aws::SES::Client,
  directconnect_client: Aws::DirectConnect::Client,
  cloudfront_client: Aws::CloudFront::Client,
  elastictranscoder_client: Aws::ElasticTranscoder::Client,
  elasticsearch_client: Aws::ElasticsearchService::Client,
  cloudtrail_client: Aws::CloudTrail::Client,
  waf_client: Aws::WAF::Client,
  wafregional_client: Aws::WAFRegional::Client,
  sts_client: Aws::STS::Client,
  acm_client: Aws::ACM::Client,
  cloudwatch_logs_client: Aws::CloudWatchLogs::Client,
  dynamodb_client: Aws::DynamoDB::Client,
  sqs_client: Aws::SQS::Client,
  ssm_client: Aws::SSM::Client,
  cloudformation_client: Aws::CloudFormation::Client,
  codebuild_client: Aws::CodeBuild::Client,
  apigateway_client: Aws::APIGateway::Client,
  kinesis_client: Aws::Kinesis::Client,
  batch_client: Aws::Batch::Client,
  eks_client: Aws::EKS::Client,
  sns_client: Aws::SNS::Client,
  emr_client: Aws::EMR::Client,
  redshift_client: Aws::Redshift::Client,
  codedeploy_client: Aws::CodeDeploy::Client,
  mq_client: Aws::MQ::Client,
  secretsmanager_client: Aws::SecretsManager::Client,
  msk_client: Aws::Kafka::Client,
  cognito_identity_client: Aws::CognitoIdentity::Client,
  cognito_identity_provider_client: Aws::CognitoIdentityProvider::Client,
  transfer_client: Aws::Transfer::Client
}
CLIENT_OPTIONS =
{
  http_proxy: ENV['http_proxy'] || ENV['https_proxy'] || nil,
  http_wire_trace: ENV['http_wire_trace'] || false
}

Instance Method Summary collapse

Methods included from Transfer

#find_transfer_server

Methods included from CognitoIdentityPool

#find_identitypool_by_name

Methods included from Msk

#find_msk_cluster_by_name

Methods included from CognitoUserPool

#find_userpool_by_name

Methods included from Secretsmanager

#find_secret

Methods included from Mq

#find_broker

Methods included from Codedeploy

#find_codedeploy_app, #find_codedeploy_deployment_group

Methods included from Redshift

#find_redshift_cluster_identifier, #select_all_redshift_cluster_parameters, #select_redshift_by_vpc_id

Methods included from Emr

#find_emr_cluster

Methods included from SNSTopic

#find_sns_topic, #find_sns_topic_subs

Methods included from Eks

#find_eks_cluster, #find_eks_nodegroup

Methods included from Batch

#find_batch_compute_environment, #find_batch_job_definition, #find_batch_job_queue

Methods included from Kinesis

#find_kinesis_by_stream_name

Methods included from Apigateway

#find_api_resources_by_id, #find_apigateway_by_id, #find_apigateway_by_name

Methods included from Codebuild

#find_codebuild_project, #select_all_codebuild_projects

Methods included from Cloudformation

#find_cloudformation_stack

Methods included from SsmParameter

#find_parameter_tag, #find_ssm_parameter

Methods included from Sqs

#find_queue, #find_tags_for_queue

Methods included from Dynamodb

#find_dynamodb_table

Methods included from CloudwatchLogs

#find_cloudwatch_logs_group, #find_cloudwatch_logs_metric_fileter_by_log_group_name, #find_cloudwatch_logs_stream_by_log_group_name, #find_cloudwatch_logs_subscription_fileter_by_log_group_name, #find_tags_by_log_group_name, #last_cloudwatch_logs_stream_by_log_group_name, #select_all_cloudwatch_logs_log_groups

Methods included from AccountAttributes

#find_ec2_account_attributes, #find_lambda_account_settings, #find_rds_account_attributes, #find_ses_send_quota

Methods included from Acm

#find_certificate, #select_all_certificates

Methods included from WafRegional

#find_wafregional_ip_set, #find_wafregional_rule, #find_wafregional_web_acl

Methods included from Waf

#find_waf_ip_set, #find_waf_rule, #find_waf_web_acl

Methods included from Cloudtrail

#find_trail, #get_trail_status, #get_trail_tags, #is_logging?, #select_all_trails

Methods included from Elastictranscoder

#find_pipeline

Methods included from Cloudfront

#find_cloudfront_distribution

Methods included from Ami

#find_ami

Methods included from Directconnect

#find_virtual_interface, #select_virtual_interfaces

Methods included from Ses

#find_ses_identity

Methods included from CloudwatchEvent

#find_cloudwatch_event, #select_all_cloudwatch_events

Methods included from Cloudwatch

#find_cloudwatch_alarm, #select_all_cloudwatch_alarms

Methods included from Elasticsearch

#find_elasticsearch_domain, #select_all_elasticsearch_domains

Methods included from Elasticache

#find_cache_cluster, #find_cache_subnet_group

Methods included from Kms

#find_kms_key, #find_kms_key_by_alias, #select_all_kms_aliases

Methods included from Iam

#select_all_attached_policies, #select_all_iam_groups, #select_all_iam_roles, #select_all_iam_users, #select_attached_entities, #select_attached_groups, #select_attached_roles, #select_attached_users, #select_iam_group_by_user_name, #select_policy_evaluation_results

Methods included from Lambda

#find_lambda, #select_all_lambda_functions, #select_event_source_by_function_arn

Methods included from Elb

#find_elb, #find_elb_attribute, #select_all_elb_tags, #select_elb_by_vpc_id

Methods included from Ebs

#find_ebs, #select_all_attached_ebs, #select_ebs_by_instance_id

Methods included from Autoscaling

#find_autoscaling_group, #find_block_device_mapping, #find_launch_configuration, #select_alb_target_group_by_autoscaling_group_name, #select_autoscaling_group_by_vpc_id, #select_lb_target_group_by_autoscaling_group_name

Methods included from S3

#find_bucket, #find_bucket_acl, #find_bucket_cors, #find_bucket_lifecycle_configuration, #find_bucket_location, #find_bucket_logging, #find_bucket_policy, #find_bucket_server_side_encryption, #find_bucket_tag, #find_bucket_versioning, #head_object, #select_all_buckets

Methods included from Route53

#find_hosted_zone, #select_record_sets_by_hosted_zone_id

Methods included from Rds

#find_db_cluster, #find_db_subnet_group, #find_global_cluster, #find_rds, #find_rds_proxy, #select_all_rds_db_cluster_parameters, #select_all_rds_db_parameters, #select_rds_by_vpc_id, #select_rds_proxy_by_vpc_id

Methods included from SecurityGroup

#describe_security_groups, #find_security_group, #select_security_group_by_group_id, #select_security_group_by_group_name, #select_security_group_by_tag_name, #select_security_group_by_vpc_id

Methods included from Firehose

#find_delivery_stream

Methods included from Eip

#select_eip, #select_eip_by_instance_id

Methods included from Efs

#find_efs, #find_efs_tags, #get_id_by_name_tag, #get_name_by_id, #select_all_file_systems

Methods included from Ecs

#find_ecs_cluster, #find_ecs_container_instance, #find_ecs_container_instances, #find_ecs_service, #find_ecs_task_definition, #select_ecs_container_instance_arn_by_cluster_name

Methods included from Ecr

#find_ecr_repository, #get_policy_text

Methods included from Ec2

#dup_ec2_instance, #find_ec2, #find_ec2_attribute, #find_ec2_credit_specifications, #find_ec2_status, #find_launch_template, #find_launch_template_versions, #find_nat_gateway, #find_network_interface, #find_tgw_attachments_by_tgw_id, #find_vpn_connection, #select_ec2_by_vpc_id, #select_internet_gateway_by_vpc_id, #select_nat_gateway_by_vpc_id, #select_network_interface_by_instance_id, #select_network_interface_by_vpc_id

Methods included from Subnet

#find_subnet

Methods included from VpcEndpoints

#find_vpc_endpoint

Methods included from Vpc

#find_network_acl, #find_route_table, #find_vpc, #find_vpc_attribute, #find_vpc_peering_connection, #select_network_acl_by_vpc_id, #select_route_table_by_vpc_id, #select_vpc_attribute, #select_vpc_peering_connection_by_vpc_id

Methods included from Alb

#find_alb, #find_alb_listener, #find_alb_target_group, #select_alb_by_vpc_id, #select_alb_listener_by_alb_arn, #select_all_alb_tags, #select_rule_by_alb_listener_id

Methods included from Nlb

#find_nlb, #find_nlb_listener, #find_nlb_target_group, #select_nlb_by_vpc_id, #select_nlb_listener_by_nlb_arn, #select_rule_by_nlb_listener_id

Instance Method Details

#select_subnet_by_vpc_id(vpc_id) ⇒ Object

Search for the subnets associated with a given VPC ID.

Returns an array of Aws::EC2::Types::Subnet instances.



128
129
130
131
132
133
# File 'lib/awspec/helper/finder/subnet.rb', line 128

def select_subnet_by_vpc_id(vpc_id)
  res = ec2_client.describe_subnets({
                                      filters: [{ name: 'vpc-id', values: [vpc_id] }]
                                    })
  res.subnets
end