Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/backends/make/mkBackendResource.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ let mkBackendResource
, remote =
\(x : RemoteBackend.Type) ->
[ { mapKey = "remote", mapValue = Backends.remote x } ]
, s3 =
\(x: RemoteBackend.Type) ->
[ { mapKey = "s3", mapValue = Backends.s3 x}]
}
body

Expand Down
3 changes: 3 additions & 0 deletions lib/backends/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ let BackendNames = ./typeUnions/backend_names.dhall

let mkBackendResource = ../backends/make/mkBackendResource.dhall

let S3Backend = ./types/s3.dhall

let BackendResourceName
: BackendNames -> Text
= \(b : BackendNames) ->
merge
{ local = \(_ : LocalBackend.Type) -> "local"
, remote = \(_ : RemoteBackend.Type) -> "remote"
, s3 = \(_: S3Backend.Type) -> "s3"
}
b

Expand Down
4 changes: 3 additions & 1 deletion lib/backends/typeUnions/backend_names.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ let LocalBackend = ./../types/local.dhall

let RemoteBackend = (./../types/remote.dhall).RemoteBackend

in < local : LocalBackend.Type | remote : RemoteBackend.Type >
let S3Backend = (./../types/s3.dhall)

in < local : LocalBackend.Type | remote : RemoteBackend.Type | s3 : S3Backend.Type >
66 changes: 66 additions & 0 deletions lib/backends/types/s3.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
let Map = https://prelude.dhall-lang.org/v20.2.0/Map/Type
let List = https://prelude.dhall-lang.org/v20.2.0/List/Type
let S3Backend =
{
Type =
{ bucket : Text
, key : Text
, region : Text
, dynamodb_endpoint: Optional Text
, endpoint: Optional Text
, iam_endpoint: Optional Text
, sts_endpoint: Optional Text
, encrypt: Optional Bool
, acl: Optional Text
, access_key: Optional Text
, secret_key: Optional Text
, kms_key_id: Optional Text
, dynamodb_table: Optional Text
, profile: Optional Text
, shared_credentials_file: Optional Text
, token: Optional Text
, skip_credentials_validation: Optional Bool
, skip_region_validation: Optional Bool
, skip_metadata_api_check: Optional Bool
, sse_customer_key: Optional Text
, role_arn: Optional Text
, session_name: Optional Text
, external_id: Optional Text
, assume_role_duration_seconds: Optional Integer
, assume_role_policy: Optional Text
, assume_role_policy_arns: Optional List Text Text
, assume_role_tags: Optional Map Text Text
, assume_role_transitive_tag_keys: Optional List Text Text
, workspace_key_prefix: Optional Text
, force_path_style: Optional Bool
, max_retries: Optional Integer
}
, default =
{ region: env:AWS_REGION as Text ? env:AWS_DEFAULT_REGION as Text ? None Text
, dynamodb_endpoint: Some env:AWS_DYNAMODB_ENDPOINT as Text ? None Text
, endpoint: Some env:AWS_S3_ENDPOINT as Text ? None Text
, iam_endpoint: Some env:AWS_IAM_ENDPOINT as Text ? None Text
, sts_endpoint: Some env:AWS_STS_ENDPOINT as Text ? None Text
, encrypt: Some False
, acl: None Text
, access_key: None Text
, secret_key: None Text
, kms_key_id: None Text
, dynamodb_table: None Text
, profile: None Text
, shared_credentials_file: None Text
, token: None Text
, skip_credentials_validation: Some False
, skip_region_validation: Some False
, skip_metadata_api_check: Some False
, sse_customer_key: Some env:AWS_SSE_CUSTOMER_KEY as Text ? None Text
, role_arn: None Text
, session_name: None Text
, external_id: None Text
, assume_role_policy: None Text
, workspace_key_prefix: Some "env:"
, force_path_style: Some False
, max_retries: Some 5
}
}
in S3Backend
24 changes: 1 addition & 23 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
{ pkgs ? import <nixpkgs> {}}:
let
dhall-terraform-libgen = import (
pkgs.fetchFromGitHub {
owner = "emattiza";
repo = "dhall-terraform";
rev = "d6fb3d8bc6100582567157e00297da88855b71fa";
sha256 = "1vmll5a00wl3zfr0dk6gv327qla1kf1jb0hjkpb316629a21d2ph";
}
) {
nixpkgs = pkgs;
};
terraform_1_0 = pkgs.terraform_0_15.overrideAttrs (old: rec {
version = "v1.0.0";
src = pkgs.fetchFromGitHub {
owner = "hashicorp";
repo = "terraform";
rev = "v1.0.0";
sha256 = "1yhkj8nqkciwka6y9ddczm5dygbhh8gq4mr82x55m7whipy17mvm";
};
});
in
pkgs.mkShell {
buildInputs = with pkgs; [
jq
terraform_1_0
dhall
dhall-json
dhall-terraform-libgen
terraform
];
}