Skip to content

Commit

Permalink
🧹 ensure we grab the tags for the ssm instance during discovery (#3376)
Browse files Browse the repository at this point in the history
since tags is noted as an optional field, tags(), on ssm instances,
we have to call get to actually fetch them
  • Loading branch information
vjeffrey authored Feb 21, 2024
1 parent 1cab39c commit d7cff22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/aws/resources/discovery_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func getInstanceName(id string, labels map[string]string) string {

func addConnectionInfoToSSMAsset(instance *mqlAwsSsmInstance, accountId string, conn *connection.AwsConnection) *inventory.Asset {
asset := &inventory.Asset{}
asset.Labels = mapStringInterfaceToStringString(instance.Tags.Data)
asset.Labels = mapStringInterfaceToStringString(instance.GetTags().Data)
asset.Labels["mondoo.com/platform"] = instance.PlatformName.Data
asset.Labels["mondoo.com/region"] = instance.Region.Data

Expand Down Expand Up @@ -378,7 +378,7 @@ func addConnectionInfoToSSMAsset(instance *mqlAwsSsmInstance, accountId string,
log.Warn().Str("asset", asset.Name).Str("id", instance.InstanceId.Data).Msg("cannot use ssm session credentials for connection")
asset = MqlObjectToAsset(accountId,
mqlObject{
name: asset.Name, labels: mapStringInterfaceToStringString(instance.Tags.Data),
name: asset.Name, labels: asset.Labels,
awsObject: awsObject{
account: accountId, region: instance.Region.Data, arn: instance.Arn.Data,
id: instance.InstanceId.Data, service: "ssm", objectType: "instance",
Expand Down

0 comments on commit d7cff22

Please sign in to comment.