1{ 2"cloudformation-stack":{ 3"desc":"A stack is a collection of AWS resources that you can manage as a single unit.", 4"ngram":"cfn cft" 5}, 6"codebuild-job-run":{ 7"desc":"Codebuild job run, it is not a batch job run.", 8"ngram":"jobrun" 9}, 10"codebuild-project":{ 11"desc":"A build project includes information about how to run a build.", 12"ngram":"" 13}, 14"codecommit-repository":{ 15"desc":"A repository is where you store code and files for your project.", 16"ngram":"" 17}, 18"codepipeline-pipeline":{ 19"desc":"Code pipeline is a workflow construct that describes how software changes go through a release process.", 20"ngram":"" 21}, 22"dynamodb-table":{ 23"desc":"A table is a collection of data.", 24"ngram":"" 25}, 26"ec2-instance":{ 27"desc":"An EC2 instance is simply a virtual server in AWS", 28"ngram":"aws elastic compute cloud" 29}, 30"ec2-security-group":{ 31"desc":"A security group acts as a firewall that controls the traffic allowed to and from the resources in your VPC.", 32"ngram":"sg securitygroup" 33}, 34"ec2-subnet":{ 35"desc":"A subnet is a range of IP addresses in your VPC.", 36"ngram":"" 37}, 38"ec2-vpc":{ 39"desc":"A virtual private cloud (VPC) is a virtual network dedicated to your AWS account.", 40"ngram":"virtual private cloud" 41}, 42"ecr-repository":{ 43"desc":"AWS managed container image registry service that is secure, scalable, and reliable.", 44"ngram":"ecr private repository container" 45}, 46"ecr-repository-image":{ 47"desc":"An container image in ECR repository.", 48"ngram":"ecr private repository container" 49}, 50"ecs-cluster":{ 51"desc":"An Amazon ECS cluster is a logical grouping of tasks or services.", 52"ngram":"" 53}, 54"ecs-task-run":{ 55"desc":"A task run is the instantiation of a task definition within a cluster.", 56"ngram":"" 57}, 58"ecs_task_definition_family":{ 59"desc":"A name of the task definition, without revision id.", 60"ngram":"" 61}, 62"glue-crawler":{ 63"desc":"You can use a crawler to populate the AWS Glue Data Catalog with tables.", 64"ngram":"" 65}, 66"glue-database":{ 67"desc":"Databases are used to organize metadata tables in the AWS Glue. ", 68"ngram":"db" 69}, 70"glue-database-table":{ 71"desc":"The metadata definition that represents your data.", 72"ngram":"db tb" 73}, 74"glue-job":{ 75"desc":"The business logic that is required to perform ETL work.", 76"ngram":"" 77}, 78"glue-job-run":{ 79"desc":"A job run is the execution of an ETL job.", 80"ngram":"" 81}, 82"iam-group":{ 83"desc":"An IAM user group is a collection of IAM users.", 84"ngram":"" 85}, 86"iam-policy":{ 87"desc":"IAM policies define permissions for an action regardless of the method that you use to perform the operation.", 88"ngram":"" 89}, 90"iam-role":{ 91"desc":"An IAM role is an IAM identity that you can create in your account that has specific permissions.", 92"ngram":"" 93}, 94"iam-user":{ 95"desc":"IAM user is an entity that you create in AWS.", 96"ngram":"" 97}, 98"kms-key-alias":{ 99"desc":"A human friendly name for KMS keys.",100"ngram":"key management service"101},102"lambda-function":{103"desc":"A function is a resource that you can invoke to run your code in Lambda.",104"ngram":"lbd"105},106"lambda-function-alias":{107"desc":"A Lambda alias is a pointer to a function version that you can update.",108"ngram":"lbd"109},110"lambda-layer":{111"desc":"A Lambda layer is a .zip file archive that can contain additional code or other content.",112"ngram":""113},114"rds-db-cluster":{115"desc":"A DB cluster deployment is a semi-synchronous, high availability deployment mode of Amazon RDS with two readable standby DB instances.",116"ngram":"relational database service"117},118"rds-db-instance":{119"desc":"A DB instance is an isolated database environment running in the cloud.",120"ngram":"relational database service"121},122"s3-bucket":{123"desc":"A bucket is a container for objects.",124"ngram":"simple storage service"125},126"secretsmanager-secret":{127"desc":"A secret consists of secret information, the secret value, plus metadata about the secret.",128"ngram":"sm"129},130"sfn-state-machine":{131"desc":"A series of event-driven steps",132"ngram":"step functions stepfunctions"133},134"sfn-state-machine-execution":{135"desc":"A execution of a state machine.",136"ngram":"step functions stepfunctions"137},138"sns-topic":{139"desc":"An Amazon SNS topic is a logical access point that acts as a communication channel.",140"ngram":"simple notification service"141},142"sqs-queue":{143"desc":"A form of asynchronous service-to-service communication used in serverless and microservices architectures",144"ngram":"simple queue service"145},146"ssm-parameter":{147"desc":"Provides secure, hierarchical storage for configuration data management and secrets management. ",148"ngram":"system manager parameter store"149}150}
1# -*- coding: utf-8 -*- 2 3""" 4This module defines the search patterns for those resource types that requires 5special handling. 6""" 7 8importtypingasT 9 10from.compatimportTypedDict,cached_property 11from.searcher_enumimportSearcherEnum 12 13ifT.TYPE_CHECKING: 14from.ars_defimportARS 15 16 17classT_SEARCH_PATTERN(TypedDict): 18partitioner_resource_type:str 19get_boto_kwargs:T.Callable 20 21 22K_PARTITIONER_RESOURCE_TYPE="partitioner_resource_type" 23K_GET_BOTO_KWARGS="get_boto_kwargs" 24 25 26classArsSearchPatternsMixin: 27""" 28 todo: docstring 29 """ 30defget_search_patterns(self:"ARS"): 31""" 32 This variable defines those resource types that requires a parent resource name 33 for the boto3 API call. For example: 34 35 - in order to search glue table, you need to specify glue database 36 - in order to search glue job run, you need to specify glue job 37 """ 38return{ 39SearcherEnum.ecr_repository_image.value:{ 40K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.ecr_repository.value, 41K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 42"repositoryName":partitioner_query 43}, 44}, 45SearcherEnum.ecs_task_run.value:{ 46K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.ecs_cluster.value, 47K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 48"cluster":partitioner_query 49}, 50}, 51SearcherEnum.glue_database_table.value:{ 52K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.glue_database.value, 53K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 54"DatabaseName":partitioner_query 55}, 56}, 57SearcherEnum.glue_job_run.value:{ 58K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.glue_job.value, 59K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 60"JobName":partitioner_query 61}, 62}, 63SearcherEnum.sfn_state_machine_execution:{ 64K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.sfn_state_machine.value, 65K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 66"stateMachineArn":self.aws_console.step_function.get_state_machine_arn( 67partitioner_query 68) 69}, 70}, 71SearcherEnum.codebuild_job_run.value:{ 72K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.codebuild_project.value, 73K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 74"projectName":partitioner_query 75}, 76}, 77SearcherEnum.lambda_function_alias.value:{ 78K_PARTITIONER_RESOURCE_TYPE:SearcherEnum.lambda_function.value, 79K_GET_BOTO_KWARGS:lambdapartitioner_query:{ 80"FunctionName":partitioner_query 81}, 82}, 83} 84 85@cached_property 86defsearch_patterns(self:"ARS"): 87returnself.get_search_patterns() 88 89def_clear_search_patterns_cache(self:"ARS"): 90""" 91 Clear the :meth:`ArsSearchPatternsMixin.search_patterns` cache. 92 """ 93delself.search_patterns 94 95defhas_partitioner( 96self:"ARS", 97resource_type:str, 98)->bool: 99"""100 Check if a resource type need a partitioner resource.101 """102returnresource_typeinself.search_patterns103104defget_partitioner_resource_type(105self:"ARS",106resource_type:str,107)->str:108"""109 Get the partitioner "resource type" of a resource type.110 """111returnself.search_patterns[resource_type][K_PARTITIONER_RESOURCE_TYPE]112113defget_partitioner_boto_kwargs(114self:"ARS",115resource_type:str,116partitioner_query:str,117)->dict:118"""119 Get the boto3 kwargs for the partitioner resource.120 """121returnself.search_patterns[resource_type][K_GET_BOTO_KWARGS](partitioner_query)