Terraform for files.coilysiren.me: asset bucket, ACM cert, CloudFront distribution, Route53 alias #872
Labels
No labels
burndown-2026-06
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure#872
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Infra half of coilyco-bridge/deploy#738, which asks for
files.coilysiren.meon HTTPS as a place to stage assets that the Sirens Dowel lane can link during the 2026-08-19 Temporal stream. That issue describes the AWS resources as CLI calls. This repo already owns most of them in Terraform, so the CLI shape in #738 is wrong for the durable version and this issue is the correction.Why this is not just a mirror
terraform/aws-inventory/states it plainly: S3 buckets and thecoilysiren.meRoute53 zone plus all 17 record sets are managed resources, and Terraform detects drift. So:s3_bucket_nameslocal.files.coilysiren.merecord created by CLI sits outside the managed zone's record set.Whoever does #738 with the AWS CLI today creates resources this stack then has to import. That is a fine trade for a stream in three hours, but it is a debt and this issue is where it gets paid.
Safety finding that outranks the feature
coilysiren-assetsholds the Terraform state for this whole estate. Verified 2026-08-19:#738 already says not to reuse that bucket, but it gives the weak reason (Eco mod archives would go public). The real reason is that opening it would publish five Terraform state files, including the IAM stack's.
Deliverable, not just context: put that in a comment next to the
s3_bucket_nameslocal interraform/aws-inventory/main.tf. This issue will age out and the code will not, and "there is already an assets bucket, why make another" is exactly the shortcut someone reaches for under time pressure. The bucket list is where they will be standing when they think it.Work
1. Bucket, in
terraform/aws-inventory/. Addcoilysiren-filesto thes3_bucket_nameslocal. Keep block-public-access fully on: with CloudFront and Origin Access Control in front, the bucket never needs to be public, which is the main thing CloudFront buys here beyond TLS.2. Route53 alias. An
aws_route53_recordforfiles.coilysiren.me, A-ALIAS to the distribution, alias hosted zoneZ2FDTNDATAQYW2(a fixed AWS-side constant, not an account value). It joins the 17 managed record sets.3. ACM certificate, CloudFront distribution, Origin Access Control. The certificate must be requested in us-east-1 regardless of where anything else lives, because CloudFront reads certificates from that region only. That happens to be this stack's region already.
Decisions for ops
None of these have an obvious right answer from where this issue sits. Pick them deliberately and record which way and why, rather than letting the first commit decide.
Decision 1: which stack holds ACM and CloudFront. The
aws-inventoryREADME says to keep that stack focused on S3 and Route53 "so the AWS inventory does not turn into a mega-stack," which argues against putting a distribution in it.terraform/asset-cdn/, following the existing backend convention (coilysiren-assets, keyterraform-state/infrastructure/asset-cdn.tfstate,use_lockfile,encrypt), plus ajust terraform-asset-cdnverb and ascripts/k8s/terraform_asset_cdn.pyalongside its three siblings. More scaffolding, keeps the stated boundary.aws-inventoryanyway, on the grounds that one distribution is not a mega-stack and a fourth stack is more overhead than it saves. Cheaper now, erodes the rule.Decision 2: where the bucket policy lives, and whether it breaks the minimal-import rule. This is the one that needs a real choice. OAC requires an
aws_s3_bucket_policyallowing thecloudfront.amazonaws.comservice principals3:GetObject, conditioned onAWS:SourceArnmatching the distribution. Theaws-inventoryREADME deliberately leaves every bucket sub-resource unmanaged (versioning, encryption, public-access block, lifecycle) so the post-import plan stays clean. A bucket policy would be the first managed sub-resource on any bucket in this repo.aws-inventorykeeps its minimal-import property intact. Costs a cross-stack reference to the bucket.aws-inventorynext to the bucket, and amend the README to say the rule is "no sub-resources except where a policy is load bearing." Keeps bucket concerns together, and spends the clean-plan property that was deliberately bought.Whichever way it goes, the README's minimal-import paragraph needs updating to match, because right now it describes an invariant this work is about to change.
Decision 3: permanent or temporary. #738 was written as a stream-day tool with a
destroyverb. This repo does not hold temporary things. So eitherfiles.coilysiren.mebecomes standing infrastructure and the teardown path in #738 stops applying to it, or it dies with the demo and never lands here at all. Deciding this first is worth ten minutes, because it determines whether this issue should be done.Verified current AWS state
Read 2026-08-19, account
226734851276, us-east-1,AdministratorAccessvia SSO:files.coilysiren.mebucket, nocoilysiren-filesbucket.coilysiren.Z06714552N3MO04UBWF33, nofiles.*record set.coilysiren-assetsandkai-game-backups, which is exactly thes3_bucket_nameslocal, so that list is currently accurate.Running it
just terraform-aws-inventory planthenapply, per the justfile verb. CI here is config-validation only and does not deploy, so an operator applies this by hand. Terraform is not in any workflow under.forgejo/workflows/.Scope note
Dowel cannot write to this host. Their Discord grant declares
contentandmessage_referenceand nothing else, and the lane's Playwright allowlist omitsbrowser_file_upload. The asset host is somewhere Kai stages files and Dowel links them. Do not design an upload path for the agent as part of this.Sequencing
Independent of today's stream. If #738 ships the CLI version first, this issue becomes
terraform importfor the bucket, the record, the certificate, and the distribution, on top of Decision 3.