Set-LMAWSDiscoverySettings
Syntax
Section titled “Syntax”Id (Default)
Section titled “Id (Default)”Set-LMAWSDiscoverySettings -AccountId <Int32> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>] [-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Set-LMAWSDiscoverySettings -Name <String> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>] [-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Set-LMAWSDiscoverySettings -CsvPath <String> -ServiceName <String> -Regions <String[]> [-AutoDelete <Boolean>] [-DeleteDelayDays <Int32>] [-DisableAlerting <Boolean>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Section titled “Description”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.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”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.Example 2
Section titled “Example 2”Set-LMAWSDiscoverySettings -Name "Production AWS Account" -ServiceName "RDS" -Regions "us-east-1","us-east-2" -AutoDelete -DeleteDelayDays 10Updates RDS discovery settings for the AWS account named "Production AWS Account" with automatic deletion enabled after 10 days.Example 3
Section titled “Example 3”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.Example 4
Section titled “Example 4”Set-LMAWSDiscoverySettings -AccountId 317 -ServiceName "Lambda" -Regions "us-east-1" -AutoDelete -DeleteDelayDays 5 -DisableAlertingUpdates Lambda discovery settings with automatic deletion after 5 days and alerting disabled on termination.Parameters
Section titled “Parameters”-AccountId
Section titled “-AccountId”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: Int32Parameter Sets: IdAliases: Id
Required: TruePosition: NamedDefault value: 0Accept pipeline input: True (ByPropertyName)Accept wildcard characters: FalseSpecifies the name of the AWS account device group. This parameter is mandatory when using the ‘Name’ parameter set.
Type: StringParameter Sets: NameAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-CsvPath
Section titled “-CsvPath”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: StringParameter Sets: CsvAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ServiceName
Section titled “-ServiceName”Specifies the AWS service name (e.g., “EC2”, “RDS”, “Lambda”) whose discovery settings are to be updated.
Type: StringParameter Sets: (All)Aliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Regions
Section titled “-Regions”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: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-AutoDelete
Section titled “-AutoDelete”Specifies whether to enable automatic deletion of terminated AWS resources.
Type: BooleanParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-DeleteDelayDays
Section titled “-DeleteDelayDays”Specifies the number of days to wait before automatically deleting terminated resources. Defaults to 7.
Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-DisableAlerting
Section titled “-DisableAlerting”Specifies whether to disable alerting automatically after resource termination.
Type: BooleanParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-WhatIf
Section titled “-WhatIf”Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameterParameter Sets: (All)Aliases: wi
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Confirm
Section titled “-Confirm”Prompts you for confirmation before running the cmdlet.
Type: SwitchParameterParameter Sets: (All)Aliases: cf
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Section titled “Inputs”You can pipe objects containing AccountId properties to this function.
Section titled “You can pipe objects containing AccountId properties to this function.”Outputs
Section titled “Outputs”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.