Skip to content

Commit

Permalink
Remove the deprecated columns from the tables (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
misraved authored Oct 22, 2024
1 parent f5f9975 commit 80f9fa7
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 153 deletions.
7 changes: 0 additions & 7 deletions aws/table_aws_accessanalyzer_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
14 changes: 0 additions & 14 deletions aws/table_aws_ecr_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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.",
Expand Down
6 changes: 0 additions & 6 deletions aws/table_aws_ecrpublic_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
5 changes: 0 additions & 5 deletions aws/table_aws_glue_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
6 changes: 0 additions & 6 deletions aws/table_aws_securityhub_finding.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{"=", "<>"}},
},
Expand Down Expand Up @@ -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.",
Expand Down
7 changes: 0 additions & 7 deletions aws/table_aws_ses_domain_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
6 changes: 0 additions & 6 deletions aws/table_aws_ses_email_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
12 changes: 0 additions & 12 deletions aws/table_aws_ssm_document.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
90 changes: 0 additions & 90 deletions aws/table_aws_vpc_security_group_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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.",
Expand All @@ -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.",
Expand All @@ -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.",
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 80f9fa7

Please sign in to comment.