Project

General

Profile

Actions

Feature #51

open
AS

Feature #33: Canofy Control Centre Backend Development

Feature #46: Canofy Control Centre Onboarding Process

# [CANOFY-105] Create Client S3 Bucket

Feature #51: # [CANOFY-105] Create Client S3 Bucket

Added by Akshath Shettigara about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/23/2026
Due date:
% Done:

0%

Estimated time:

Description

[CANOFY-105] Create Client S3 Bucket

Type: Story
Epic: New Client Onboarding — Automated AWS + Frappe Provisioning
Stage key: s3_bucket (pipeline stage 5 of 15)
Component: utils/aws_client.py

User Story

As an operations engineer,
I want a dedicated, encrypted S3 bucket created for each new client, so that** client file attachments are isolated per-client, encrypted at rest, and never require AWS access keys stored anywhere in Frappe.

Description

Create an S3 bucket named deterministically from the site name, with default SSE-S3 encryption enabled and public access blocked. The bucket name is recorded on the request
(s3_bucket_created) and threaded through the pipeline context
(s3_bucket_name) for later stages (iam_setup, ocr_policy_update,
frappe_config's S3 File Settings step).

Configuration / Prerequisites

  • Canofy Client.client_code must be set and unique — bucket naming
    collides otherwise.
  • AWS account must have S3 bucket-creation permission and no conflicting
    bucket name already existing globally (S3 bucket names are globally
    unique across all AWS accounts, not just this one).

Acceptance Criteria

  • Bucket created with a deterministic, predictable name derived from
    client_code.
  • Default encryption (SSE-S3 or SSE-KMS) enabled on the bucket.
  • Public access is blocked (all four "Block Public Access" settings on).
  • Bucket name recorded on Onboarding Request.s3_bucket_created.
  • Re-running this stage against an already-existing bucket (from a
    previous partial run) does not fail — treats "already exists and
    owned by us" as success, not an error.

Test Cases

ID Scenario Steps Expected Result
TC-1 Happy path Run stage for a new client Bucket exists, named per convention, encryption enabled
TC-2 Public access blocked Attempt an unauthenticated GET on an object in the bucket Access denied
TC-3 Global name collision Bucket name already taken by a different, unrelated AWS account Stage fails with a clear "bucket name unavailable" error, not a generic AWS exception
TC-4 Idempotent re-run Bucket already exists from a prior partial onboarding attempt for the same client Stage succeeds without attempting to recreate or erroring
TC-5 Missing client_code Canofy Client.client_code empty Stage fails fast before attempting bucket creation

No data to display

Actions

Also available in: PDF Atom