feat(infra): add S3 declarative buckets
All checks were successful
Check meta / check_dns (push) Successful in 20s
Check meta / check_meta (push) Successful in 20s
Check meta / check_meta (pull_request) Successful in 16s
lint / check (push) Successful in 22s
Check meta / check_dns (pull_request) Successful in 16s
lint / check (pull_request) Successful in 23s
build configuration / build_and_cache_compute01 (pull_request) Successful in 1m34s
build configuration / build_and_cache_geo01 (pull_request) Successful in 1m17s
build configuration / build_and_cache_rescue01 (pull_request) Successful in 1m20s
build configuration / build_and_cache_storage01 (pull_request) Successful in 1m25s
build configuration / build_and_cache_krz01 (pull_request) Successful in 2m5s
build configuration / build_and_cache_geo02 (pull_request) Successful in 1m4s
build configuration / build_and_cache_vault01 (pull_request) Successful in 1m22s
build configuration / build_and_cache_web02 (pull_request) Successful in 1m12s
build configuration / build_and_cache_bridge01 (pull_request) Successful in 1m10s
build configuration / build_and_cache_web01 (pull_request) Successful in 1m47s
All checks were successful
Check meta / check_dns (push) Successful in 20s
Check meta / check_meta (push) Successful in 20s
Check meta / check_meta (pull_request) Successful in 16s
lint / check (push) Successful in 22s
Check meta / check_dns (pull_request) Successful in 16s
lint / check (pull_request) Successful in 23s
build configuration / build_and_cache_compute01 (pull_request) Successful in 1m34s
build configuration / build_and_cache_geo01 (pull_request) Successful in 1m17s
build configuration / build_and_cache_rescue01 (pull_request) Successful in 1m20s
build configuration / build_and_cache_storage01 (pull_request) Successful in 1m25s
build configuration / build_and_cache_krz01 (pull_request) Successful in 2m5s
build configuration / build_and_cache_geo02 (pull_request) Successful in 1m4s
build configuration / build_and_cache_vault01 (pull_request) Successful in 1m22s
build configuration / build_and_cache_web02 (pull_request) Successful in 1m12s
build configuration / build_and_cache_bridge01 (pull_request) Successful in 1m10s
build configuration / build_and_cache_web01 (pull_request) Successful in 1m47s
A very simple basic support for it, which requires a S3 admin token. Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
This commit is contained in:
parent
c7f3acde97
commit
a37d83c418
2 changed files with 33 additions and 0 deletions
|
@ -2,5 +2,6 @@
|
|||
imports = [
|
||||
./common.nix
|
||||
./state.nix
|
||||
./s3.nix
|
||||
];
|
||||
}
|
||||
|
|
32
terranix/s3.nix
Normal file
32
terranix/s3.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) tf;
|
||||
in
|
||||
{
|
||||
# FIXME: add a NixOS module to abstract bucket creation, etc.
|
||||
config = {
|
||||
terraform.required_providers.garage = {
|
||||
version = "~> 1.0.3";
|
||||
source = "registry.opentofu.org/RaitoBezarius/garage";
|
||||
};
|
||||
|
||||
resource = {
|
||||
secret_resource.admin-s3-token.lifecycle.prevent_destroy = true;
|
||||
garage_bucket.monorepo-terraform-state = { };
|
||||
garage_bucket_global_alias = {
|
||||
monorepo-terraform-state = {
|
||||
bucket_id = tf.ref "resource.garage_bucket.monorepo-terraform-state.id";
|
||||
alias = "monorepo-terraform-state";
|
||||
};
|
||||
};
|
||||
garage_key = { };
|
||||
garage_bucket_key = { };
|
||||
};
|
||||
|
||||
provider.garage = {
|
||||
host = "s3.dgnum.eu";
|
||||
scheme = "https";
|
||||
token = tf.ref "resource.secret_resource.admin-s3-token.value";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue