Skip to content
v2.278.0

AccessRulesProperty Struct ​

AccessRules is a property of the AWS::Lightsail::Bucket resource. It describes access rules for a bucket.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const accessRulesProperty: lightsail.CfnBucket.AccessRulesProperty = {
  allowPublicOverrides: false,
  objectAccess: 'objectAccess',
};
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_lightsail as lightsail

access_rules_property = lightsail.CfnBucket.AccessRulesProperty(
    allow_public_overrides=False,
    object_access="objectAccess"
)
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.lightsail.*;

AccessRulesProperty accessRulesProperty = AccessRulesProperty.builder()
        .allowPublicOverrides(false)
        .objectAccess("objectAccess")
        .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.Lightsail;

var accessRulesProperty = new AccessRulesProperty {
    AllowPublicOverrides = false,
    ObjectAccess = "objectAccess"
};
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"

accessRulesProperty := &AccessRulesProperty{
	AllowPublicOverrides: jsii.Boolean(false),
	ObjectAccess: jsii.String("objectAccess"),
}

Properties ​

allowPublicOverridesoptionalboolean | IResolvableallow_public_overridesoptionaltyping.Union[bool, IResolvable]allowPublicOverridesoptionalBooleanAllowPublicOverridesoptionalboolAllowPublicOverridesoptionalinterface{} #
A Boolean value indicating whether the access control list (ACL) permissions that are applied to individual objects override the `GetObject` option that is currently specified.
notes

When this is true, you can use the PutObjectAcl Amazon S3 API operation to set individual objects to public (read-only) or private, using either the public-read ACL or the private ACL.

objectAccessoptionalstringobject_accessoptionalstrobjectAccessoptionalStringObjectAccessoptionalstringObjectAccessoptional*string #
Specifies the anonymous access to all objects in a bucket.
notes

The following options can be specified:

  • public - Sets all objects in the bucket to public (read-only), making them readable by everyone on the internet.

If the GetObject value is set to public , then all objects in the bucket default to public regardless of the allowPublicOverrides value.

  • private - Sets all objects in the bucket to private, making them readable only by you and anyone that you grant access to.

If the GetObject value is set to private , and the allowPublicOverrides value is set to true , then all objects in the bucket default to private unless they are configured with a public-read ACL. Individual objects with a public-read ACL are readable by everyone on the internet.