diff --git a/pkg/provider/aws/autoscaling_test.go b/pkg/provider/aws/autoscaling_test.go index af762d92..ee444c9f 100644 --- a/pkg/provider/aws/autoscaling_test.go +++ b/pkg/provider/aws/autoscaling_test.go @@ -17,8 +17,9 @@ func TestFetchAutoscalingGroup(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 2) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "autoscaling.AutoScalingGroup", - Region: defaultRegion, + Type: "autoscaling.AutoScalingGroup", + Region: defaultRegion, + DisplayIdPrefix: "testing-0-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/config/elasticache.yaml b/pkg/provider/aws/config/elasticache.yaml index a9fe08b3..d34684ee 100644 --- a/pkg/provider/aws/config/elasticache.yaml +++ b/pkg/provider/aws/config/elasticache.yaml @@ -15,3 +15,5 @@ types: pointer: true key: Key value: Value + transformers: + - displayIdArnPrefix("cluster:") diff --git a/pkg/provider/aws/config/elb.yaml b/pkg/provider/aws/config/elb.yaml index e1e53b49..bc2e0d7c 100644 --- a/pkg/provider/aws/config/elb.yaml +++ b/pkg/provider/aws/config/elb.yaml @@ -10,6 +10,7 @@ types: id: name: LoadBalancerArn pointer: true + displayId: LoadBalancerName getTagsApi: call: DescribeTags inputIDField: diff --git a/pkg/provider/aws/config/iam.yaml b/pkg/provider/aws/config/iam.yaml index fd3f58f4..909f0e50 100644 --- a/pkg/provider/aws/config/iam.yaml +++ b/pkg/provider/aws/config/iam.yaml @@ -16,6 +16,8 @@ types: field: Tags key: Key value: Value + transformers: + - displayIdArnPrefix("oidc-provider/") - name: Policy listApi: call: ListPolicies @@ -40,6 +42,8 @@ types: call: ListSAMLProviderTags inputIDField: SAMLProviderArn tags: *tags + transformers: + - displayIdArnPrefix("saml-provider/") - name: VirtualMFADevice listApi: call: ListVirtualMFADevices @@ -50,3 +54,5 @@ types: call: ListMFADeviceTags inputIDField: SerialNumber tags: *tags + transformers: + - displayIdArnPrefix("mfa/") diff --git a/pkg/provider/aws/config/lambda.yaml b/pkg/provider/aws/config/lambda.yaml index 91018e5c..32909086 100644 --- a/pkg/provider/aws/config/lambda.yaml +++ b/pkg/provider/aws/config/lambda.yaml @@ -6,11 +6,10 @@ types: outputKey: Functions sdkType: FunctionConfiguration id: FunctionArn + displayId: FunctionName getTagsApi: call: GetFunction inputIDField: FunctionName tags: style: map field: Tags - transformers: - - displayIdArnPrefix("function:") diff --git a/pkg/provider/aws/config/sns.yaml b/pkg/provider/aws/config/sns.yaml index 35746b3a..0ffd67d8 100644 --- a/pkg/provider/aws/config/sns.yaml +++ b/pkg/provider/aws/config/sns.yaml @@ -15,3 +15,5 @@ types: pointer: true key: Key value: Value + transformers: + - displayIdArn diff --git a/pkg/provider/aws/ec2_test.go b/pkg/provider/aws/ec2_test.go index 7d6be3ab..7a947715 100644 --- a/pkg/provider/aws/ec2_test.go +++ b/pkg/provider/aws/ec2_test.go @@ -17,8 +17,9 @@ func TestFetchEC2Instances(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 2) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Instance", - Region: defaultRegion, + Type: "ec2.Instance", + Region: defaultRegion, + DisplayIdPrefix: "i-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -40,8 +41,9 @@ func TestFetchEBSVolumes(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 2) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Volume", - Region: defaultRegion, + Type: "ec2.Volume", + Region: defaultRegion, + DisplayIdPrefix: "vol-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -60,8 +62,9 @@ func TestFetchAddresses(t *testing.T) { ctx := setupIntegrationTest(t) resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.Address") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Address", - Region: defaultRegion, + Type: "ec2.Address", + Region: defaultRegion, + DisplayIdPrefix: "eipalloc-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -77,8 +80,9 @@ func TestFetchImages(t *testing.T) { ctx := setupIntegrationTest(t) resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.Image") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Image", - Region: defaultRegion, + Type: "ec2.Image", + Region: defaultRegion, + DisplayIdPrefix: "ami-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -97,8 +101,9 @@ func TestFetchKeyPairs(t *testing.T) { ctx := setupIntegrationTest(t) resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.KeyPair") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.KeyPair", - Region: defaultRegion, + Type: "ec2.KeyPair", + Region: defaultRegion, + DisplayIdPrefix: "key-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -116,8 +121,9 @@ func TestFetchLaunchTemplates(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 2) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.LaunchTemplate", - Region: defaultRegion, + Type: "ec2.LaunchTemplate", + Region: defaultRegion, + DisplayIdPrefix: "lt-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -134,8 +140,9 @@ func TestFetchNatGateways(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.NatGateway") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.NatGateway", - Region: defaultRegion, + Type: "ec2.NatGateway", + Region: defaultRegion, + DisplayIdPrefix: "nat-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -152,8 +159,9 @@ func TestFetchNetworkAcl(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.NetworkAcl") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.NetworkAcl", - Region: defaultRegion, + Type: "ec2.NetworkAcl", + Region: defaultRegion, + DisplayIdPrefix: "acl-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -170,8 +178,9 @@ func TestFetchNetworkInterface(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.NetworkInterface") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.NetworkInterface", - Region: defaultRegion, + Type: "ec2.NetworkInterface", + Region: defaultRegion, + DisplayIdPrefix: "eni-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -188,8 +197,9 @@ func TestFetchRouteTable(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.RouteTable") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.RouteTable", - Region: defaultRegion, + Type: "ec2.RouteTable", + Region: defaultRegion, + DisplayIdPrefix: "rtb-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -206,8 +216,9 @@ func TestFetchSecurityGroups(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.SecurityGroup") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.SecurityGroup", - Region: defaultRegion, + Type: "ec2.SecurityGroup", + Region: defaultRegion, + DisplayIdPrefix: "sg-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -224,8 +235,9 @@ func TestFetchSnapshots(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.Snapshot") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Snapshot", - Region: defaultRegion, + Type: "ec2.Snapshot", + Region: defaultRegion, + DisplayIdPrefix: "snap-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -242,8 +254,9 @@ func TestFetchSubnets(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.Subnet") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Subnet", - Region: defaultRegion, + Type: "ec2.Subnet", + Region: defaultRegion, + DisplayIdPrefix: "subnet-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -260,8 +273,9 @@ func TestFetchVpcs(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "ec2.Vpc") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "ec2.Vpc", - Region: defaultRegion, + Type: "ec2.Vpc", + Region: defaultRegion, + DisplayIdPrefix: "vpc-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/eks.go b/pkg/provider/aws/eks.go index 8173abc2..6f9f19a0 100644 --- a/pkg/provider/aws/eks.go +++ b/pkg/provider/aws/eks.go @@ -13,14 +13,16 @@ import ( func (p *Provider) register_eks(mapping map[string]mapper) { mapping["eks.Cluster"] = mapper{ - FetchFunc: p.fetch_eks_Cluster, - IdField: "Arn", - IsGlobal: false, + FetchFunc: p.fetch_eks_Cluster, + IdField: "Arn", + DisplayIDField: "Name", + IsGlobal: false, } mapping["eks.Nodegroup"] = mapper{ - FetchFunc: p.fetch_eks_Nodegroup, - IdField: "NodegroupArn", - IsGlobal: false, + FetchFunc: p.fetch_eks_Nodegroup, + IdField: "NodegroupArn", + DisplayIDField: "NodegroupName", + IsGlobal: false, } } diff --git a/pkg/provider/aws/eks_test.go b/pkg/provider/aws/eks_test.go index b51f8864..be89004d 100644 --- a/pkg/provider/aws/eks_test.go +++ b/pkg/provider/aws/eks_test.go @@ -17,8 +17,9 @@ func TestFetchEKSClusters(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 1) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "eks.Cluster", - Region: defaultRegion, + Type: "eks.Cluster", + Region: defaultRegion, + DisplayIdPrefix: "main", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -37,8 +38,9 @@ func TestFetchEKSNodegroup(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 1) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "eks.Nodegroup", - Region: defaultRegion, + Type: "eks.Nodegroup", + Region: defaultRegion, + DisplayIdPrefix: "main-default-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/elasticache_test.go b/pkg/provider/aws/elasticache_test.go index 2b48d82c..59f4f72b 100644 --- a/pkg/provider/aws/elasticache_test.go +++ b/pkg/provider/aws/elasticache_test.go @@ -17,8 +17,9 @@ func TestFetchElasticacheClusters(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 1) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "elasticache.CacheCluster", - Region: defaultRegion, + Type: "elasticache.CacheCluster", + Region: defaultRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/iam.go b/pkg/provider/aws/iam.go index 2b808049..4e779f8f 100644 --- a/pkg/provider/aws/iam.go +++ b/pkg/provider/aws/iam.go @@ -15,18 +15,21 @@ func (p *Provider) register_iam_manual(mapping map[string]mapper) { ServiceEndpointID: "iam", FetchFunc: p.fetch_iam_User, IdField: "Arn", + DisplayIDField: "UserName", IsGlobal: true, } mapping["iam.InstanceProfile"] = mapper{ ServiceEndpointID: "iam", FetchFunc: p.fetch_iam_InstanceProfile, IdField: "Arn", + DisplayIDField: "InstanceProfileName", IsGlobal: true, } mapping["iam.Role"] = mapper{ ServiceEndpointID: "iam", FetchFunc: p.fetch_iam_Role, IdField: "Arn", + DisplayIDField: "RoleName", IsGlobal: true, } } diff --git a/pkg/provider/aws/iam_test.go b/pkg/provider/aws/iam_test.go index 30a3d6d3..6ab80dc5 100644 --- a/pkg/provider/aws/iam_test.go +++ b/pkg/provider/aws/iam_test.go @@ -18,8 +18,9 @@ func TestFetchInstanceProfiles(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "iam.InstanceProfile") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "iam.InstanceProfile", - Region: globalRegion, + Type: "iam.InstanceProfile", + Region: globalRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -40,8 +41,9 @@ func TestFetchOpenIDConnectProviders(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "iam.OpenIDConnectProvider") resources = testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "iam.OpenIDConnectProvider", - Region: globalRegion, + Type: "iam.OpenIDConnectProvider", + Region: globalRegion, + DisplayIdPrefix: "oidc.eks.", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -90,8 +92,9 @@ func TestFetchRoles(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "iam.Role") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "iam.Role", - Region: globalRegion, + Type: "iam.Role", + Region: globalRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -112,8 +115,9 @@ func TestFetchUsers(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "iam.User") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "iam.User", - Region: globalRegion, + Type: "iam.User", + Region: globalRegion, + DisplayIdPrefix: "test-0", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -134,8 +138,9 @@ func TestFetchVirtualMFADevices(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "iam.VirtualMFADevice") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "iam.VirtualMFADevice", - Region: globalRegion, + Type: "iam.VirtualMFADevice", + Region: globalRegion, + DisplayIdPrefix: "test/test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/rds_test.go b/pkg/provider/aws/rds_test.go index fa6a3531..968348d4 100644 --- a/pkg/provider/aws/rds_test.go +++ b/pkg/provider/aws/rds_test.go @@ -16,8 +16,9 @@ func TestFetchRDSInstances(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "rds.DBInstance") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "rds.DBInstance", - Region: defaultRegion, + Type: "rds.DBInstance", + Region: defaultRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -39,8 +40,9 @@ func TestFetchRDSClusters(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "rds.DBCluster") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "rds.DBCluster", - Region: defaultRegion, + Type: "rds.DBCluster", + Region: defaultRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -61,8 +63,9 @@ func TestFetchRDSClusterSnapshots(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "rds.DBClusterSnapshot") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "rds.DBClusterSnapshot", - Region: defaultRegion, + Type: "rds.DBClusterSnapshot", + Region: defaultRegion, + DisplayIdPrefix: "test-cluster-0-", Tags: model.Tags{ { Key: testingutil.TestTag, @@ -80,8 +83,9 @@ func TestFetchRDSSnapshots(t *testing.T) { resources := testprovider.FetchResources(ctx.ctx, t, ctx.p, "rds.DBSnapshot") testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "rds.DBSnapshot", - Region: defaultRegion, + Type: "rds.DBSnapshot", + Region: defaultRegion, + DisplayIdPrefix: "test-0-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/s3_test.go b/pkg/provider/aws/s3_test.go index ad06f41e..b16b1948 100644 --- a/pkg/provider/aws/s3_test.go +++ b/pkg/provider/aws/s3_test.go @@ -17,8 +17,9 @@ func TestFetchS3Buckets(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 2) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "s3.Bucket", - Region: "global", + Type: "s3.Bucket", + Region: "global", + DisplayIdPrefix: "cloudgrep-testing-0-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/sns_test.go b/pkg/provider/aws/sns_test.go index 70e800fa..e5ee0338 100644 --- a/pkg/provider/aws/sns_test.go +++ b/pkg/provider/aws/sns_test.go @@ -17,8 +17,9 @@ func TestFetchSnsTopic(t *testing.T) { testingutil.AssertResourceCount(t, resources, "", 1) testingutil.AssertResourceFilteredCount(t, resources, 1, testingutil.ResourceFilter{ - Type: "sns.Topic", - Region: defaultRegion, + Type: "sns.Topic", + Region: defaultRegion, + DisplayIdPrefix: "testing-", Tags: model.Tags{ { Key: testingutil.TestTag, diff --git a/pkg/provider/aws/zz_elasticache.go b/pkg/provider/aws/zz_elasticache.go index 2f8b934b..16fa0ad9 100755 --- a/pkg/provider/aws/zz_elasticache.go +++ b/pkg/provider/aws/zz_elasticache.go @@ -27,6 +27,7 @@ func (p *Provider) fetchElasticacheCacheCluster(ctx context.Context, output chan resourceConverter := p.converterFor("elasticache.CacheCluster") var transformers resourceconverter.Transformers[types.CacheCluster] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsElasticacheCacheCluster)) + transformers.AddResource(displayIdArnPrefix("cluster:")) paginator := elasticache.NewDescribeCacheClustersPaginator(client, input) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) diff --git a/pkg/provider/aws/zz_elb.go b/pkg/provider/aws/zz_elb.go index 507c9c41..10213758 100755 --- a/pkg/provider/aws/zz_elb.go +++ b/pkg/provider/aws/zz_elb.go @@ -16,6 +16,7 @@ func (p *Provider) registerElb(mapping map[string]mapper) { ServiceEndpointID: "elasticloadbalancing", FetchFunc: p.fetchElbLoadBalancer, IdField: "LoadBalancerArn", + DisplayIDField: "LoadBalancerName", IsGlobal: false, } } diff --git a/pkg/provider/aws/zz_iam.go b/pkg/provider/aws/zz_iam.go index 417de8a4..b2663dd3 100755 --- a/pkg/provider/aws/zz_iam.go +++ b/pkg/provider/aws/zz_iam.go @@ -46,6 +46,7 @@ func (p *Provider) fetchIamOpenIDConnectProvider(ctx context.Context, output cha resourceConverter := p.converterFor("iam.OpenIDConnectProvider") var transformers resourceconverter.Transformers[types.OpenIDConnectProviderListEntry] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsIamOpenIDConnectProvider)) + transformers.AddResource(displayIdArnPrefix("oidc-provider/")) results, err := client.ListOpenIDConnectProviders(ctx, input) if err != nil { return fmt.Errorf("failed to fetch %s: %w", "iam.OpenIDConnectProvider", err) @@ -134,6 +135,7 @@ func (p *Provider) fetchIamSAMLProvider(ctx context.Context, output chan<- model resourceConverter := p.converterFor("iam.SAMLProvider") var transformers resourceconverter.Transformers[types.SAMLProviderListEntry] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsIamSAMLProvider)) + transformers.AddResource(displayIdArnPrefix("saml-provider/")) results, err := client.ListSAMLProviders(ctx, input) if err != nil { return fmt.Errorf("failed to fetch %s: %w", "iam.SAMLProvider", err) @@ -175,6 +177,7 @@ func (p *Provider) fetchIamVirtualMFADevice(ctx context.Context, output chan<- m resourceConverter := p.converterFor("iam.VirtualMFADevice") var transformers resourceconverter.Transformers[types.VirtualMFADevice] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsIamVirtualMFADevice)) + transformers.AddResource(displayIdArnPrefix("mfa/")) paginator := iam.NewListVirtualMFADevicesPaginator(client, input) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) diff --git a/pkg/provider/aws/zz_lambda.go b/pkg/provider/aws/zz_lambda.go index 2512e750..84d3b989 100755 --- a/pkg/provider/aws/zz_lambda.go +++ b/pkg/provider/aws/zz_lambda.go @@ -16,6 +16,7 @@ func (p *Provider) registerLambda(mapping map[string]mapper) { ServiceEndpointID: "lambda", FetchFunc: p.fetchLambdaFunction, IdField: "FunctionArn", + DisplayIDField: "FunctionName", IsGlobal: false, } } @@ -27,7 +28,6 @@ func (p *Provider) fetchLambdaFunction(ctx context.Context, output chan<- model. resourceConverter := p.converterFor("lambda.Function") var transformers resourceconverter.Transformers[types.FunctionConfiguration] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsLambdaFunction)) - transformers.AddResource(displayIdArnPrefix("function:")) paginator := lambda.NewListFunctionsPaginator(client, input) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx) diff --git a/pkg/provider/aws/zz_sns.go b/pkg/provider/aws/zz_sns.go index 3944bf46..58e55cd8 100755 --- a/pkg/provider/aws/zz_sns.go +++ b/pkg/provider/aws/zz_sns.go @@ -27,6 +27,7 @@ func (p *Provider) fetchSnsTopic(ctx context.Context, output chan<- model.Resour resourceConverter := p.converterFor("sns.Topic") var transformers resourceconverter.Transformers[types.Topic] transformers.AddNamed("tags", resourceconverter.TagTransformer(p.getTagsSnsTopic)) + transformers.AddResource(displayIdArn) paginator := sns.NewListTopicsPaginator(client, input) for paginator.HasMorePages() { page, err := paginator.NextPage(ctx)