CfnBucketPropsMixin

class aws_cdk.mixins_preview.aws_lightsail.mixins.CfnBucketPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::Lightsail::Bucket resource specifies a bucket.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-bucket.html

CloudformationResource:

AWS::Lightsail::Bucket

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins

cfn_bucket_props_mixin = lightsail_mixins.CfnBucketPropsMixin(lightsail_mixins.CfnBucketMixinProps(
    access_rules=lightsail_mixins.CfnBucketPropsMixin.AccessRulesProperty(
        allow_public_overrides=False,
        object_access="objectAccess"
    ),
    bucket_name="bucketName",
    bundle_id="bundleId",
    object_versioning=False,
    read_only_access_accounts=["readOnlyAccessAccounts"],
    resources_receiving_access=["resourcesReceivingAccess"],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::Lightsail::Bucket.

Parameters:
  • props (Union[CfnBucketMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['accessRules', 'bucketName', 'bundleId', 'objectVersioning', 'readOnlyAccessAccounts', 'resourcesReceivingAccess', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AccessRulesProperty

class CfnBucketPropsMixin.AccessRulesProperty(*, allow_public_overrides=None, object_access=None)

Bases: object

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

Parameters:
  • allow_public_overrides (Union[bool, IResolvable, None]) – 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. 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.

  • object_access (Optional[str]) – Specifies the anonymous access to all objects in a bucket. 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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-bucket-accessrules.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_lightsail import mixins as lightsail_mixins

access_rules_property = lightsail_mixins.CfnBucketPropsMixin.AccessRulesProperty(
    allow_public_overrides=False,
    object_access="objectAccess"
)

Attributes

allow_public_overrides

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.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-bucket-accessrules.html#cfn-lightsail-bucket-accessrules-allowpublicoverrides

object_access

Specifies the anonymous access to all objects in a bucket.

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-bucket-accessrules.html#cfn-lightsail-bucket-accessrules-getobject