/
clusters.go
1659 lines (1636 loc) · 61.2 KB
/
clusters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package ecs
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ecs"
"github.com/aws/aws-sdk-go-v2/service/ecs/types"
"github.com/cloudquery/cloudquery/plugins/source/aws/client"
"github.com/cloudquery/cq-provider-sdk/provider/diag"
"github.com/cloudquery/cq-provider-sdk/provider/schema"
)
func Clusters() *schema.Table {
return &schema.Table{
Name: "aws_ecs_clusters",
Description: "A regional grouping of one or more container instances where you can run task requests",
Resolver: fetchEcsClusters,
Multiplex: client.ServiceAccountRegionMultiplexer("ecs"),
IgnoreError: client.IgnoreCommonErrors,
DeleteFilter: client.DeleteAccountRegionFilter,
Options: schema.TableCreationOptions{PrimaryKeys: []string{"arn"}},
Columns: []schema.Column{
{
Name: "account_id",
Description: "The AWS Account ID of the resource.",
Type: schema.TypeString,
Resolver: client.ResolveAWSAccount,
},
{
Name: "region",
Description: "The AWS Region of the resource.",
Type: schema.TypeString,
Resolver: client.ResolveAWSRegion,
},
{
Name: "active_services_count",
Description: "The number of services that are running on the cluster in an ACTIVE state",
Type: schema.TypeInt,
},
{
Name: "attachments_status",
Description: "The status of the capacity providers associated with the cluster",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "capacity_providers",
Description: "The capacity providers associated with the cluster.",
Type: schema.TypeStringArray,
},
{
Name: "arn",
Description: "The Amazon Resource Name (ARN) that identifies the cluster",
Type: schema.TypeString,
Resolver: schema.PathResolver("ClusterArn"),
},
{
Name: "name",
Description: "A user-generated string that you use to identify your cluster.",
Type: schema.TypeString,
Resolver: schema.PathResolver("ClusterName"),
},
{
Name: "execute_config_kms_key_id",
Description: "Specify an Key Management Service key ID to encrypt the data between the local client and the container.",
Type: schema.TypeString,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.KmsKeyId"),
IgnoreInTests: true,
},
{
Name: "execute_config_logs_cloud_watch_encryption_enabled",
Description: "Determines whether to use encryption on the CloudWatch logs",
Type: schema.TypeBool,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.LogConfiguration.CloudWatchEncryptionEnabled"),
},
{
Name: "execute_config_log_cloud_watch_log_group_name",
Description: "The name of the CloudWatch log group to send logs to",
Type: schema.TypeString,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.LogConfiguration.CloudWatchLogGroupName"),
IgnoreInTests: true,
},
{
Name: "execute_config_log_s3_bucket_name",
Description: "The name of the S3 bucket to send logs to",
Type: schema.TypeString,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.LogConfiguration.S3BucketName"),
IgnoreInTests: true,
},
{
Name: "execute_config_log_s3_encryption_enabled",
Description: "Determines whether to use encryption on the S3 logs",
Type: schema.TypeBool,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.LogConfiguration.S3EncryptionEnabled"),
},
{
Name: "execute_config_log_s3_key_prefix",
Description: "An optional folder in the S3 bucket to place logs in.",
Type: schema.TypeString,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.LogConfiguration.S3KeyPrefix"),
IgnoreInTests: true,
},
{
Name: "execute_config_logging",
Description: "The log setting to use for redirecting logs for your execute command results. The following log settings are available. * NONE: The execute command session is not logged. * DEFAULT: The awslogs configuration in the task definition is used",
Type: schema.TypeString,
Resolver: schema.PathResolver("Configuration.ExecuteCommandConfiguration.Logging"),
},
{
Name: "default_capacity_provider_strategy",
Description: "The default capacity provider strategy for the cluster",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("DefaultCapacityProviderStrategy"),
},
{
Name: "pending_tasks_count",
Description: "The number of tasks in the cluster that are in the PENDING state.",
Type: schema.TypeInt,
},
{
Name: "registered_container_instances_count",
Description: "The number of container instances registered into the cluster",
Type: schema.TypeInt,
},
{
Name: "running_tasks_count",
Description: "The number of tasks in the cluster that are in the RUNNING state.",
Type: schema.TypeInt,
},
{
Name: "settings",
Description: "The settings for the cluster",
Type: schema.TypeJSON,
Resolver: resolveClustersSettings,
},
{
Name: "statistics",
Description: "Additional information about your clusters that are separated by launch type. They include the following: * runningEC2TasksCount * RunningFargateTasksCount * pendingEC2TasksCount * pendingFargateTasksCount * activeEC2ServiceCount * activeFargateServiceCount * drainingEC2ServiceCount * drainingFargateServiceCount",
Type: schema.TypeJSON,
Resolver: resolveClustersStatistics,
},
{
Name: "status",
Description: "The status of the cluster",
Type: schema.TypeString,
},
{
Name: "tags",
Description: "The metadata that you apply to the cluster to help you categorize and organize them",
Type: schema.TypeJSON,
Resolver: client.ResolveTags,
},
},
Relations: []*schema.Table{
{
Name: "aws_ecs_cluster_attachments",
Description: "An object representing a container instance or task attachment.",
Resolver: schema.PathTableResolver("Attachments"),
IgnoreInTests: true,
Columns: []schema.Column{
{
Name: "cluster_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_clusters table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "details",
Description: "Details of the attachment",
Type: schema.TypeJSON,
Resolver: resolveClusterAttachmentsDetails,
},
{
Name: "id",
Description: "The unique identifier for the attachment.",
Type: schema.TypeString,
},
{
Name: "status",
Description: "The status of the attachment",
Type: schema.TypeString,
},
{
Name: "type",
Description: "The type of the attachment, such as ElasticNetworkInterface.",
Type: schema.TypeString,
},
},
},
{
Name: "aws_ecs_cluster_tasks",
Description: "Details on a task in a cluster.",
Resolver: fetchEcsClusterTasks,
IgnoreInTests: true,
Columns: []schema.Column{
{
Name: "cluster_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_clusters table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "attributes",
Description: "The attributes of the task",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("Attributes"),
},
{
Name: "availability_zone",
Description: "The Availability Zone for the task.",
Type: schema.TypeString,
},
{
Name: "capacity_provider_name",
Description: "The capacity provider that's associated with the task.",
Type: schema.TypeString,
},
{
Name: "cluster_arn",
Description: "The ARN of the cluster that hosts the task.",
Type: schema.TypeString,
},
{
Name: "connectivity",
Description: "The connectivity status of a task.",
Type: schema.TypeString,
},
{
Name: "connectivity_at",
Description: "The Unix timestamp for the time when the task last went into CONNECTED status.",
Type: schema.TypeTimestamp,
},
{
Name: "container_instance_arn",
Description: "The ARN of the container instances that host the task.",
Type: schema.TypeString,
},
{
Name: "cpu",
Description: "The number of CPU units used by the task as expressed in a task definition",
Type: schema.TypeString,
},
{
Name: "created_at",
Description: "The Unix timestamp for the time when the task was created",
Type: schema.TypeTimestamp,
},
{
Name: "desired_status",
Description: "The desired status of the task",
Type: schema.TypeString,
},
{
Name: "enable_execute_command",
Description: "Determines whether execute command functionality is enabled for this task",
Type: schema.TypeBool,
},
{
Name: "ephemeral_storage_size_in_gib",
Description: "The total amount, in GiB, of ephemeral storage to set for the task",
Type: schema.TypeInt,
Resolver: schema.PathResolver("EphemeralStorage.SizeInGiB"),
},
{
Name: "execution_stopped_at",
Description: "The Unix timestamp for the time when the task execution stopped.",
Type: schema.TypeTimestamp,
},
{
Name: "group",
Description: "The name of the task group that's associated with the task.",
Type: schema.TypeString,
},
{
Name: "health_status",
Description: "The health status for the task",
Type: schema.TypeString,
},
{
Name: "inference_accelerators",
Description: "The Elastic Inference accelerator that's associated with the task.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("InferenceAccelerators"),
},
{
Name: "last_status",
Description: "The last known status for the task",
Type: schema.TypeString,
},
{
Name: "launch_type",
Description: "The infrastructure where your task runs on",
Type: schema.TypeString,
},
{
Name: "memory",
Description: "The amount of memory (in MiB) that the task uses as expressed in a task definition",
Type: schema.TypeString,
},
{
Name: "overrides",
Description: "One or more container overrides.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("Overrides"),
},
{
Name: "platform_family",
Description: "The operating system that your tasks are running on",
Type: schema.TypeString,
},
{
Name: "platform_version",
Description: "The platform version where your task runs on",
Type: schema.TypeString,
},
{
Name: "pull_started_at",
Description: "The Unix timestamp for the time when the container image pull began.",
Type: schema.TypeTimestamp,
},
{
Name: "pull_stopped_at",
Description: "The Unix timestamp for the time when the container image pull completed.",
Type: schema.TypeTimestamp,
},
{
Name: "started_at",
Description: "The Unix timestamp for the time when the task started",
Type: schema.TypeTimestamp,
},
{
Name: "started_by",
Description: "The tag specified when a task is started",
Type: schema.TypeString,
},
{
Name: "stop_code",
Description: "The stop code indicating why a task was stopped",
Type: schema.TypeString,
},
{
Name: "stopped_at",
Description: "The Unix timestamp for the time when the task was stopped",
Type: schema.TypeTimestamp,
},
{
Name: "stopped_reason",
Description: "The reason that the task was stopped.",
Type: schema.TypeString,
},
{
Name: "stopping_at",
Description: "The Unix timestamp for the time when the task stops",
Type: schema.TypeTimestamp,
},
{
Name: "tags",
Description: "The metadata that you apply to the task to help you categorize and organize the task",
Type: schema.TypeJSON,
Resolver: client.ResolveTags,
},
{
Name: "arn",
Description: "The Amazon Resource Name (ARN) of the task.",
Type: schema.TypeString,
Resolver: schema.PathResolver("TaskArn"),
},
{
Name: "task_definition_arn",
Description: "The ARN of the task definition that creates the task.",
Type: schema.TypeString,
},
{
Name: "version",
Description: "The version counter for the task",
Type: schema.TypeBigInt,
},
},
Relations: []*schema.Table{
{
Name: "aws_ecs_cluster_task_attachments",
Description: "An object representing a container instance or task attachment.",
Resolver: schema.PathTableResolver("Attachments"),
Columns: []schema.Column{
{
Name: "cluster_task_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_tasks table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "details",
Description: "Details of the attachment",
Type: schema.TypeJSON,
Resolver: resolveClusterTaskAttachmentsDetails,
},
{
Name: "id",
Description: "The unique identifier for the attachment.",
Type: schema.TypeString,
},
{
Name: "status",
Description: "The status of the attachment",
Type: schema.TypeString,
},
{
Name: "type",
Description: "The type of the attachment, such as ElasticNetworkInterface.",
Type: schema.TypeString,
},
},
},
{
Name: "aws_ecs_cluster_task_containers",
Description: "A Docker container that's part of a task.",
Resolver: schema.PathTableResolver("Containers"),
Columns: []schema.Column{
{
Name: "cluster_task_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_tasks table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "container_arn",
Description: "The Amazon Resource Name (ARN) of the container.",
Type: schema.TypeString,
},
{
Name: "cpu",
Description: "The number of CPU units set for the container",
Type: schema.TypeString,
},
{
Name: "exit_code",
Description: "The exit code returned from the container.",
Type: schema.TypeInt,
},
{
Name: "gpu_ids",
Description: "The IDs of each GPU assigned to the container.",
Type: schema.TypeStringArray,
},
{
Name: "health_status",
Description: "The health status of the container",
Type: schema.TypeString,
},
{
Name: "image",
Description: "The image used for the container.",
Type: schema.TypeString,
},
{
Name: "image_digest",
Description: "The container image manifest digest",
Type: schema.TypeString,
},
{
Name: "last_status",
Description: "The last known status of the container.",
Type: schema.TypeString,
},
{
Name: "managed_agents",
Description: "The details of any Amazon ECS managed agents associated with the container.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("ManagedAgents"),
},
{
Name: "memory",
Description: "The hard limit (in MiB) of memory set for the container.",
Type: schema.TypeString,
},
{
Name: "memory_reservation",
Description: "The soft limit (in MiB) of memory set for the container.",
Type: schema.TypeString,
},
{
Name: "name",
Description: "The name of the container.",
Type: schema.TypeString,
},
{
Name: "network_bindings",
Description: "The network bindings associated with the container.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("NetworkBindings"),
},
{
Name: "network_interfaces",
Description: "The network interfaces associated with the container.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("NetworkInterfaces"),
},
{
Name: "reason",
Description: "A short (255 max characters) human-readable string to provide additional details about a running or stopped container.",
Type: schema.TypeString,
},
{
Name: "runtime_id",
Description: "The ID of the Docker container.",
Type: schema.TypeString,
},
{
Name: "task_arn",
Description: "The ARN of the task.",
Type: schema.TypeString,
},
},
},
},
},
{
Name: "aws_ecs_cluster_services",
Description: "Details on a service within a cluster",
Resolver: fetchEcsClusterServices,
Columns: []schema.Column{
{
Name: "cluster_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_clusters table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "capacity_provider_strategy",
Description: "The capacity provider strategy the service uses",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("CapacityProviderStrategy"),
IgnoreInTests: true,
},
{
Name: "cluster_arn",
Description: "The Amazon Resource Name (ARN) of the cluster that hosts the service.",
Type: schema.TypeString,
},
{
Name: "created_at",
Description: "The Unix timestamp for the time when the service was created.",
Type: schema.TypeTimestamp,
},
{
Name: "created_by",
Description: "The principal that created the service.",
Type: schema.TypeString,
},
{
Name: "deployment_configuration_deployment_circuit_breaker_enable",
Description: "Determines whether to use the deployment circuit breaker logic for the service. This member is required.",
Type: schema.TypeBool,
Resolver: schema.PathResolver("DeploymentConfiguration.DeploymentCircuitBreaker.Enable"),
},
{
Name: "deployment_configuration_deployment_circuit_breaker_rollback",
Description: "Determines whether to configure Amazon ECS to roll back the service if a service deployment fails",
Type: schema.TypeBool,
Resolver: schema.PathResolver("DeploymentConfiguration.DeploymentCircuitBreaker.Rollback"),
},
{
Name: "deployment_configuration_maximum_percent",
Description: "If a service is using the rolling update (ECS) deployment type, the maximum percent parameter represents an upper limit on the number of tasks in a service that are allowed in the RUNNING or PENDING state during a deployment, as a percentage of the desired number of tasks (rounded down to the nearest integer), and while any container instances are in the DRAINING state if the service contains tasks using the EC2 launch type",
Type: schema.TypeInt,
Resolver: schema.PathResolver("DeploymentConfiguration.MaximumPercent"),
},
{
Name: "deployment_configuration_minimum_healthy_percent",
Description: "If a service is using the rolling update (ECS) deployment type, the minimum healthy percent represents a lower limit on the number of tasks in a service that must remain in the RUNNING state during a deployment, as a percentage of the desired number of tasks (rounded up to the nearest integer), and while any container instances are in the DRAINING state if the service contains tasks using the EC2 launch type",
Type: schema.TypeInt,
Resolver: schema.PathResolver("DeploymentConfiguration.MinimumHealthyPercent"),
},
{
Name: "deployment_controller_type",
Description: "The deployment controller type to use",
Type: schema.TypeString,
Resolver: schema.PathResolver("DeploymentController.Type"),
},
{
Name: "desired_count",
Description: "The desired number of instantiations of the task definition to keep running on the service",
Type: schema.TypeInt,
},
{
Name: "enable_ecs_managed_tags",
Description: "Determines whether to use Amazon ECS managed tags for the tasks in the service. For more information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the Amazon Elastic Container Service Developer Guide.",
Type: schema.TypeBool,
Resolver: schema.PathResolver("EnableECSManagedTags"),
},
{
Name: "enable_execute_command",
Description: "Determines whether the execute command functionality is enabled for the service. If true, the execute command functionality is enabled for all containers in tasks as part of the service.",
Type: schema.TypeBool,
},
{
Name: "health_check_grace_period_seconds",
Description: "The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.",
Type: schema.TypeInt,
IgnoreInTests: true,
},
{
Name: "launch_type",
Description: "The launch type the service is using",
Type: schema.TypeString,
},
{
Name: "network_configuration_awsvpc_configuration_subnets",
Description: "The IDs of the subnets associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.Subnets"),
},
{
Name: "network_configuration_awsvpc_configuration_assign_public_ip",
Description: "Whether the task's elastic network interface receives a public IP address",
Type: schema.TypeString,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.AssignPublicIp"),
},
{
Name: "network_configuration_awsvpc_configuration_security_groups",
Description: "The IDs of the security groups associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.SecurityGroups"),
},
{
Name: "pending_count",
Description: "The number of tasks in the cluster that are in the PENDING state.",
Type: schema.TypeInt,
},
{
Name: "placement_constraints",
Description: "The placement constraints for the tasks in the service.",
Type: schema.TypeJSON,
Resolver: resolveClusterServicesPlacementConstraints,
},
{
Name: "placement_strategy",
Description: "The placement strategy that determines how tasks for the service are placed.",
Type: schema.TypeJSON,
Resolver: resolveClusterServicesPlacementStrategy,
},
{
Name: "platform_family",
Description: "The operating system that your tasks in the service run on",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "platform_version",
Description: "The platform version to run your service on",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "propagate_tags",
Description: "Determines whether to propagate the tags from the task definition or the service to the task",
Type: schema.TypeString,
},
{
Name: "role_arn",
Description: "The ARN of the IAM role that's associated with the service",
Type: schema.TypeString,
},
{
Name: "running_count",
Description: "The number of tasks in the cluster that are in the RUNNING state.",
Type: schema.TypeInt,
},
{
Name: "scheduling_strategy",
Description: "The scheduling strategy to use for the service",
Type: schema.TypeString,
},
{
Name: "arn",
Description: "The ARN that identifies the service",
Type: schema.TypeString,
Resolver: schema.PathResolver("ServiceArn"),
},
{
Name: "name",
Description: "The name of your service",
Type: schema.TypeString,
Resolver: schema.PathResolver("ServiceName"),
},
{
Name: "status",
Description: "The status of the service",
Type: schema.TypeString,
},
{
Name: "tags",
Description: "The metadata that you apply to the service to help you categorize and organize them",
Type: schema.TypeJSON,
Resolver: client.ResolveTags,
},
{
Name: "task_definition",
Description: "The task definition to use for tasks in the service",
Type: schema.TypeString,
},
},
Relations: []*schema.Table{
{
Name: "aws_ecs_cluster_service_deployments",
Description: "The details of an Amazon ECS service deployment",
Resolver: schema.PathTableResolver("Deployments"),
Columns: []schema.Column{
{
Name: "cluster_service_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_services table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "capacity_provider_strategy",
Description: "The capacity provider strategy that the deployment is using.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("CapacityProviderStrategy"),
IgnoreInTests: true,
},
{
Name: "created_at",
Description: "The Unix timestamp for the time when the service deployment was created.",
Type: schema.TypeTimestamp,
},
{
Name: "desired_count",
Description: "The most recent desired count of tasks that was specified for the service to deploy or maintain.",
Type: schema.TypeInt,
},
{
Name: "failed_tasks",
Description: "The number of consecutively failed tasks in the deployment",
Type: schema.TypeInt,
},
{
Name: "id",
Description: "The ID of the deployment.",
Type: schema.TypeString,
},
{
Name: "launch_type",
Description: "The launch type the tasks in the service are using",
Type: schema.TypeString,
},
{
Name: "network_configuration_awsvpc_configuration_subnets",
Description: "The IDs of the subnets associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.Subnets"),
},
{
Name: "network_configuration_awsvpc_configuration_assign_public_ip",
Description: "Whether the task's elastic network interface receives a public IP address",
Type: schema.TypeString,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.AssignPublicIp"),
},
{
Name: "network_configuration_awsvpc_configuration_security_groups",
Description: "The IDs of the security groups associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.SecurityGroups"),
},
{
Name: "pending_count",
Description: "The number of tasks in the deployment that are in the PENDING status.",
Type: schema.TypeInt,
},
{
Name: "platform_family",
Description: "The operating system that your tasks in the service, or tasks are running on",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "platform_version",
Description: "The platform version that your tasks in the service run on",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "rollout_state",
Description: "The rolloutState of a service is only returned for services that use the rolling update (ECS) deployment type that aren't behind a Classic Load Balancer",
Type: schema.TypeString,
},
{
Name: "rollout_state_reason",
Description: "A description of the rollout state of a deployment.",
Type: schema.TypeString,
},
{
Name: "running_count",
Description: "The number of tasks in the deployment that are in the RUNNING status.",
Type: schema.TypeInt,
},
{
Name: "status",
Description: "The status of the deployment",
Type: schema.TypeString,
},
{
Name: "task_definition",
Description: "The most recent task definition that was specified for the tasks in the service to use.",
Type: schema.TypeString,
},
{
Name: "updated_at",
Description: "The Unix timestamp for the time when the service deployment was last updated.",
Type: schema.TypeTimestamp,
},
},
},
{
Name: "aws_ecs_cluster_service_events",
Description: "The details for an event that's associated with a service.",
Resolver: schema.PathTableResolver("Events"),
Columns: []schema.Column{
{
Name: "cluster_service_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_services table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "created_at",
Description: "The Unix timestamp for the time when the event was triggered.",
Type: schema.TypeTimestamp,
},
{
Name: "id",
Description: "The ID string for the event.",
Type: schema.TypeString,
},
{
Name: "message",
Description: "The event message.",
Type: schema.TypeString,
},
},
},
{
Name: "aws_ecs_cluster_service_load_balancers",
Description: "The load balancer configuration to use with a service or task set",
Resolver: schema.PathTableResolver("LoadBalancers"),
IgnoreInTests: true,
Columns: []schema.Column{
{
Name: "cluster_service_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_services table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "container_name",
Description: "The name of the container (as it appears in a container definition) to associate with the load balancer.",
Type: schema.TypeString,
},
{
Name: "container_port",
Description: "The port on the container to associate with the load balancer",
Type: schema.TypeInt,
},
{
Name: "load_balancer_name",
Description: "The name of the load balancer to associate with the Amazon ECS service or task set",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "target_group_arn",
Description: "The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set",
Type: schema.TypeString,
},
},
},
{
Name: "aws_ecs_cluster_service_service_registries",
Description: "The details for the service registry",
Resolver: schema.PathTableResolver("ServiceRegistries"),
IgnoreInTests: true,
Columns: []schema.Column{
{
Name: "cluster_service_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_services table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "container_name",
Description: "The container name value to be used for your service discovery service",
Type: schema.TypeString,
},
{
Name: "container_port",
Description: "The port value to be used for your service discovery service",
Type: schema.TypeInt,
},
{
Name: "port",
Description: "The port value used if your service discovery service specified an SRV record. This field might be used if both the awsvpc network mode and SRV records are used.",
Type: schema.TypeInt,
},
{
Name: "registry_arn",
Description: "The Amazon Resource Name (ARN) of the service registry",
Type: schema.TypeString,
},
},
},
{
Name: "aws_ecs_cluster_service_task_sets",
Description: "Information about a set of Amazon ECS tasks in either an CodeDeploy or an EXTERNAL deployment",
Resolver: schema.PathTableResolver("TaskSets"),
IgnoreInTests: true,
Columns: []schema.Column{
{
Name: "cluster_service_cq_id",
Description: "Unique CloudQuery ID of aws_ecs_cluster_services table (FK)",
Type: schema.TypeUUID,
Resolver: schema.ParentIdResolver,
},
{
Name: "capacity_provider_strategy",
Description: "The capacity provider strategy that are associated with the task set.",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("CapacityProviderStrategy"),
IgnoreInTests: true,
},
{
Name: "cluster_arn",
Description: "The Amazon Resource Name (ARN) of the cluster that the service that hosts the task set exists in.",
Type: schema.TypeString,
},
{
Name: "computed_desired_count",
Description: "The computed desired count for the task set",
Type: schema.TypeInt,
},
{
Name: "created_at",
Description: "The Unix timestamp for the time when the task set was created.",
Type: schema.TypeTimestamp,
},
{
Name: "external_id",
Description: "The external ID associated with the task set",
Type: schema.TypeString,
},
{
Name: "id",
Description: "The ID of the task set.",
Type: schema.TypeString,
},
{
Name: "launch_type",
Description: "The launch type the tasks in the task set are using",
Type: schema.TypeString,
},
{
Name: "network_configuration_awsvpc_configuration_subnets",
Description: "The IDs of the subnets associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.Subnets"),
},
{
Name: "network_configuration_awsvpc_configuration_assign_public_ip",
Description: "Whether the task's elastic network interface receives a public IP address",
Type: schema.TypeString,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.AssignPublicIp"),
},
{
Name: "network_configuration_awsvpc_configuration_security_groups",
Description: "The IDs of the security groups associated with the task or service",
Type: schema.TypeStringArray,
Resolver: schema.PathResolver("NetworkConfiguration.AwsvpcConfiguration.SecurityGroups"),
},
{
Name: "pending_count",
Description: "The number of tasks in the task set that are in the PENDING status during a deployment",
Type: schema.TypeInt,
},
{
Name: "platform_family",
Description: "The operating system that your tasks in the set are running on",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "platform_version",
Description: "The Fargate platform version where the tasks in the task set are running",
Type: schema.TypeString,
IgnoreInTests: true,
},
{
Name: "running_count",
Description: "The number of tasks in the task set that are in the RUNNING status during a deployment",
Type: schema.TypeInt,