nixops-aws icon indicating copy to clipboard operation
nixops-aws copied to clipboard

How do you use the s3 remote backend?

Open blobcode opened this issue 3 years ago • 7 comments

I've tried using the s3 remote backend below

network.storage.s3 = {
      profile = "root";
      region = "us-east-1";
      bucket = "main-nixops-state";
      key = "personal.nixops";
      kms_keyid = "166c5cbe-b827-4105-bdf4-a2db9b52efb4";
    };

however when deploying on nixopsUnstable, I get

The network requires the 's3' state provider, but no plugin provides it.

I've found no documentation on how to fix this.

My question is how does one exactly install the s3 plugin? And does anyone have an example config I could reference?

blobcode avatar Mar 22 '22 22:03 blobcode

I am kind of in the same boat as you so it's just a guess but probably you should use nixops.packages."${system}".nixops-aws # nixops with plugins from nixops.url = "github:lukebfox/nixops-plugged"; to have nixops and its aws plugin.

teto avatar Mar 25 '22 09:03 teto

nixpkgs also has a nixopsUnstable that includes most plugins. If something is missing from there, you can ping me for a review and merge.

roberth avatar Mar 25 '22 10:03 roberth

looks like it is now called nixops_unstable on unstable

teto avatar Mar 25 '22 11:03 teto

@roberth

It still appears as missing even with nixops_unstable on nixpkgs-unstable

blobcode avatar Mar 25 '22 14:03 blobcode

Then this seems to be an issue with the aws plugin.

roberth avatar Mar 25 '22 14:03 roberth

I'm having the same issue using a flake-based deployment.

lunik1 avatar Apr 28 '22 18:04 lunik1

Initial cursory investigation: NixopsAWSPlugin does not override storage_backends in nixops_aws/plugin.py, and so no s3 plugin is found when nixops assembles its list of storage backends here. The "fix" is to set storage_backends to return a dict containing the s3 bucket storage backend.

…however—and this may be my lack of sleep / familiarity with the codebase talking—I cannot find an implementation of a StorageBackend in this repo.

lunik1 avatar Apr 28 '22 19:04 lunik1