Skip to content

feat(#1613, #1658): S3 bucket configurations, Object Lock state and CloudWatch dashboards - #1703

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/v0134-s3-cloudwatch
Nov 25, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/v0134-s3-cloudwatch

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Part of #1613: the S3 and CloudWatch-dashboard parts are done. Route 53, STS/IAM federation, Lambda and EventBridge are in their own v0.134.0 PRs (Kinesis and Organizations landed in #1704). Composite alarms, Logs Insights, and metric and subscription filters are follow-ups.
Part of #1658: the S3 part is done (GetBucketWebsite, GetBucketAccelerateConfiguration, GetBucketRequestPayment, GetBucketLogging, GetBucketReplication and GetObjectLockConfiguration no longer answer 501). EC2 DescribeNetworkAcls and RevokeSecurityGroupEgress of an absent rule remain.

  • S3 bucket configurations. Website (Put/Get/Delete), logging (Put/Get), Transfer Acceleration (Put/Get), request payment (Put/Get) and replication (Put/Get/Delete) are recorded and answered back, every member round-tripping. Each has its own key prefix in s3BucketSubresourcePrefixes, so DeleteBucket clears it. Nothing is acted on: no website endpoint, no access logs, no replication. docs/reference/s3.md says so in Recorded bucket configurations.
  • Unconfigured answers. Website: 404 NoSuchWebsiteConfiguration. Replication: 404 ReplicationConfigurationNotFoundError. Logging: 200 with an empty BucketLoggingStatus. Acceleration: 200 with an empty AccelerateConfiguration. Request payment: 200 with Payer BucketOwner.
  • Refusals.
    • MalformedXML for missing Required members and enum values.
    • Website: InvalidArgument when there is neither an index document nor a redirect.
    • Logging: InvalidTargetBucketForLogging for a missing or other-account target, and CrossLocationLoggingProhibited for another Region.
    • Acceleration: InvalidRequest for a bucket name with a period.
    • Replication: InvalidRequest for an unversioned source, a missing or unversioned destination, and the four Priority/DeleteMarkerReplication schema-version rules, each in S3's full text.
    • PutBucketVersioning Suspended: 409 InvalidBucketState while Object Lock or a replication configuration is present.
  • Object Lock. Covers the bucket state only; s3: object lock (bucket config, retention, legal hold, delete enforcement) #1693 keeps the rest.
    • CreateBucket with x-amz-bucket-object-lock-enabled: true, or CFN ObjectLockEnabled: true, records Object Lock and enables versioning.
    • PutObjectLockConfiguration with ObjectLockEnabled and no Rule enables it on a versioned bucket. Terraform sends exactly that for object_lock_enabled = true. A Rule is still 501.
    • GetObjectLockConfiguration answers ObjectLockEnabled Enabled for those buckets and 404 for the rest.
    • Default retention, retention, legal hold and delete enforcement stay with s3: object lock (bucket config, retention, legal hold, delete enforcement) #1693, and the docs say so.
  • Grantees. A Grantee in GetBucketAcl, GetObjectAcl and GetBucketLogging is written with xmlns:xsi and xsi:type (S3Grantee.MarshalXML through a wire type), so botocore reads its type and Terraform's target_grant doesn't drift. A raw-bytes test pins it.
  • Authorization. New operationActionOverrides rows: s3:Get/PutAccelerateConfiguration, s3:GetReplicationConfiguration, s3:PutReplicationConfiguration (also for Delete) and s3:Get/PutBucketObjectLockConfiguration.
  • CloudWatch dashboards.
    • PutDashboard, GetDashboard, ListDashboards (prefix filter, page[T], 1,000 a page) and DeleteDashboards.
    • A dashboard is global per account, with an ARN that has an empty Region. The body is answered byte for byte, and LastModified is on the simulated clock.
    • Every PutDashboard refusal is InvalidParameterInput (DashboardInvalidInputError), its model's one client error. That includes tag limits.
    • A missing dashboard renders <Code>ResourceNotFound</Code> on Query. On JSON and CBOR, __type is DashboardNotFoundError, with x-amzn-query-error: ResourceNotFound;Sender. To do this, queryErrorCodeFor now covers monitoring, and the Query error arm uses it.
  • CloudFormation.
    • AWS::S3::Bucket applies the four configurations on create and in place on update. It also sends ObjectLockEnabled at create, and an update that turns it on goes through PutObjectLockConfiguration.
    • AWS::CloudWatch::Dashboard has a deployer, an updater, a deleter and a generated name.
  • Catalog. The routed-operation count goes from 1,144 to 1,162: 14 S3 and 4 CloudWatch. S3's per-service count goes from 54 to 68. This branch is rebased on feat(#1613, #1539, #1627): Kinesis ListShards, EFO consumers, retention and UpdateMaxRecordSize; Organizations create/delete #1704, with the generated files regenerated.

Provenance

The codes and messages below come from observed AWS behaviour, not from the S3 error-code list. Each is cited beside its literal in the code:

A few things are substrate's own:

  • The message for suspending versioning while replication is configured: the user guide names no code or text, so it uses API_Error's InvalidBucketState description.
  • The other dashboard validation messages.
  • MalformedXML for a PutObjectLockConfiguration with no ObjectLockEnabled.

Compatibility

  • These S3 reads answer AWS's "not configured" document or error instead of 501.
  • PutBucketVersioning Suspended is refused while Object Lock or a replication configuration is present.
  • A Grantee's type is now xsi:type.
  • CloudWatch Query errors use the model's Query code where it differs from the handler's code; only a missing dashboard differs today.

Gates run locally

  • make lint test e2e
  • Both drift sets
  • docs-versions and docs-counts-check
  • SUBSTRATE_IAC=1 make iac-e2e: before the review fixes, the Terraform journey showed no S3 501s
  • Scratch Terraform with provider 6.74.0: aws_s3_bucket with object_lock_enabled = true, aws_s3_bucket_logging with a target_grant, aws_s3_bucket_ownership_controls, aws_s3_bucket_website_configuration and aws_cloudwatch_dashboard. Apply, an empty second plan and destroy all worked, and no S3 call answered 501.

Follow-ups

@scttfrdmn scttfrdmn added this to the v0.134.0 milestone Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

@scttfrdmn scttfrdmn changed the title feat(#1613, #1658): S3 bucket configurations and CloudWatch dashboards feat(#1613, #1658): S3 bucket configurations, Object Lock state and CloudWatch dashboards Nov 24, 2026
@scttfrdmn
scttfrdmn force-pushed the feat/v0134-s3-cloudwatch branch from 0db463d to 5b0afa8 Compare November 24, 2026 23:58
@scttfrdmn
scttfrdmn merged commit a59f00c into main Nov 25, 2026
20 checks passed
@scttfrdmn
scttfrdmn deleted the feat/v0134-s3-cloudwatch branch November 25, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant