Skip to content

Commit 5cf7e2e

Browse files
tas50claude
andauthored
Lazy-load DynamoDB, ECS, EKS details and parallelize S3 listing (#7114)
* ⚡ Lazy-load DynamoDB, ECS TaskDef, EKS details and parallelize S3 listing Eliminates N+1 DescribeTable/DescribeTaskDefinition/DescribeCluster calls during resource listing by making detail fields computed (lazy-loaded). Parallelizes S3 bucket listing across regions using jobpool. DynamoDB: ListTables returns only names; DescribeTable now called on-demand via fetchDetail() with double-check locking. Saves ~30s for 50 tables. ECS TaskDefinition: ListTaskDefinitions returns only ARNs; DescribeTaskDefinition now called on-demand. Saves ~60s for 100 task defs. EKS: ListClusters returns only names; DescribeCluster now called on-demand. Tag filtering still calls describe eagerly when filters are active. Saves ~20s for 20 clusters. S3: Region iteration now uses jobpool (concurrency 5) instead of sequential loop. Saves ~12s with 15 regions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🧹 Address EKS review: cache describe for tag filters, fix iamRole accessor - Cache DescribeCluster response when tag filtering is active to avoid redundant API call in fetchDetail() - Use real ARN from DescribeCluster when available (correct for all partitions) - Make iamRole() accessor explicit (return Data after fetchDetail) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8aa1d30 commit 5cf7e2e

File tree

6 files changed

+842
-339
lines changed

6 files changed

+842
-339
lines changed

providers/aws/resources/aws.lr

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,22 +2879,24 @@ private aws.ecs.container @defaults("containerName runtimeId clusterName region"
28792879
private aws.ecs.taskDefinition @defaults("arn family revision") {
28802880
// ARN of the task definition
28812881
arn string
2882+
// Region where the task definition is located
2883+
region string
28822884
// Family name of the task definition
2883-
family string
2885+
family() string
28842886
// Revision number of the task definition
2885-
revision int
2887+
revision() int
28862888
// Status of the task definition (ACTIVE, INACTIVE, DELETE_IN_PROGRESS)
2887-
status string
2889+
status() string
28882890
// Network mode for the task (bridge, host, awsvpc, none)
2889-
networkMode string
2891+
networkMode() string
28902892
// Process namespace mode for the task (host, task)
2891-
pidMode string
2893+
pidMode() string
28922894
// IPC resource namespace mode for the task (host, task, none)
2893-
ipcMode string
2895+
ipcMode() string
28942896
// ARN of the IAM role that containers in this task can assume
2895-
taskRoleArn string
2897+
taskRoleArn() string
28962898
// ARN of the IAM role that the Amazon ECS container agent can assume
2897-
executionRoleArn string
2899+
executionRoleArn() string
28982900
// List of container definitions in the task
28992901
containerDefinitions() []aws.ecs.taskDefinition.containerDefinition
29002902
// List of volumes configured for the task
@@ -2903,14 +2905,12 @@ private aws.ecs.taskDefinition @defaults("arn family revision") {
29032905
ephemeralStorage() aws.ecs.taskDefinition.ephemeralStorage
29042906
// Tags associated with the task definition
29052907
tags() map[string]string
2906-
// Region where the task definition is located
2907-
region string
29082908
// Total CPU units for the task (e.g., "256", "1024")
2909-
cpu string
2909+
cpu() string
29102910
// Total memory in MiB for the task (e.g., "512", "2048")
2911-
memory string
2911+
memory() string
29122912
// When the task definition was registered
2913-
registeredAt time
2913+
registeredAt() time
29142914
}
29152915

29162916
// Amazon ECS Service
@@ -4273,52 +4273,52 @@ private aws.dynamodb.globaltable @defaults("name") {
42734273
private aws.dynamodb.table @defaults("name region") {
42744274
// ARN for the table
42754275
arn string
4276-
// Table ID
4277-
id string
42784276
// Table name
42794277
name string
42804278
// Region where the table exists
42814279
region string
4280+
// Table ID
4281+
id string
42824282
// Backups for the table
42834283
backups() []dict
42844284
// Description of server-side encryption for the table
4285-
sseDescription dict
4285+
sseDescription() dict
42864286
// Type of server-side encryption: "AES256" (AWS-owned) or "KMS" (customer-managed or AWS-managed KMS key)
4287-
sseType string
4287+
sseType() string
42884288
// KMS key used for server-side encryption at rest
42894289
sseKmsKey() aws.kms.key
42904290
// Provisioned throughput settings for the table
4291-
provisionedThroughput dict
4291+
provisionedThroughput() dict
42924292
// Continuous backups and point-in-time recovery settings for the table
42934293
continuousBackups() dict
42944294
// Tags for the table
42954295
tags() map[string]string
42964296
// Date and time the table was created
4297-
createdAt time
4297+
createdAt() time
42984298
// Whether deletion protection is enabled
4299-
deletionProtectionEnabled bool
4299+
deletionProtectionEnabled() bool
43004300
// Global table version
4301-
globalTableVersion string
4301+
globalTableVersion() string
43024302
// Number of items in the table
4303-
items int
4303+
items() int
43044304
// Total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours.
4305-
sizeBytes int
4305+
sizeBytes() int
43064306
// Latest stream for this table
4307-
latestStreamArn string
4307+
latestStreamArn() string
43084308
// Current state of the table: CREATING, UPDATING, DELETING, ACTIVE, INACCESSIBLE_ENCRYPTION_CREDENTIALS, ARCHIVING, ARCHIVED, or REPLICATION_NOT_AUTHORIZED
4309-
status string
4309+
status() string
43104310
// Label of the latest DynamoDB stream
4311-
latestStreamLabel string
4311+
latestStreamLabel() string
43124312
// Table class: STANDARD or STANDARD_INFREQUENT_ACCESS
4313-
tableClass string
4313+
tableClass() string
43144314
// Whether DynamoDB Streams is enabled on the table
4315-
streamEnabled bool
4315+
streamEnabled() bool
43164316
// Type of information written to the stream: KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, or NEW_AND_OLD_IMAGES
4317-
streamViewType string
4317+
streamViewType() string
43184318
// Billing mode: PROVISIONED or PAY_PER_REQUEST
4319-
billingMode string
4319+
billingMode() string
43204320
// Regions where the table is replicated (global tables)
4321-
replicaRegions []string
4321+
replicaRegions() []string
43224322
}
43234323

43244324
// Amazon Simple Queue Service (SQS)
@@ -7198,43 +7198,43 @@ aws.eks.cluster @defaults("arn version status") {
71987198
// Region for the cluster
71997199
region string
72007200
// A map of tags associated with the cluster
7201-
tags map[string]string
7201+
tags() map[string]string
72027202
// Endpoint of Kubernetes API server
7203-
endpoint string
7203+
endpoint() string
72047204
// Kubernetes server version
7205-
version string
7205+
version() string
72067206
// Amazon EKS cluster version
7207-
platformVersion string
7207+
platformVersion() string
72087208
// Cluster status
7209-
status string
7209+
status() string
72107210
// Encryption configuration for the cluster
7211-
encryptionConfig []dict
7211+
encryptionConfig() []dict
72127212
// Cluster logging configuration
7213-
logging dict
7213+
logging() dict
72147214
// Kubernetes network configuration
7215-
networkConfig dict
7215+
networkConfig() dict
72167216
// VPC configuration
7217-
resourcesVpcConfig dict
7217+
resourcesVpcConfig() dict
72187218
// Cluster creation timestamp
7219-
createdAt time
7219+
createdAt() time
72207220
// List of EKS node groups
72217221
nodeGroups() []aws.eks.nodegroup
72227222
// List of EKS add-ons
72237223
addons() []aws.eks.addon
72247224
// IAM role that provides permissions for the Kubernetes control plane to make calls to Amazon Web Services API operations on your behalf
7225-
iamRole aws.iam.role
7225+
iamRole() aws.iam.role
72267226
// Kubernetes support policy of the cluster. (`STANDARD` support automatically upgrades at the end of standard support. `EXTENDED` automatically enters extended support at the end of standard support)
7227-
supportType string
7227+
supportType() string
72287228
// Cluster authentication mode
7229-
authenticationMode string
7229+
authenticationMode() string
72307230
// Whether deletion protection is enabled or not
7231-
deletionProtection bool
7231+
deletionProtection() bool
72327232
// Whether the Kubernetes API server endpoint is publicly accessible
7233-
endpointPublicAccess bool
7233+
endpointPublicAccess() bool
72347234
// Whether the Kubernetes API server endpoint is accessible via private VPC endpoint
7235-
endpointPrivateAccess bool
7235+
endpointPrivateAccess() bool
72367236
// CIDR blocks allowed to access the public Kubernetes API endpoint
7237-
publicAccessCidrs []string
7237+
publicAccessCidrs() []string
72387238
}
72397239

72407240
// Amazon Neptune

0 commit comments

Comments
 (0)