diff --git a/pkg/config/services.go b/pkg/config/services.go index 3b5d14c30..73da05e85 100644 --- a/pkg/config/services.go +++ b/pkg/config/services.go @@ -1022,10 +1022,10 @@ var SupportedServices = serviceConfigs{ Namespace: "AWS/IPAM", Alias: "ipam", ResourceFilters: []*string{ - aws.String("ec2:ipam-pool"), + aws.String("ec2:ipam"), }, DimensionRegexps: []*regexp.Regexp{ - regexp.MustCompile(":ipam-pool/(?P[^/]+)$"), + regexp.MustCompile(":ipam/(?P[^/]+)$"), }, }, { diff --git a/pkg/job/maxdimassociator/associator_ipam_test.go b/pkg/job/maxdimassociator/associator_ipam_test.go index eaed6c8e2..bb874d55a 100644 --- a/pkg/job/maxdimassociator/associator_ipam_test.go +++ b/pkg/job/maxdimassociator/associator_ipam_test.go @@ -22,13 +22,13 @@ import ( "github.com/prometheus-community/yet-another-cloudwatch-exporter/pkg/model" ) -var ec2IpamPool = &model.TaggedResource{ - ARN: "arn:aws:ec2::123456789012:ipam-pool/ipam-pool-1ff5e4e9ad2c28b7b", +var ec2Ipam = &model.TaggedResource{ + ARN: "arn:aws:ec2::123456789012:ipam/ipam-1ff5e4e9ad2c28b7b", Namespace: "AWS/IPAM", } var ipamResources = []*model.TaggedResource{ - ec2IpamPool, + ec2Ipam, } func TestAssociatorIpam(t *testing.T) { @@ -47,7 +47,7 @@ func TestAssociatorIpam(t *testing.T) { testcases := []testCase{ { - name: "should match with IpamPoolId dimension", + name: "should match with IpamId dimension", args: args{ dimensionRegexps: config.SupportedServices.GetService("AWS/IPAM").ToModelDimensionsRegexp(), resources: ipamResources, @@ -55,15 +55,15 @@ func TestAssociatorIpam(t *testing.T) { MetricName: "VpcIPUsage", Namespace: "AWS/IPAM", Dimensions: []model.Dimension{ - {Name: "IpamPoolId", Value: "ipam-pool-1ff5e4e9ad2c28b7b"}, + {Name: "IpamId", Value: "ipam-1ff5e4e9ad2c28b7b"}, }, }, }, expectedSkip: false, - expectedResource: ec2IpamPool, + expectedResource: ec2Ipam, }, { - name: "should skip with unmatched IpamPoolId dimension", + name: "should skip with unmatched IpamId dimension", args: args{ dimensionRegexps: config.SupportedServices.GetService("AWS/IPAM").ToModelDimensionsRegexp(), resources: ipamResources, @@ -71,7 +71,7 @@ func TestAssociatorIpam(t *testing.T) { MetricName: "VpcIPUsage", Namespace: "AWS/IPAM", Dimensions: []model.Dimension{ - {Name: "IpamPoolId", Value: "ipam-pool-blahblah"}, + {Name: "IpamId", Value: "ipam-blahblah"}, }, }, },