From 80f9fa78aedcbd2b5a731ce2754d291b38304e0c Mon Sep 17 00:00:00 2001 From: Ved misra <47312748+misraved@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:10:23 +0530 Subject: [PATCH] Remove the deprecated columns from the tables (#2323) --- aws/table_aws_accessanalyzer_analyzer.go | 7 -- aws/table_aws_ecr_repository.go | 14 ---- aws/table_aws_ecrpublic_repository.go | 6 -- aws/table_aws_glue_job.go | 5 -- aws/table_aws_securityhub_finding.go | 6 -- aws/table_aws_ses_domain_identity.go | 7 -- aws/table_aws_ses_email_identity.go | 6 -- aws/table_aws_ssm_document.go | 12 ---- aws/table_aws_vpc_security_group_rule.go | 90 ------------------------ 9 files changed, 153 deletions(-) diff --git a/aws/table_aws_accessanalyzer_analyzer.go b/aws/table_aws_accessanalyzer_analyzer.go index cbc0d48dc..987eb08bd 100644 --- a/aws/table_aws_accessanalyzer_analyzer.go +++ b/aws/table_aws_accessanalyzer_analyzer.go @@ -86,13 +86,6 @@ func tableAwsAccessAnalyzer(_ context.Context) *plugin.Table { Description: "The statusReason provides more details about the current status of the analyzer.", Type: proto.ColumnType_STRING, }, - { - Name: "findings", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use table aws_accessanalyzer_finding instead. A list of findings retrieved from the analyzer that match the filter criteria specified, if any.", - Type: proto.ColumnType_JSON, - Hydrate: listAccessAnalyzerFindings, - Transform: transform.FromValue(), - }, // Steampipe standard columns { diff --git a/aws/table_aws_ecr_repository.go b/aws/table_aws_ecr_repository.go index f52d05e30..fcb3274ce 100644 --- a/aws/table_aws_ecr_repository.go +++ b/aws/table_aws_ecr_repository.go @@ -114,13 +114,6 @@ func tableAwsEcrRepository(_ context.Context) *plugin.Table { Hydrate: getAwsEcrRepositories, Type: proto.ColumnType_JSON, }, - { - Name: "image_details", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use the aws_ecr_image table instead. A list of ImageDetail objects that contain data about the image.", - Hydrate: getAwsEcrDescribeImages, - Type: proto.ColumnType_JSON, - Transform: transform.FromValue(), - }, { Name: "repository_scanning_configuration", Description: "Gets the scanning configuration for one or more repositories.", @@ -133,13 +126,6 @@ func tableAwsEcrRepository(_ context.Context) *plugin.Table { Description: "The image scanning configuration for a repository.", Type: proto.ColumnType_JSON, }, - { - Name: "image_scanning_findings", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use the aws_ecr_image_scan_finding table instead. Scan findings for an image.", - Type: proto.ColumnType_JSON, - Hydrate: getAwsEcrDescribeImageScanningFindings, - Transform: transform.FromValue(), - }, { Name: "lifecycle_policy", Description: "The JSON lifecycle policy text.", diff --git a/aws/table_aws_ecrpublic_repository.go b/aws/table_aws_ecrpublic_repository.go index d2cf2bd15..f0418baf9 100644 --- a/aws/table_aws_ecrpublic_repository.go +++ b/aws/table_aws_ecrpublic_repository.go @@ -78,12 +78,6 @@ func tableAwsEcrpublicRepository(_ context.Context) *plugin.Table { Description: "The date and time, in JavaScript date format, when the repository was created.", Type: proto.ColumnType_TIMESTAMP, }, - { - Name: "image_details", - Description: "A list of ImageDetail objects that contain data about the image.", - Hydrate: getAwsEcrpublicDescribeImages, - Type: proto.ColumnType_JSON, - }, { Name: "policy", Description: "The JSON repository policy text associated with the repository.", diff --git a/aws/table_aws_glue_job.go b/aws/table_aws_glue_job.go index 6270d9296..9e366cf94 100644 --- a/aws/table_aws_glue_job.go +++ b/aws/table_aws_glue_job.go @@ -55,11 +55,6 @@ func tableAwsGlueJob(_ context.Context) *plugin.Table { Hydrate: getGlueJobArn, Transform: transform.FromValue(), }, - { - Name: "allocated_capacity", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use max_capacity instead. The number of Glue data processing units (DPUs) that can be allocated when this job runs.", - Type: proto.ColumnType_DOUBLE, - }, { Name: "created_on", Description: "The time and date that this job definition was created.", diff --git a/aws/table_aws_securityhub_finding.go b/aws/table_aws_securityhub_finding.go index fbe242e93..4b2f31622 100644 --- a/aws/table_aws_securityhub_finding.go +++ b/aws/table_aws_securityhub_finding.go @@ -43,7 +43,6 @@ func tableAwsSecurityHubFinding(_ context.Context) *plugin.Table { {Name: "record_state", Require: plugin.Optional, Operators: []string{"=", "<>"}}, {Name: "title", Require: plugin.Optional, Operators: []string{"=", "<>"}}, {Name: "verification_state", Require: plugin.Optional, Operators: []string{"=", "<>"}}, - {Name: "workflow_state", Require: plugin.Optional, Operators: []string{"=", "<>"}}, {Name: "workflow_status", Require: plugin.Optional, Operators: []string{"=", "<>"}}, {Name: "source_account_id", Require: plugin.Optional, Operators: []string{"=", "<>"}}, }, @@ -155,11 +154,6 @@ func tableAwsSecurityHubFinding(_ context.Context) *plugin.Table { Description: "Indicates the veracity of a finding.", Type: proto.ColumnType_STRING, }, - { - Name: "workflow_state", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release. The workflow state of a finding.", - Type: proto.ColumnType_STRING, - }, { Name: "workflow_status", Description: "The workflow status of a finding. Possible values are NEW, NOTIFIED, SUPPRESSED, RESOLVED.", diff --git a/aws/table_aws_ses_domain_identity.go b/aws/table_aws_ses_domain_identity.go index f8945cd05..311d32e93 100644 --- a/aws/table_aws_ses_domain_identity.go +++ b/aws/table_aws_ses_domain_identity.go @@ -53,13 +53,6 @@ func tableAwsSESDomainIdentity(_ context.Context) *plugin.Table { Hydrate: getSESIdentityVerificationAttributes, Transform: transform.FromField("VerificationStatus"), }, - { - Name: "verification_token", - Description: "The verification token for a domain identity.", - Type: proto.ColumnType_STRING, - Hydrate: getSESIdentityVerificationAttributes, - Transform: transform.FromField("VerificationToken"), - }, { Name: "dkim_attributes", Description: "The DKIM attributes for an email address or a domain.", diff --git a/aws/table_aws_ses_email_identity.go b/aws/table_aws_ses_email_identity.go index edb87849c..5a0aebba8 100644 --- a/aws/table_aws_ses_email_identity.go +++ b/aws/table_aws_ses_email_identity.go @@ -53,12 +53,6 @@ func tableAwsSESEmailIdentity(_ context.Context) *plugin.Table { Type: proto.ColumnType_STRING, Hydrate: getSESIdentityVerificationAttributes, }, - { - Name: "verification_token", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release. The verification token for a domain identity.", - Type: proto.ColumnType_STRING, - Hydrate: getSESIdentityVerificationAttributes, - }, { Name: "notification_attributes", Description: "Represents the notification attributes of an identity.", diff --git a/aws/table_aws_ssm_document.go b/aws/table_aws_ssm_document.go index 7443c8454..5bc62742b 100644 --- a/aws/table_aws_ssm_document.go +++ b/aws/table_aws_ssm_document.go @@ -59,18 +59,6 @@ func tableAwsSSMDocument(_ context.Context) *plugin.Table { Description: "The name of the Systems Manager document.", Type: proto.ColumnType_STRING, }, - { - Name: "account_ids", - Description: "[DEPRECATED] The account IDs that have permission to use this document.The ID can be either an AWS account or All.", - Type: proto.ColumnType_JSON, - Hydrate: getAwsSSMDocumentPermissionDetail, - }, - { - Name: "account_sharing_info_list", - Description: "[DEPRECATED] A list of AWS accounts where the current document is shared and the version shared with each account.", - Type: proto.ColumnType_JSON, - Hydrate: getAwsSSMDocumentPermissionDetail, - }, { Name: "arn", Description: "The Amazon Resource Name (ARN) of the document.", diff --git a/aws/table_aws_vpc_security_group_rule.go b/aws/table_aws_vpc_security_group_rule.go index e5ea8f7d4..9b84366d2 100644 --- a/aws/table_aws_vpc_security_group_rule.go +++ b/aws/table_aws_vpc_security_group_rule.go @@ -53,12 +53,6 @@ func tableAwsVpcSecurityGroupRule(_ context.Context) *plugin.Table { Description: "The ID of the security group rule.", Type: proto.ColumnType_STRING, }, - { - Name: "group_name", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release. The name of the security group to which rule belongs.", - Type: proto.ColumnType_STRING, - Hydrate: getSecurityGroupDetails, - }, { Name: "group_id", Description: "The ID of the security group to which rule belongs.", @@ -75,18 +69,6 @@ func tableAwsVpcSecurityGroupRule(_ context.Context) *plugin.Table { Type: proto.ColumnType_STRING, Transform: transform.FromField("IsEgress").Transform(setRuleType), }, - { - Name: "vpc_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release. The ID of the VPC for the security group.", - Type: proto.ColumnType_STRING, - Hydrate: getSecurityGroupDetails, - }, - { - Name: "owner_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use group_owner_id instead. The AWS account ID of the owner of the security group to which rule belongs.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("GroupOwnerId"), - }, { Name: "group_owner_id", Description: "The ID of the Amazon Web Services account that owns the security group.", @@ -112,12 +94,6 @@ func tableAwsVpcSecurityGroupRule(_ context.Context) *plugin.Table { Description: "The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes.", Type: proto.ColumnType_INT, }, - { - Name: "cidr_ip", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use cidr_ipv4 instead. The IPv4 CIDR range.", - Type: proto.ColumnType_CIDR, - Transform: transform.FromField("CidrIpv4"), - }, { Name: "cidr_ipv4", Description: "The IPv4 CIDR range.", @@ -128,67 +104,30 @@ func tableAwsVpcSecurityGroupRule(_ context.Context) *plugin.Table { Description: "The IPv6 CIDR range.", Type: proto.ColumnType_CIDR, }, - { - Name: "pair_group_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use referenced_group_id instead. The ID of the referenced security group.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ReferencedGroupInfo.GroupId"), - }, { Name: "referenced_group_id", Description: "The ID of the referenced security group.", Type: proto.ColumnType_STRING, Transform: transform.FromField("ReferencedGroupInfo.GroupId"), }, - { - Name: "pair_group_name", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release. The name of the referenced security group.", - Type: proto.ColumnType_STRING, - Hydrate: getReferencedSecurityGroupDetails, - Transform: transform.FromField("GroupName"), - }, - { - Name: "pair_peering_status", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use referenced_peering_status instead. Please use the referenced_peering_status column instead. The status of a VPC peering connection, if applicable.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ReferencedGroupInfo.PeeringStatus"), - }, { Name: "referenced_peering_status", Description: "The status of a VPC peering connection, if applicable.", Type: proto.ColumnType_STRING, Transform: transform.FromField("ReferencedGroupInfo.PeeringStatus"), }, - { - Name: "pair_user_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use referenced_user_id instead. The ID of an AWS account. For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ReferencedGroupInfo.UserId"), - }, { Name: "referenced_user_id", Description: "The ID of an AWS account. For a referenced security group in another VPC, the account ID of the referenced security group is returned in the response. If the referenced security group is deleted, this value is not returned.", Type: proto.ColumnType_STRING, Transform: transform.FromField("ReferencedGroupInfo.UserId"), }, - { - Name: "pair_vpc_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use referenced_vpc_id instead. The ID of the VPC for the referenced security group, if applicable.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ReferencedGroupInfo.VpcId"), - }, { Name: "referenced_vpc_id", Description: "The ID of the VPC for the referenced security group, if applicable.", Type: proto.ColumnType_STRING, Transform: transform.FromField("ReferencedGroupInfo.VpcId"), }, - { - Name: "pair_vpc_peering_connection_id", - Description: "[DEPRECATED] This column has been deprecated and will be removed in a future release, use referenced_vpc_peering_connection_id instead. The ID of the VPC peering connection, if applicable.", - Type: proto.ColumnType_STRING, - Transform: transform.FromField("ReferencedGroupInfo.VpcPeeringConnectionId"), - }, { Name: "referenced_vpc_peering_connection_id", Description: "The ID of the VPC peering connection, if applicable.", @@ -318,35 +257,6 @@ func getSecurityGroupRule(ctx context.Context, d *plugin.QueryData, h *plugin.Hy return nil, nil } -func getSecurityGroupDetails(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { - - sgRule := h.Item.(types.SecurityGroupRule) - - // Build the params - params := &ec2.DescribeSecurityGroupsInput{ - GroupIds: []string{*sgRule.GroupId}, - } - - // get service - svc, err := EC2Client(ctx, d) - if err != nil { - plugin.Logger(ctx).Error("aws_vpc_security_group_rule.getSecurityGroupDetails", "connection_error", err) - return nil, err - } - - op, err := svc.DescribeSecurityGroups(ctx, params) - if err != nil { - plugin.Logger(ctx).Error("aws_vpc_security_group_rule.getSecurityGroupDetails", "api_error", err) - return nil, err - } - - if len(op.SecurityGroups) > 0 { - return op.SecurityGroups[0], nil - } - - return nil, nil -} - func getReferencedSecurityGroupDetails(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { sgRule := h.Item.(types.SecurityGroupRule) if sgRule.ReferencedGroupInfo == nil {