-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TOAZ-372 Support for deployment in Azure Government Cloud (Cromwell) (#…
…7670) Co-authored-by: Blair L Murri <[email protected]> Co-authored-by: Jonathon Saunders <[email protected]>
- Loading branch information
1 parent
95d2d53
commit 920759a
Showing
5 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
cloudSupport/src/main/scala/cromwell/cloudsupport/azure/AzureConfiguration.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cromwell.cloudsupport.azure | ||
|
||
import com.azure.core.management.AzureEnvironment | ||
import com.typesafe.config.ConfigFactory | ||
import net.ceedubs.ficus.Ficus._ | ||
|
||
object AzureConfiguration { | ||
private val conf = ConfigFactory.load().getConfig("azure") | ||
val azureEnvironment = | ||
AzureEnvironmentConverter.fromString( | ||
conf.as[Option[String]]("azure-environment").getOrElse(AzureEnvironmentConverter.Azure) | ||
) | ||
val azureTokenScopeManagement = conf.as[String]("token-scope-management") | ||
} | ||
|
||
object AzureEnvironmentConverter { | ||
val Azure: String = "AzureCloud" | ||
val AzureGov: String = "AzureUSGovernmentCloud" | ||
val AzureChina: String = "AzureChinaCloud" | ||
|
||
def fromString(s: String): AzureEnvironment = s match { | ||
case AzureGov => AzureEnvironment.AZURE_US_GOVERNMENT | ||
case AzureChina => AzureEnvironment.AZURE_CHINA | ||
// a bit redundant, but I want to have a explicit case for Azure for clarity, even though it's the default | ||
case Azure => AzureEnvironment.AZURE | ||
case _ => AzureEnvironment.AZURE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters