-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/s3_bucket_acl: new resource #22853
Conversation
6f0fe85
to
b54b69f
Compare
e5f947a
to
c84e0ba
Compare
15d3a65
to
73d8d7d
Compare
Output of acceptance tests after rebase/updates:
|
@gdavison i just realized the tests in |
a00470c
to
4e5b904
Compare
4e5b904
to
4b386f1
Compare
|
||
// BucketACLParseResourceID is a method for parsing the ID string | ||
// for the bucket name, accountID, and ACL if provided. | ||
func BucketACLParseResourceID(id string) (string, string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is too much just to store the optional "acl" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a regex would be more straightforward for parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚀
--- PASS: TestBucketACLParseResourceID (0.00s)
--- PASS: TestBucketACLParseResourceID/empty_ID (0.00s)
--- PASS: TestBucketACLParseResourceID/incorrect_format_with_comma_separators (0.00s)
--- PASS: TestBucketACLParseResourceID/incorrect_format_with_slash_separators (0.00s)
--- PASS: TestBucketACLParseResourceID/valid_ID_with_bucket (0.00s)
--- PASS: TestBucketACLParseResourceID/valid_ID_with_bucket_and_acl (0.00s)
--- PASS: TestBucketACLParseResourceID/valid_ID_with_bucket_and_bucket_owner (0.00s)
--- PASS: TestBucketACLParseResourceID/valid_ID_with_bucket,_bucket_owner,and'private'_acl (0.00s)
--- PASS: TestBucketACLParseResourceID/valid_ID_with_bucket,_bucket_owner,and'public-read'_acl (0.00s)
--- SKIP: TestAccS3BucketLogging_TargetGrantByEmail (0.00s)
--- SKIP: TestAccS3BucketReplicationConfiguration_existingObjectReplication (0.00s)
--- PASS: TestBucketName (0.00s)
--- PASS: TestBucketRegionalDomainName (0.00s)
--- PASS: TestWebsiteEndpoint (0.00s)
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes (122.24s)
--- PASS: TestAccS3Bucket_Basic_forceDestroy (123.79s)
--- PASS: TestAccS3BucketVersioning_disappears (125.71s)
--- PASS: TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled (125.82s)
--- PASS: TestAccS3BucketWebsiteConfiguration_disappears (127.53s)
--- PASS: TestAccS3BucketAccelerateConfiguration_basic (136.28s)
--- PASS: TestAccS3BucketWebsiteConfiguration_Redirect (140.60s)
--- PASS: TestAccS3BucketWebsiteConfiguration_RoutingRules_RedirectOnly (140.63s)
--- PASS: TestAccS3BucketVersioning_MFADelete (141.89s)
--- PASS: TestAccS3BucketVersioning_basic (142.43s)
--- PASS: TestAccS3BucketWebsiteConfiguration_basic (146.32s)
--- PASS: TestAccS3Bucket_Replication_schemaV2SameRegion (148.38s)
--- PASS: TestAccS3Bucket_Manage_objectLock (223.22s)
--- PASS: TestAccS3Bucket_Replication_expectVersioningValidationError (114.60s)
--- PASS: TestAccS3BucketWebsiteConfiguration_RoutingRules_MultipleRules (244.92s)
--- PASS: TestAccS3BucketWebsiteConfiguration_update (251.45s)
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock (123.45s)
--- PASS: TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExpiration (145.23s)
--- PASS: TestAccS3BucketObject_bucketObjectBucket (289.55s)
--- PASS: TestAccS3BucketVersioning_update (355.35s)
--- PASS: TestAccS3Bucket_Replication_withoutPrefix (243.78s)
--- PASS: TestAccS3Bucket_Replication_withoutStorageClass (248.47s)
--- PASS: TestAccS3Bucket_Replication_twoDestination (242.02s)
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter (238.18s)
--- PASS: TestAccS3Bucket_Security_corsDelete (135.39s)
--- PASS: TestAccS3Bucket_Security_corsEmptyOrigin (145.23s)
--- PASS: TestAccS3BucketWebsiteConfiguration_RoutingRules_ConditionAndRedirect (390.26s)
--- PASS: TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter (249.89s)
--- PASS: TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly (244.20s)
--- PASS: TestAccS3Bucket_Security_logging (163.64s)
--- PASS: TestAccS3Bucket_Manage_versioningAndMfaDeleteDisabled (141.18s)
--- PASS: TestAccS3Bucket_Manage_MfaDeleteDisabled (143.50s)
--- PASS: TestAccS3Bucket_Basic_shouldFailNotFound (101.87s)
--- PASS: TestAccS3Bucket_Manage_versioningDisabled (138.29s)
--- PASS: TestAccS3Bucket_Security_corsUpdate (243.89s)
--- PASS: TestAccS3Bucket_Basic_keyEnabled (145.23s)
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed (137.50s)
--- PASS: TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical (147.30s)
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation (414.39s)
--- PASS: TestAccS3Bucket_Basic_generatedName (140.22s)
--- PASS: TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation (418.10s)
--- PASS: TestAccS3Bucket_Manage_lifecycleBasic (333.69s)
--- PASS: TestAccS3Bucket_Basic_namePrefix (129.32s)
--- PASS: TestAccS3Bucket_Tags_basic (137.64s)
--- PASS: TestAccS3Bucket_Manage_versioning (220.42s)
--- PASS: TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEnabled (214.47s)
--- PASS: TestAccS3Bucket_Basic_requestPayer (207.02s)
--- PASS: TestAccS3Bucket_Basic_acceleration (216.54s)
--- PASS: TestAccS3Bucket_Basic_basic (101.36s)
--- PASS: TestAccS3Bucket_Basic_emptyString (103.52s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMSWithMasterKeyArn (98.98s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMSWithMasterKeyID (104.55s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMS (102.83s)
--- PASS: TestAccS3Bucket_Security_policy (273.27s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySEEByDefault_AES256 (102.46s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_disappears (87.53s)
--- PASS: TestAccS3Bucket_Replication_RTC_valid (674.17s)
--- PASS: TestAccS3Bucket_Tags_ignoreTags (202.48s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_basic (104.67s)
--- PASS: TestAccS3BucketRequestPaymentConfiguration_Basic_Requester (110.77s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_BucketKeyEnabled (192.31s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_BucketKeyEnabled (195.47s)
--- PASS: TestAccS3BucketRequestPaymentConfiguration_Basic_BucketOwner (111.71s)
--- PASS: TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_UpdateSSEAlgorithm (198.63s)
--- PASS: TestAccS3Bucket_Replication_basic (660.27s)
--- PASS: TestAccS3Bucket_Replication_schemaV2 (826.22s)
--- PASS: TestAccS3Bucket_Tags_withNoSystemTags (330.04s)
--- PASS: TestAccS3BucketRequestPaymentConfiguration_update (255.88s)
--- PASS: TestAccS3BucketReplicationConfiguration_disappears (113.07s)
--- PASS: TestAccS3Bucket_Tags_withSystemTags (387.26s)
--- PASS: TestAccS3BucketReplicationConfiguration_schemaV2SameRegion (233.06s)
--- PASS: TestAccS3BucketPublicAccessBlock_Disappears_bucket (32.67s)
--- PASS: TestAccS3BucketPublicAccessBlock_disappears (34.14s)
--- PASS: TestAccS3BucketPublicAccessBlock_restrictPublicBuckets (109.63s)
--- PASS: TestAccS3BucketPublicAccessBlock_ignorePublicACLs (102.35s)
--- PASS: TestAccS3BucketPublicAccessBlock_blockPublicPolicy (95.54s)
--- PASS: TestAccS3BucketPublicAccessBlock_basic (36.05s)
--- PASS: TestAccS3BucketPublicAccessBlock_blockPublicACLs (86.81s)
--- PASS: TestAccS3BucketPolicy_basic (27.04s)
--- PASS: TestAccS3BucketPolicy_policyUpdate (44.76s)
--- PASS: TestAccS3BucketOwnershipControls_Disappears_bucket (20.12s)
--- PASS: TestAccS3BucketOwnershipControls_Rule_objectOwnership (41.75s)
--- PASS: TestAccS3BucketReplicationConfiguration_withoutPrefix (381.86s)
--- PASS: TestAccS3BucketOwnershipControls_disappears (24.12s)
--- PASS: TestAccS3BucketPolicy_IAMRoleOrder_policyDocNotPrincipal (86.07s)
--- PASS: TestAccS3BucketPolicy_IAMRoleOrder_policyDoc (81.29s)
--- PASS: TestAccS3BucketOwnershipControls_basic (31.08s)
--- PASS: TestAccS3BucketReplicationConfiguration_filter_tagFilter (393.57s)
--- PASS: TestAccS3BucketObjectsDataSource_fetchOwner (45.97s)
--- PASS: TestAccS3BucketReplicationConfiguration_schemaV2DestinationMetrics (398.60s)
--- PASS: TestAccS3BucketObjectsDataSource_startAfter (50.91s)
--- PASS: TestAccS3BucketReplicationConfiguration_replicaModifications (389.08s)
--- PASS: TestAccS3BucketReplicationConfiguration_withoutStorageClass (390.36s)
--- PASS: TestAccS3BucketReplicationConfiguration_schemaV2 (391.20s)
--- PASS: TestAccS3BucketReplicationConfiguration_replicationTimeControl (394.13s)
--- PASS: TestAccS3BucketObjectsDataSource_maxKeys (56.89s)
--- PASS: TestAccS3BucketObjectsDataSource_encoded (59.23s)
--- PASS: TestAccS3BucketObjectsDataSource_all (63.80s)
--- PASS: TestAccS3BucketObjectsDataSource_prefixes (68.56s)
--- PASS: TestAccS3BucketReplicationConfiguration_multipleDestinationsNonEmptyFilter (373.46s)
--- PASS: TestAccS3BucketReplicationConfiguration_twoDestination (379.46s)
--- PASS: TestAccS3BucketReplicationConfiguration_multipleDestinationsEmptyFilter (375.49s)
--- PASS: TestAccS3BucketPolicy_IAMRoleOrder_jsonEncode (182.30s)
--- PASS: TestAccS3BucketReplicationConfiguration_filter_andOperator (475.50s)
--- PASS: TestAccS3BucketObject_bucketBucketKeyEnabled (56.56s)
--- PASS: TestAccS3BucketObjectsDataSource_basicViaAccessPoint (83.18s)
--- PASS: TestAccS3BucketObject_defaultBucketSSE (60.49s)
--- PASS: TestAccS3BucketObject_objectBucketKeyEnabled (59.43s)
--- PASS: TestAccS3BucketObjectsDataSource_basic (87.66s)
--- PASS: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAddAccessControlTranslation (447.70s)
--- PASS: TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessControlTranslation (433.25s)
--- PASS: TestAccS3BucketMetric_withFilterPrefixAndSingleTag (124.88s)
--- SKIP: TestAccS3BucketObject_nonVersioned (0.00s)
--- PASS: TestAccS3BucketObject_ignoreTags (130.34s)
--- PASS: TestAccS3BucketReplicationConfiguration_basic (397.65s)
--- PASS: TestAccS3BucketObject_objectLockLegalHoldStartWithOn (130.41s)
--- PASS: TestAccS3BucketObject_sse (88.63s)
--- PASS: TestAccS3BucketObject_kms (92.95s)
--- PASS: TestAccS3BucketObject_objectLockRetentionStartWithNone (193.00s)
--- PASS: TestAccS3BucketObject_withContentCharacteristics (92.01s)
--- PASS: TestAccS3BucketObject_updatesWithVersioningViaAccessPoint (155.62s)
--- PASS: TestAccS3BucketObject_contentBase64 (91.51s)
--- PASS: TestAccS3BucketObject_updatesWithVersioning (160.34s)
--- PASS: TestAccS3BucketObject_objectLockLegalHoldStartWithNone (200.29s)
--- PASS: TestAccS3BucketObject_updateSameFile (152.69s)
--- PASS: TestAccS3BucketObject_noNameNoKey (22.64s)
--- PASS: TestAccS3BucketObject_content (99.96s)
--- PASS: TestAccS3BucketObject_etagEncryption (100.67s)
--- PASS: TestAccS3BucketObject_updates (164.59s)
--- PASS: TestAccS3BucketObject_source (105.11s)
--- PASS: TestAccS3BucketObject_objectLockRetentionStartWithSet (260.74s)
--- PASS: TestAccS3BucketObject_metadata (226.04s)
--- PASS: TestAccS3BucketObject_acl (229.14s)
--- PASS: TestAccS3BucketObject_sourceHashTrigger (168.42s)
--- PASS: TestAccS3BucketObject_empty (100.48s)
--- PASS: TestAccS3BucketObject_tagsMultipleSlashes (275.36s)
--- PASS: TestAccS3BucketObjectDataSource_singleSlashAsKey (84.15s)
--- PASS: TestAccS3BucketObjectLockConfiguration_disappears (92.62s)
--- PASS: TestAccS3BucketObject_tagsLeadingMultipleSlashes (285.15s)
--- PASS: TestAccS3BucketObjectLockConfiguration_basic (107.50s)
--- PASS: TestAccS3BucketObject_tagsLeadingSingleSlash (291.84s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOff (90.18s)
--- PASS: TestAccS3BucketObjectDataSource_objectLockLegalHoldOn (91.19s)
--- PASS: TestAccS3BucketObjectDataSource_allParams (93.03s)
--- PASS: TestAccS3BucketObject_tags (299.31s)
--- PASS: TestAccS3BucketObjectDataSource_bucketKeyEnabled (91.00s)
--- PASS: TestAccS3BucketObjectDataSource_kmsEncrypted (92.17s)
--- PASS: TestAccS3BucketObjectDataSource_readableBody (89.55s)
--- PASS: TestAccS3BucketMetric_withEmptyFilter (15.34s)
--- PASS: TestAccS3BucketObjectDataSource_basicViaAccessPoint (91.06s)
--- PASS: TestAccS3BucketObjectDataSource_basic (85.85s)
--- PASS: TestAccS3BucketObjectDataSource_multipleSlashes (149.13s)
--- PASS: TestAccS3BucketObjectDataSource_leadingSlash (152.14s)
--- PASS: TestAccS3BucketObjectLockConfiguration_update (174.14s)
--- PASS: TestAccS3BucketNotification_Topic_multiple (97.43s)
--- PASS: TestAccS3BucketNotification_topic (101.01s)
--- PASS: TestAccS3BucketObject_storageClass (366.66s)
--- PASS: TestAccS3BucketNotification_eventbridge (92.32s)
--- PASS: TestAccS3BucketDataSource_website (90.17s)
--- PASS: TestAccS3BucketNotification_LambdaFunctionLambdaFunctionARN_alias (121.13s)
--- PASS: TestAccS3BucketNotification_lambdaFunction (119.34s)
--- PASS: TestAccS3BucketNotification_queue (135.58s)
--- PASS: TestAccS3BucketMetric_basic (92.79s)
--- PASS: TestAccS3BucketLogging_disappears (92.30s)
--- PASS: TestAccS3BucketNotification_update (191.34s)
--- PASS: TestAccS3BucketLogging_basic (109.21s)
--- PASS: TestAccS3BucketMetric_withFilterMultipleTags (159.00s)
--- PASS: TestAccS3BucketMetric_withFilterSingleTag (163.69s)
--- PASS: TestAccS3BucketMetric_withFilterPrefix (156.90s)
--- PASS: TestAccS3BucketMetric_withFilterPrefixAndMultipleTags (158.45s)
--- PASS: TestAccS3BucketIntelligentTieringConfiguration_disappears (68.32s)
--- PASS: TestAccS3BucketInventory_encryptWithSSEKMS (79.08s)
--- PASS: TestAccS3BucketInventory_encryptWithSSES3 (79.20s)
--- PASS: TestAccS3BucketInventory_basic (81.74s)
--- PASS: TestAccS3BucketIntelligentTieringConfiguration_basic (74.12s)
--- PASS: TestAccS3BucketLogging_TargetGrantByGroup (223.81s)
--- PASS: TestAccS3BucketLogging_TargetGrantByID (225.14s)
--- PASS: TestAccS3BucketLogging_update (222.70s)
--- PASS: TestAccS3BucketLifecycleConfiguration_RuleExpiration_EmptyBlock (217.33s)
--- PASS: TestAccS3BucketDataSource_basic (47.45s)
--- PASS: TestAccS3BucketCorsConfiguration_MultipleRules (53.01s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_empty (8.91s)
--- PASS: TestAccS3BucketCorsConfiguration_SingleRule (54.24s)
--- PASS: TestAccS3BucketLifecycleConfiguration_Prefix (218.54s)
--- PASS: TestAccS3BucketCorsConfiguration_disappears (45.67s)
--- PASS: TestAccS3BucketLifecycleConfiguration_NonCurrentVersionTransition (218.73s)
--- PASS: TestAccS3BucketLifecycleConfiguration_NonCurrentVersionExpiration (220.26s)
--- PASS: TestAccS3BucketCorsConfiguration_basic (56.43s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_empty (12.93s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_full (60.06s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_singleTag (90.17s)
--- PASS: TestAccS3BucketLifecycleConfiguration_disappears (201.46s)
--- PASS: TestAccS3BucketLifecycleConfiguration_MultipleRules (215.97s)
--- PASS: TestAccS3BucketLifecycleConfiguration_RuleAbortIncompleteMultipartUpload (290.05s)
--- PASS: TestAccS3BucketLifecycleConfiguration_basic (206.99s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_default (66.00s)
--- PASS: TestAccS3BucketLifecycleConfiguration_RuleExpiration_ExpireMarkerOnly (283.26s)
--- PASS: TestAccS3BucketLifecycleConfiguration_FilterWithPrefix (261.46s)
--- PASS: TestAccS3BucketAcl_disappears (61.83s)
--- PASS: TestAccS3BucketCorsConfiguration_update (152.32s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_basic (82.25s)
--- PASS: TestAccS3BucketLifecycleConfiguration_DisableRule (293.36s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_remove (121.26s)
--- PASS: TestAccS3BucketAccelerateConfiguration_disappears (70.53s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_multipleTags (121.58s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_prefixAndTags (124.53s)
--- PASS: TestAccS3BucketIntelligentTieringConfiguration_Filter (257.36s)
--- PASS: TestAccS3BucketAcl_basic (80.47s)
--- PASS: TestAccS3BucketAcl_ACLToGrant (130.26s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_WithFilter_prefix (121.91s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_removed (109.89s)
--- PASS: TestAccS3BucketAcl_grantToACL (113.32s)
--- PASS: TestAccS3BucketAcl_updateACL (110.20s)
--- PASS: TestAccS3BucketAcl_updateGrant (114.03s)
--- PASS: TestAccS3BucketAccelerateConfiguration_update (93.02s)
--- PASS: TestAccS3BucketAnalyticsConfiguration_updateBasic (127.34s)
|
||
// BucketACLParseResourceID is a method for parsing the ID string | ||
// for the bucket name, accountID, and ACL if provided. | ||
func BucketACLParseResourceID(id string) (string, string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a regex would be more straightforward for parsing
b60ea68
to
0a1c397
Compare
… comma separators; add id test coverage
0a1c397
to
5a1fab2
Compare
Output of acceptance tests:
|
This functionality has been released in v4.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #4418
Relates #20433
Output from acceptance testing: