Repository navigation
feat(#1613, #1658): S3 bucket configurations, Object Lock state and CloudWatch dashboards - #1703
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
feat/v0134-s3-cloudwatch
branch
from
November 24, 2026 23:58
0db463d to
5b0afa8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,GetBucketReplicationandGetObjectLockConfigurationno longer answer 501). EC2DescribeNetworkAclsandRevokeSecurityGroupEgressof an absent rule remain.s3BucketSubresourcePrefixes, soDeleteBucketclears it. Nothing is acted on: no website endpoint, no access logs, no replication.docs/reference/s3.mdsays so in Recorded bucket configurations.404 NoSuchWebsiteConfiguration. Replication:404 ReplicationConfigurationNotFoundError. Logging:200with an emptyBucketLoggingStatus. Acceleration:200with an emptyAccelerateConfiguration. Request payment:200withPayerBucketOwner.MalformedXMLfor missing Required members and enum values.InvalidArgumentwhen there is neither an index document nor a redirect.InvalidTargetBucketForLoggingfor a missing or other-account target, andCrossLocationLoggingProhibitedfor another Region.InvalidRequestfor a bucket name with a period.InvalidRequestfor an unversioned source, a missing or unversioned destination, and the fourPriority/DeleteMarkerReplicationschema-version rules, each in S3's full text.PutBucketVersioningSuspended:409 InvalidBucketStatewhile Object Lock or a replication configuration is present.CreateBucketwithx-amz-bucket-object-lock-enabled: true, or CFNObjectLockEnabled: true, records Object Lock and enables versioning.PutObjectLockConfigurationwithObjectLockEnabledand noRuleenables it on a versioned bucket. Terraform sends exactly that forobject_lock_enabled = true. ARuleis still 501.GetObjectLockConfigurationanswersObjectLockEnabledEnabledfor those buckets and 404 for the rest.GranteeinGetBucketAcl,GetObjectAclandGetBucketLoggingis written withxmlns:xsiandxsi:type(S3Grantee.MarshalXMLthrough a wire type), so botocore reads its type and Terraform'starget_grantdoesn't drift. A raw-bytes test pins it.operationActionOverridesrows:s3:Get/PutAccelerateConfiguration,s3:GetReplicationConfiguration,s3:PutReplicationConfiguration(also for Delete) ands3:Get/PutBucketObjectLockConfiguration.PutDashboard,GetDashboard,ListDashboards(prefix filter,page[T], 1,000 a page) andDeleteDashboards.LastModifiedis on the simulated clock.PutDashboardrefusal isInvalidParameterInput(DashboardInvalidInputError), its model's one client error. That includes tag limits.<Code>ResourceNotFound</Code>on Query. On JSON and CBOR,__typeisDashboardNotFoundError, withx-amzn-query-error: ResourceNotFound;Sender. To do this,queryErrorCodeFornow coversmonitoring, and the Query error arm uses it.AWS::S3::Bucketapplies the four configurations on create and in place on update. It also sendsObjectLockEnabledat create, and an update that turns it on goes throughPutObjectLockConfiguration.AWS::CloudWatch::Dashboardhas a deployer, an updater, a deleter and a generated name.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:
NoSuchWebsiteConfiguration,ReplicationConfigurationNotFoundErrorandObjectLockConfigurationNotFoundError: AWS CLI output (terraform-provider-aws#30646 and #7550).InvalidArgumenttext: [Bug] -PutBucketWebsite- emptyWebsiteConfigurationreturns vague error versity/versitygw#2260.A few things are substrate's own:
API_Error'sInvalidBucketStatedescription.MalformedXMLfor aPutObjectLockConfigurationwith noObjectLockEnabled.Compatibility
501.PutBucketVersioningSuspendedis refused while Object Lock or a replication configuration is present.xsi:type.Gates run locally
make lint test e2edocs-versionsanddocs-counts-checkSUBSTRATE_IAC=1 make iac-e2e: before the review fixes, the Terraform journey showed no S3 501saws_s3_bucketwithobject_lock_enabled = true,aws_s3_bucket_loggingwith atarget_grant,aws_s3_bucket_ownership_controls,aws_s3_bucket_website_configurationandaws_cloudwatch_dashboard. Apply, an empty second plan and destroy all worked, and no S3 call answered 501.Follow-ups