Skip to content

Set-LMAWSDiscoverySettings

Terminal window
Set-LMAWSDiscoverySettings -AccountId <Int32> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>]
[-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Terminal window
Set-LMAWSDiscoverySettings -Name <String> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>]
[-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Terminal window
Set-LMAWSDiscoverySettings -CsvPath <String> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>]
[-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]

The Set-LMAWSDiscoverySettings function modifies AWS Cloud discovery settings such as monitored regions, automatic deletion policies, and alerting preferences for AWS services within LogicMonitor. The function supports updating a single AWS account by AccountId or multiple accounts by importing AccountIds from a CSV file.

Terminal window
Set-LMAWSDiscoverySettings -AccountId 317 -ServiceName "EC2" -Regions "us-east-1","us-west-2"
Updates EC2 discovery settings for AWS account group ID 317 to monitor only us-east-1 and us-west-2 regions.
Terminal window
Set-LMAWSDiscoverySettings -Name "Production AWS Account" -ServiceName "RDS" -Regions "us-east-1","us-east-2" -AutoDelete -DeleteDelayDays 10
Updates RDS discovery settings for the AWS account named "Production AWS Account" with automatic deletion enabled after 10 days.
Terminal window
Set-LMAWSDiscoverySettings -CsvPath "C:\aws_accounts.csv" -ServiceName "EC2" -Regions "us-east-1","us-east-2"
Bulk updates EC2 discovery settings for multiple AWS accounts listed in the CSV file.
Terminal window
Set-LMAWSDiscoverySettings -AccountId 317 -ServiceName "Lambda" -Regions "us-east-1" -AutoDelete -DeleteDelayDays 5 -DisableAlerting
Updates Lambda discovery settings with automatic deletion after 5 days and alerting disabled on termination.

Specifies the LogicMonitor device group ID of the AWS account for which to update discovery settings. This parameter is mandatory when using the ‘Id’ parameter set.

Type: Int32
Parameter Sets: Id
Aliases: Id
Required: True
Position: Named
Default value: 0
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

Specifies the name of the AWS account device group. This parameter is mandatory when using the ‘Name’ parameter set.

Type: String
Parameter Sets: Name
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies the path to a CSV file containing multiple AWS AccountIds to update in bulk. The CSV must have an “AccountId” column. This parameter is part of the ‘Csv’ parameter set.

Type: String
Parameter Sets: Csv
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies the AWS service name (e.g., “EC2”, “RDS”, “Lambda”) whose discovery settings are to be updated.

Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies an array of AWS regions (e.g., “us-east-1”,“us-east-2”) to monitor for the specified service.

Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies whether to enable automatic deletion of terminated AWS resources.

Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies the number of days to wait before automatically deleting terminated resources. Defaults to 7.

Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Specifies whether to disable alerting automatically after resource termination.

Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

You can pipe objects containing AccountId properties to this function.

Section titled “You can pipe objects containing AccountId properties to this function.”

Returns a LogicMonitor.DeviceGroup object containing the updated AWS account group information.

Section titled “Returns a LogicMonitor.DeviceGroup object containing the updated AWS account group information.”

This function requires a valid LogicMonitor API authentication. Use Connect-LMAccount before running this command.