@@ -52,6 +52,7 @@ func makeTestInstance(launchTime *time.Time) *ec2beat.Ec2Instance {
5252 {Key : pointers .Ref ("key" ), Value : pointers .Ref ("value" )},
5353 {Key : pointers .Ref ("Owner" ), Value : pointers .Ref ("team-infra" )},
5454 {Key : pointers .Ref ("CostCenter" ), Value : pointers .Ref ("cc-1234" )},
55+ {Key : pointers .Ref ("Role" ), Value : pointers .Ref ("sre" )},
5556 },
5657 InstanceId : pointers .Ref ("234567890" ),
5758 Architecture : ec2types .ArchitectureValuesX8664 ,
@@ -104,7 +105,7 @@ func TestEC2InstanceFetcher_Fetch(t *testing.T) {
104105 "private-dns" ,
105106 inventory .WithRelatedAssetIds ([]string {"234567890" }),
106107 inventory .WithRawAsset (instance1 ),
107- inventory .WithLabels (map [string ]string {"Name" : "test-server" , "key" : "value" , "Owner" : "team-infra" , "CostCenter" : "cc-1234" }),
108+ inventory .WithLabels (map [string ]string {"Name" : "test-server" , "key" : "value" , "Owner" : "team-infra" , "CostCenter" : "cc-1234" , "Role" : "sre" }),
108109 inventory .WithCloud (inventory.Cloud {
109110 Provider : inventory .AwsCloudProvider ,
110111 Region : "us-east" ,
@@ -134,6 +135,7 @@ func TestEC2InstanceFetcher_Fetch(t *testing.T) {
134135 "RoleArn" : testRoleArn ,
135136 "Owner" : "team-infra" ,
136137 "CostCenter" : "cc-1234" ,
138+ "Role" : "sre" ,
137139 }),
138140 inventory .WithCreatedAt (& launchTime ),
139141 inventory .WithUser (inventory.User {
@@ -193,7 +195,7 @@ func TestEC2InstanceFetcher_Fetch_ResolverError(t *testing.T) {
193195 "private-dns" ,
194196 inventory .WithRelatedAssetIds ([]string {"234567890" }),
195197 inventory .WithRawAsset (instance ),
196- inventory .WithLabels (map [string ]string {"Name" : "test-server" , "key" : "value" , "Owner" : "team-infra" , "CostCenter" : "cc-1234" }),
198+ inventory .WithLabels (map [string ]string {"Name" : "test-server" , "key" : "value" , "Owner" : "team-infra" , "CostCenter" : "cc-1234" , "Role" : "sre" }),
197199 inventory .WithCloud (inventory.Cloud {
198200 Provider : inventory .AwsCloudProvider ,
199201 Region : "us-east" ,
@@ -223,6 +225,7 @@ func TestEC2InstanceFetcher_Fetch_ResolverError(t *testing.T) {
223225 // RoleArn is absent because the resolver failed.
224226 "Owner" : "team-infra" ,
225227 "CostCenter" : "cc-1234" ,
228+ "Role" : "sre" ,
226229 }),
227230 inventory .WithCreatedAt (& launchTime ),
228231 // WithUser falls back to the profile ARN when role resolution fails.
0 commit comments