Update-RedgateMonitorMonitoredObjectCredential
Published 20 October 2025
Updates the credentials for the given monitored object in Redgate Monitor.
Syntax
Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -SqlServerUserId <string> -SqlServerPassword <string> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -Implicit [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -Inherit [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -WindowsUserName <string> -WindowsPassword <string> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -SshUserName <string> -SshPrivateKey <SshPrivateKey> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -SshUserName <string> -SshPassword <string> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraUserName <string> -MicrosoftEntraPassword <string> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraIntegrated [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -PostgresCertificate -PostgresUserId <string> [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraManagedIdentity -PostgresUserId <string> [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraSystemAssignedManagedIdentity [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraUserAssignedManagedIdentity <string> [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -MicrosoftEntraServicePrincipalCredential <ServicePrincipalCredential> [-PostgresUserId <string>] [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -AmazonAwsIamUserAccessKey <string> -AmazonAwsIamUserSecretKey <string> [-AmazonAwsRegionName <string>] [-AmazonAwsDbIdentifier <string>] [-PostgresUserId <string>] [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -AmazonAwsIamInstanceProfile [-AmazonAwsRegionName <string>] [-AmazonAwsDbIdentifier <string>] [-PostgresUserId <string>] [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -AmazonAwsIamRole <string> [-AmazonAwsRegionName <string>] [-AmazonAwsDbIdentifier <string>] [-PostgresUserId <string>] [-PostgresDatabase <string>] [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -Disable [<CommonParameters>] Update-RedgateMonitorMonitoredObjectCredential -MonitoredObject <MonitoredObject> -PostgresUserId <string> -PostgresPassword <string> [-PostgresDatabase <string>] [<CommonParameters>]
Description
Updates the credentials for the given monitored object in Redgate Monitor. Note that not all parameters are relevant to all types of Monitored Object. For example, you can't use -SshUserName and -SshPassword for a SQL Server instance. Doing so will result in a validation error.
Parameters
-MonitoredObject
<MonitoredObject>
The MonitoredObject whose credentials should be updated. The additional parameters specified for the credentials must be appropriate for the type of MonitoredObject.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | True (ByValue) |
| Accept Wildcard Characters | false |
-SqlServerUserId
<String>
Specify with -SqlServerPassword to configure SQL Server basic authentication for a SQL Server instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-SqlServerPassword
<String>
Specify with -SqlServerUserId to configure SQL Server basic authentication for a SQL Server instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-Implicit
<SwitchParameter>
Specify to use the Base Monitor Service credentials to connect to a SQL Server instance hosted on Linux or in Amazon RDS, or a Windows Cluster.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-Inherit
<SwitchParameter>
Specify to inherit the credentials of the associated Cluster to connect to a SQL Server instance in a Windows Cluster.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-WindowsUserName
<String>
Specify with -WindowsPassword to configure Windows user authentication for a SQL Server instance hosted on Windows, Linux or Amazon RDS, or for a Windows Cluster or Standalone machine.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-WindowsPassword
<String>
Specify with -WindowsUserName to configure Windows user authentication for a SQL Server instance hosted on Windows, Linux or Amazon RDS, or for a Windows Cluster or Standalone machine.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-SshUserName
<String>
Specify with -SshPassword or -SshPrivateKey to configure an SSH connection to a Linux machine.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-SshPassword
<String>
Specify with -SshUserName to configure an SSH connection to a Linux machine.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-SshPrivateKey
<SshPrivateKey>
Specify with -SshUserName to configure an SSH connection to a Linux machine. A private key can be retrieved via Get-RedgateMonitorSshPrivateKey.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraUserName
<String>
Specify with -MicrosoftEntraPassword to configure Microsoft Entra user authentication for an Azure SQL Database server or Azure SQL Managed Instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraPassword
<String>
Specify with -MicrosoftEntraUserName to configure Microsoft Entra user authentication for an Azure SQL Database server or Azure SQL Managed Instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraIntegrated
<SwitchParameter>
Specify to use Microsoft Entra Integrated authentication for an Azure SQL Database server or Azure SQL Managed Instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-PostgresCertificate
<SwitchParameter>
Specify to use SSL certificate authentication for a Postgres instance running on a Linux machine.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraManagedIdentity
<SwitchParameter>
Specify to use a Microsoft Entra Managed Identity for a Postgres instance running on an Azure Flex host.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraSystemAssignedManagedIdentity
<SwitchParameter>
Specify to use a system-assigned Microsoft Entra Managed Identity for an Azure SQL Database server, Azure SQL Managed Instance, or Azure Flex host.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraUserAssignedManagedIdentity
<String>
Specify to use a user-assigned Microsoft Entra Managed Identity for an Azure SQL Database server or Azure SQL Managed Instance. The value should be the user-assigned Client or App ID.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-MicrosoftEntraServicePrincipalCredential
<ServicePrincipalCredential>
Specify to use Microsoft Entra Service Principal authentication for an Azure Flex host or a Postgres instance running on an Azure Flex host. A service principal can be retrieved via Get-RedgateMonitorServicePrincipalCredential.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsIamUserAccessKey
<String>
Specify with -AmazonAwsIamUserSecretKey to use Amazon AWS IAM User authentication for an Amazon RDS SQL Server instance, an Amazon RDS host, or a Postgres instance running on an Amazon RDS host.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsIamUserSecretKey
<String>
Specify with -AmazonAwsIamUserAccessKey to use Amazon AWS IAM User authentication for an Amazon RDS SQL Server instance, an Amazon RDS host, or a Postgres instance running on an Amazon RDS host.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsIamInstanceProfile
<SwitchParameter>
Specify to use Amazon AWS IAM instance profile authentication for an Amazon RDS SQL Server instance, an Amazon RDS host, or a Postgres instance running on an Amazon RDS host.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsIamRole
<String>
Specify to use Amazon AWS IAM Role authentication for an Amazon RDS SQL Server instance, an Amazon RDS host, or a Postgres instance running on an Amazon RDS host. The value should be the Amazon Resource Name (ARN) of the role.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsRegionName
<String>
Optionally specify with -AmazonAwsIamUserAccessKey and -AmazonAwsIamUserSecretKey, -AmazonAwsIamInstanceProfile, or -AmazonAwsIamRole, in order to configure the AWS region of the server or host being updated. This parameter is optional and is only needed if the region cannot be automatically inferred from the MonitoredObject's hostname, or to modify a previously assigned value.
| Aliases | None |
| Required? | false |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AmazonAwsDbIdentifier
<String>
Optionally specify with -AmazonAwsIamUserAccessKey and -AmazonAwsIamUserSecretKey, -AmazonAwsIamInstanceProfile, or -AmazonAwsIamRole, in order to configure the DB Instance name (the dbInstanceIdentifier) of a server or its host being updated. This parameter is optional and is only needed if the value cannot be automatically inferred from the MonitoredObject's hostname, or to modify a previously assigned value.
| Aliases | None |
| Required? | false |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-Disable
<SwitchParameter>
Specify to disable monitoring for an Azure Flex host, an Amazon RDS host, or an Amazon RDS SQL Server instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | False |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-PostgresUserId
<String>
Specify with -PostgresPassword, -PostgresCertificate, -MicrosoftEntraServicePrincipalCredential, -MicrosoftEntraSystemAssignedManagedIdentity, -AmazonAwsIamUserAccessKey and -AmazonAwsIamUserSecretKey, -AmazonAwsIamInstanceProfile or -AmazonAwsIamRole to indicate the Postgres username used to connect to a Postgres instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-PostgresPassword
<String>
Specify with -PostgresUserId to use basic username and password authentication to connect to a Postgres instance.
| Aliases | None |
| Required? | true |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-PostgresDatabase
<String>
Specify with -PostgresUserId to indicate the initial database when connecting to a Postgres instance.
| Aliases | None |
| Required? | false |
| Position? | named |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, and -ProgressAction. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
None.
You cannot pipe input to this cmdlet.
Examples
-------------------------- EXAMPLE 1 --------------------------
$sqlServer = Get-RedgateMonitorMonitoredObject -Type SqlServerInstance -Name 'exampleserver.exampledomain.local' $sqlServer | Update-RedgateMonitorMonitoredObjectCredential -SqlServerUserId 'sql_user' -SqlServerPassword 'sql_pass'
This script fetches a SQL Server instance and updates it to use SQL Server username and password authentication.
-------------------------- EXAMPLE 2 --------------------------
$cluster = Get-RedgateMonitorMonitoredObject -Type Cluster -Name 'examplecluster.exampledomain.local' $cluster | Update-RedgateMonitorMonitoredObjectCredential -Implicit
This script fetches a Windows Cluster and updates it to use the implicit credentials of the Base Monitor.
-------------------------- EXAMPLE 3 --------------------------
$sqlServer = Get-RedgateMonitorMonitoredObject -Type SqlServerInstance -Name 'uswest01prodA' $sqlServer | Update-RedgateMonitorMonitoredObjectCredential -Inherit
This script fetches a SQL Server instance and updates it to inherit the credentials of its associated Cluster.
-------------------------- EXAMPLE 4 --------------------------
$cluster = Get-RedgateMonitorMonitoredObject -Type Cluster -Name 'examplecluster.exampledomain.local' $cluster | Update-RedgateMonitorMonitoredObjectCredential -WindowsUserName 'monitoring.account@mydomain.local' -WindowsPassword 'super-secret'
This script fetches a Windows Cluster and updates it to use the specified Windows username and password.
-------------------------- EXAMPLE 5 --------------------------
$linuxMachine = Get-RedgateMonitorMonitoredObject -Type Machine -Name 'mylinuxhost.mydomain.local' $linuxMachine | Update-RedgateMonitorMonitoredObjectCredential -SshUserName 'ssh_user' -SshPassword 'ssh_pass'
This script fetches a Linux machine and updates it to use the specified SSH user and password.
-------------------------- EXAMPLE 6 --------------------------
$sshPrivateKey = Get-RedgateMonitorSshPrivateKey -Name 'mylinuxhost key' $linuxMachine = Get-RedgateMonitorMonitoredObject -Type Machine -Name 'mylinuxhost.mydomain.local' $linuxMachine | Update-RedgateMonitorMonitoredObjectCredential -SshUserName 'ssh_user' -SshPrivateKey $sshPrivateKey
This script fetches a Linux machine and updates it to use the specified SSH user and private key.
-------------------------- EXAMPLE 7 --------------------------
$azureSqlServer = Get-RedgateMonitorMonitoredObject -Type AzureSqlServer -Name 'exampleserver.database.windows.net' $azureSqlServer | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraUserName 'sql_user' -MicrosoftEntraPassword 'sql_pass'
This script fetches an Azure SQL Database server and updates it to use the specified Microsoft Entra username and password.
-------------------------- EXAMPLE 8 --------------------------
$azureSqlServer = Get-RedgateMonitorMonitoredObject -Type AzureSqlServer -Name 'exampleserver.database.windows.net' $azureSqlServer | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraIntegrated
This script fetches an Azure SQL Database server and updates it to use Microsoft Entra integrated authentication.
-------------------------- EXAMPLE 9 --------------------------
$azureSqlServer = Get-RedgateMonitorMonitoredObject -Type AzureSqlServer -Name 'exampleserver.database.windows.net' $azureSqlServer | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraSystemAssignedManagedIdentity
This script fetches an Azure SQL Database server and updates it to use a system-assigned Microsoft Entra Managed Identity.
-------------------------- EXAMPLE 10 --------------------------
$azureSqlServer = Get-RedgateMonitorMonitoredObject -Type AzureSqlServer -Name 'exampleserver.database.windows.net' $azureSqlServer | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraUserAssignedManagedIdentity 'my-client-id'
This script fetches an Azure SQL Database server and updates it to use a user-assigned Microsoft Entra Managed Identity.
-------------------------- EXAMPLE 11 --------------------------
$servicePrincipal = Get-RedgateMonitorServicePrincipalCredential -Name 'example-service-principal' $azureFlexHost = Get-RedgateMonitorMonitoredObject -Type AzureFlexHost -Name 'exampleflexhost.database.windows.net' $azureFlexHost | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraServicePrincipalCredential $servicePrincipal
This script fetches an Azure Flex host and updates it to use a specified Microsoft Entra Service Principal.
-------------------------- EXAMPLE 12 --------------------------
$amazonRdsSqlServer = Get-RedgateMonitorMonitoredObject -Name 'examplesqlserver.xxxxxxxxxxxx.us-west-1.rds.amazonaws.com' $amazonRdsSqlServer | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamUserAccessKey 'EXAMPLE_ACCESS_KEY' -AmazonAwsIamUserSecretKey 'EXAMPLE_SECRET_KEY'
This script fetches an Amazon RDS SQL Server instance and updates its AWS credentials to use an AWS IAM User access key. Its SQL Server credentials are unmodified.
-------------------------- EXAMPLE 13 --------------------------
$amazonRdsSqlServer = Get-RedgateMonitorMonitoredObject -Name 'examplesqlserver.xxxxxxxxxxxx.us-west-1.rds.amazonaws.com' $amazonRdsSqlServer | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamInstanceProfile
This script fetches an Amazon RDS SQL Server instance and updates its AWS credentials to use the AWS IAM Instance Profile of the machine that the Base Monitor runs on (this is equivalent to an AWS IAM Role without a specified role identifier). Its SQL Server credentials are unmodified.
-------------------------- EXAMPLE 14 --------------------------
$amazonRdsSqlServer = Get-RedgateMonitorMonitoredObject -Name 'examplesqlserver.xxx7efgtsted.us-west-1.rds.amazonaws.com' $amazonRdsSqlServer | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamRole 'EXAMPLE_ROLE_ARN'
This script fetches an Amazon RDS SQL Server instance and updates its AWS credentials to use a named AWS IAM Role. Its SQL Server credentials are unmodified.
-------------------------- EXAMPLE 15 --------------------------
$amazonRdsSqlServer = Get-RedgateMonitorMonitoredObject -Name 'examplesqlserver.xxx7efgtsted.us-west-1.rds.amazonaws.com' $amazonRdsSqlServer | Update-RedgateMonitorMonitoredObjectCredential -Disable
This script fetches an Amazon RDS SQL Server instance and updates its AWS credentials to disable monitoring. Its SQL Server credentials are unmodified.
-------------------------- EXAMPLE 16 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'examplepgserver.database.windows.net' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -PostgresUserId 'pg_user' -PostgresPassword 'pg_pass'
This script fetches a Postgres instance and updates it to use Postgres username and password authentication.
-------------------------- EXAMPLE 17 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'examplepgserver.database.windows.net' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -PostgresUserId 'pg_user' -PostgresPassword 'pg_pass' -PostgresDatabase 'pg_db'
This script fetches a Postgres instance and updates it to use Postgres username and password authentication, also providing a specific database to connect to.
-------------------------- EXAMPLE 18 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -BaseMonitor $BaseMonitor -Type PostgresInstance -Name 'examplepgserver.database.windows.net' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -PostgresUserId 'pg_user' -PostgresCertificate -PostgresDatabase 'pg_db'
This script fetches a Postgres instance and updates it to use Postgres SSL certificate authentication. Specifying the Postgres user id here is required; providing a specific database to connect to is optional.
-------------------------- EXAMPLE 19 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'examplepgserver.database.windows.net' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraManagedIdentity -PostgresUserId 'pg_user' -PostgresDatabase 'pg_db'
This script fetches a Postgres instance on an Azure Flex host and updates it to use Microsoft Entra Managed Identity. Specifying the Postgres user id here is required; providing a specific database to connect to is optional.
-------------------------- EXAMPLE 20 --------------------------
$servicePrincipal = Get-RedgateMonitorServicePrincipalCredential -Name 'example-service-principal' $postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'examplepgserver.database.windows.net' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -MicrosoftEntraServicePrincipalCredential $servicePrincipal -PostgresUserId 'pg_user'
This script fetches a Postgres instance on an Azure Flex host and updates it to use a specified Microsoft Entra Service Principal. Specifying the Postgres user id here is required; providing a specific database to connect to is optional.
-------------------------- EXAMPLE 21 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'postgresexample.xxxxxxxxxxxx.us-west-1.rds.amazonaws.com' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamUserAccessKey 'EXAMPLE_ACCESS_KEY' -AmazonAwsIamUserSecretKey 'EXAMPLE_SECRET_KEY' -PostgresUserId 'pg_user' -PostgresDatabase 'pg_db'
This script fetches a Postgres instance on an Amazon RDS host and updates it to use an AWS IAM User access key. Specifying the Postgres user id here is required; providing a specific database to connect to is optional.
-------------------------- EXAMPLE 22 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'postgresexample.xxxxxxxxxxxx.us-west-1.rds.amazonaws.com' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamInstanceProfile -PostgresUserId 'pg_user' -PostgresDatabase 'pg_db'
This script fetches a Postgres instance on an Amazon RDS host and updates it to use the AWS IAM Instance Profile of the machine that the Base Monitor runs on (this is equivalent to an AWS IAM Role without a specified role identifier). Specifying the Postgres user id here is required; providing a specific database to connect to is optional.
-------------------------- EXAMPLE 23 --------------------------
$postgresInstance = Get-RedgateMonitorMonitoredObject -Type PostgresInstance -Name 'postgresexample.xxxxxxxxxxxx.us-west-1.rds.amazonaws.com' $postgresInstance | Update-RedgateMonitorMonitoredObjectCredential -AmazonAwsIamRole 'EXAMPLE_ROLE_ARN' -PostgresUserId 'pg_user' -PostgresDatabase 'pg_db'
This script fetches a Postgres instance on an Amazon RDS host and updates it to use a named AWS IAM Role. Specifying the Postgres user id here is required; providing a specific database to connect to is optional.