module AWS.Secrets.Config
( SecretsConfig,
secretsConfig,
AwsRegion (..),
getAwsRegion,
getAwsRegionText,
getAwsCli,
setAwsCli,
AwsCli (..),
getAwsCliFilePath,
)
where
import Data.Text (Text)
import System.IO (FilePath)
data SecretsConfig = SecretConfig
{ SecretsConfig -> AwsCli
secretsConfigAwsCli :: AwsCli,
SecretsConfig -> AwsRegion
secretsConfigAwsRegion :: AwsRegion
}
newtype AwsCli = AwsCli FilePath
newtype AwsRegion = AwsRegion Text
defaultAwsCli :: AwsCli
defaultAwsCli :: AwsCli
defaultAwsCli = FilePath -> AwsCli
AwsCli FilePath
"aws"
secretsConfig :: AwsRegion -> SecretsConfig
secretsConfig :: AwsRegion -> SecretsConfig
secretsConfig AwsRegion
secretsConfigAwsRegion =
SecretConfig {secretsConfigAwsCli :: AwsCli
secretsConfigAwsCli = AwsCli
defaultAwsCli, AwsRegion
secretsConfigAwsRegion :: AwsRegion
secretsConfigAwsRegion :: AwsRegion
secretsConfigAwsRegion}
setAwsCli :: AwsCli -> SecretsConfig -> SecretsConfig
setAwsCli :: AwsCli -> SecretsConfig -> SecretsConfig
setAwsCli AwsCli
secretsConfigAwsCli SecretsConfig
config = SecretsConfig
config {AwsCli
secretsConfigAwsCli :: AwsCli
secretsConfigAwsCli :: AwsCli
secretsConfigAwsCli}
getAwsCli :: SecretsConfig -> AwsCli
getAwsCli :: SecretsConfig -> AwsCli
getAwsCli = SecretsConfig -> AwsCli
secretsConfigAwsCli
getAwsRegion :: SecretsConfig -> AwsRegion
getAwsRegion :: SecretsConfig -> AwsRegion
getAwsRegion = SecretsConfig -> AwsRegion
secretsConfigAwsRegion
getAwsCliFilePath :: AwsCli -> FilePath
getAwsCliFilePath :: AwsCli -> FilePath
getAwsCliFilePath (AwsCli FilePath
x) = FilePath
x
getAwsRegionText :: AwsRegion -> Text
getAwsRegionText :: AwsRegion -> Text
getAwsRegionText (AwsRegion Text
x) = Text
x