Skip to content
v2.277.0

OwnershipControlsProperty Struct ​

Specifies the container element for Object Ownership rules.

S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for data stored in Amazon S3. For more information, see Controlling ownership of objects and disabling ACLs in the Amazon S3 User Guide .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
const ownershipControlsProperty: s3.CfnBucket.OwnershipControlsProperty = {
  rules: [{
    objectOwnership: 'objectOwnership',
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_s3 as s3

ownership_controls_property = s3.CfnBucket.OwnershipControlsProperty(
    rules=[s3.CfnBucket.OwnershipControlsRuleProperty(
        object_ownership="objectOwnership"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.s3.*;

OwnershipControlsProperty ownershipControlsProperty = OwnershipControlsProperty.builder()
        .rules(List.of(OwnershipControlsRuleProperty.builder()
                .objectOwnership("objectOwnership")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;

var ownershipControlsProperty = new OwnershipControlsProperty {
    Rules = new [] { new OwnershipControlsRuleProperty {
        ObjectOwnership = "objectOwnership"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

ownershipControlsProperty := &OwnershipControlsProperty{
	Rules: []interface{}{
		&OwnershipControlsRuleProperty{
			ObjectOwnership: jsii.String("objectOwnership"),
		},
	},
}

Properties ​

rulesIResolvable | IResolvable | CfnBucket.OwnershipControlsRuleProperty[]rulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, OwnershipControlsRuleProperty]]]rulesIResolvableRulesIResolvableRulesinterface{}required#
Specifies the container element for Object Ownership rules.