Skip to content

Commit 6d4e34f

Browse files
authored
feat(amazonq): allow Amazon Q endpoint to be configured through the registry (#5318)
1 parent 805cb39 commit 6d4e34f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererConstants.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package software.aws.toolkits.jetbrains.services.codewhisperer.util
66
import com.intellij.openapi.actionSystem.DataKey
77
import com.intellij.openapi.editor.markup.EffectType
88
import com.intellij.openapi.editor.markup.TextAttributes
9+
import com.intellij.openapi.util.registry.Registry
910
import com.intellij.ui.JBColor
1011
import software.amazon.awssdk.regions.Region
1112
import software.amazon.awssdk.services.codewhispererruntime.model.AccessDeniedException
@@ -154,7 +155,9 @@ object CodeWhispererConstants {
154155
}
155156

156157
object Config {
157-
const val CODEWHISPERER_ENDPOINT = "https://codewhisperer.us-east-1.amazonaws.com/" // PROD
158+
val CODEWHISPERER_ENDPOINT
159+
get() = Registry.get("amazon.q.endpoint").asString()
160+
158161
const val CODEWHISPERER_IDPOOL_ID = "us-east-1:70717e99-906f-4add-908c-bd9074a2f5b9"
159162
val Sigv4ClientRegion = Region.US_EAST_1
160163
val BearerClientRegion = Region.US_EAST_1

plugins/amazonq/src/main/resources/META-INF/plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
<incompatible-with>com.intellij.jetbrains.client</incompatible-with>
8484
<incompatible-with>com.intellij.gateway</incompatible-with>
8585

86+
<extensions defaultExtensionNs="com.intellij">
87+
<registryKey key="amazon.q.endpoint" description="Endpoint to use for Amazon Q"
88+
defaultValue="https://codewhisperer.us-east-1.amazonaws.com/" restartRequired="true"/>
89+
</extensions>
90+
8691
<xi:include href="/META-INF/module-amazonq.xml" />
8792

8893
<xi:include href="/META-INF/change-notes.xml" xpointer="xpointer(/idea-plugin/*)">

0 commit comments

Comments
 (0)