# core module
<!--BEGIN STABILITY BANNER-->---
![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)
> All classes are under active development and subject to non-backward compatible changes or removal in any
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
---
<!--END STABILITY BANNER-->
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|:-------------|:-------------|
<div style="height:8px"></div>
The core library includes the basic building blocks of the AWS Solutions Constructs Library. It defines the core classes that are used in the rest of the AWS Solutions Constructs Library.
> NOTE: Functions in the core library are not part of the published interface for Solutions Constructs. While they are not hidden, using them directly can result in breaking changes outside the scope of a Major release. As many users have expressed an interest in accessing this functionality, we are in the process of exposing this functionality through factories that will produce individual well architected resources. Find the current state of this effort under `aws-constructs-factories`.
## Default Properties for AWS CDK Constructs
Core library sets the default properties for the AWS CDK Constructs used by the AWS Solutions Constructs Library constructs.
For example, the following is the snippet of default properties for S3 Bucket construct created by AWS Solutions Constructs. By default, it will turn on the server-side encryption, bucket versioning, block all public access and setup the S3 access logging.
```
{
encryption: s3.BucketEncryption.S3_MANAGED,
versioned: true,
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
removalPolicy: RemovalPolicy.RETAIN,
serverAccessLogsBucket: loggingBucket
}
```
## Override the default properties
The default properties set by the Core library can be overridden by user provided properties. For example, the user can override the Amazon S3 Block Public Access property to meet specific requirements.
```
const stack = new cdk.Stack();
const props: CloudFrontToS3Props = {
bucketProps: {
blockPublicAccess: {
blockPublicAcls: false,
blockPublicPolicy: true,
ignorePublicAcls: false,
restrictPublicBuckets: true
}
}
};
new CloudFrontToS3(stack, 'test-cloudfront-s3', props);
expect(stack).toHaveResource("AWS::S3::Bucket", {
PublicAccessBlockConfiguration: {
BlockPublicAcls: false,
BlockPublicPolicy: true,
IgnorePublicAcls: false,
RestrictPublicBuckets: true
},
});
```
## Property override warnings
When a default property from the Core library is overridden by a user-provided property, Constructs will emit one or more warning messages to the console highlighting the change(s). These messages are intended to provide situational awareness to the user and prevent unintentional overrides that could create security risks. These messages will appear whenever deployment/build-related commands are executed, including `cdk deploy`, `cdk synth`, `npm test`, etc.
Example message:
`AWS_CONSTRUCTS_WARNING: An override has been provided for the property: BillingMode. Default value: 'PAY_PER_REQUEST'. You provided: 'PROVISIONED'.`
#### Toggling override warnings
Override warning messages are enabled by default, but can be explicitly turned on/off using the `overrideWarningsEnabled` shell variable.
* To explicitly <u>turn off</u> override warnings, run `export overrideWarningsEnabled=false`.
* To explicitly <u>turn on</u> override warnings, run `export overrideWarningsEnabled=true`.
* To revert to the default, run `unset overrideWarningsEnabled`.
Raw data
{
"_id": null,
"home_page": "https://github.com/awslabs/aws-solutions-constructs.git",
"name": "aws-solutions-constructs.core",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/61/f1/f4f1442ce4b69a85e5b4b1545b351ea467ba986c022d6d686670b598e963/aws_solutions_constructs_core-2.74.0.tar.gz",
"platform": null,
"description": "# core module\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)\n\n> All classes are under active development and subject to non-backward compatible changes or removal in any\n> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.\n> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\n| **Reference Documentation**:| <span style=\"font-weight: normal\">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|\n|:-------------|:-------------|\n\n<div style=\"height:8px\"></div>\n\nThe core library includes the basic building blocks of the AWS Solutions Constructs Library. It defines the core classes that are used in the rest of the AWS Solutions Constructs Library.\n\n> NOTE: Functions in the core library are not part of the published interface for Solutions Constructs. While they are not hidden, using them directly can result in breaking changes outside the scope of a Major release. As many users have expressed an interest in accessing this functionality, we are in the process of exposing this functionality through factories that will produce individual well architected resources. Find the current state of this effort under `aws-constructs-factories`.\n\n## Default Properties for AWS CDK Constructs\n\nCore library sets the default properties for the AWS CDK Constructs used by the AWS Solutions Constructs Library constructs.\n\nFor example, the following is the snippet of default properties for S3 Bucket construct created by AWS Solutions Constructs. By default, it will turn on the server-side encryption, bucket versioning, block all public access and setup the S3 access logging.\n\n```\n{\n encryption: s3.BucketEncryption.S3_MANAGED,\n versioned: true,\n blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,\n removalPolicy: RemovalPolicy.RETAIN,\n serverAccessLogsBucket: loggingBucket\n}\n```\n\n## Override the default properties\n\nThe default properties set by the Core library can be overridden by user provided properties. For example, the user can override the Amazon S3 Block Public Access property to meet specific requirements.\n\n```\n const stack = new cdk.Stack();\n\n const props: CloudFrontToS3Props = {\n bucketProps: {\n blockPublicAccess: {\n blockPublicAcls: false,\n blockPublicPolicy: true,\n ignorePublicAcls: false,\n restrictPublicBuckets: true\n }\n }\n };\n\n new CloudFrontToS3(stack, 'test-cloudfront-s3', props);\n\n expect(stack).toHaveResource(\"AWS::S3::Bucket\", {\n PublicAccessBlockConfiguration: {\n BlockPublicAcls: false,\n BlockPublicPolicy: true,\n IgnorePublicAcls: false,\n RestrictPublicBuckets: true\n },\n });\n```\n\n## Property override warnings\n\nWhen a default property from the Core library is overridden by a user-provided property, Constructs will emit one or more warning messages to the console highlighting the change(s). These messages are intended to provide situational awareness to the user and prevent unintentional overrides that could create security risks. These messages will appear whenever deployment/build-related commands are executed, including `cdk deploy`, `cdk synth`, `npm test`, etc.\n\nExample message:\n`AWS_CONSTRUCTS_WARNING: An override has been provided for the property: BillingMode. Default value: 'PAY_PER_REQUEST'. You provided: 'PROVISIONED'.`\n\n#### Toggling override warnings\n\nOverride warning messages are enabled by default, but can be explicitly turned on/off using the `overrideWarningsEnabled` shell variable.\n\n* To explicitly <u>turn off</u> override warnings, run `export overrideWarningsEnabled=false`.\n* To explicitly <u>turn on</u> override warnings, run `export overrideWarningsEnabled=true`.\n* To revert to the default, run `unset overrideWarningsEnabled`.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Core CDK Construct for patterns library",
"version": "2.74.0",
"project_urls": {
"Homepage": "https://github.com/awslabs/aws-solutions-constructs.git",
"Source": "https://github.com/awslabs/aws-solutions-constructs.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82f03fd3394551c302e3037fd67a7cba5f0ff93fced4537b9f7a2c3e7ade4705",
"md5": "6f835a23cc5ae271b72d369a64db0d9c",
"sha256": "cf166c477bc93617640403b0a75a7750be45af992874bd3a2b039ac8eacfbe5d"
},
"downloads": -1,
"filename": "aws_solutions_constructs.core-2.74.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f835a23cc5ae271b72d369a64db0d9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 851732,
"upload_time": "2024-10-22T18:08:57",
"upload_time_iso_8601": "2024-10-22T18:08:57.368710Z",
"url": "https://files.pythonhosted.org/packages/82/f0/3fd3394551c302e3037fd67a7cba5f0ff93fced4537b9f7a2c3e7ade4705/aws_solutions_constructs.core-2.74.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "61f1f4f1442ce4b69a85e5b4b1545b351ea467ba986c022d6d686670b598e963",
"md5": "e84be7f0570ed2641bb1087c6690fd7d",
"sha256": "3f3a614ebf38eefc392e2dd12ce3fcbce22a7b03b16e494eea9904df127a8dfb"
},
"downloads": -1,
"filename": "aws_solutions_constructs_core-2.74.0.tar.gz",
"has_sig": false,
"md5_digest": "e84be7f0570ed2641bb1087c6690fd7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 853691,
"upload_time": "2024-10-22T18:10:16",
"upload_time_iso_8601": "2024-10-22T18:10:16.504793Z",
"url": "https://files.pythonhosted.org/packages/61/f1/f4f1442ce4b69a85e5b4b1545b351ea467ba986c022d6d686670b598e963/aws_solutions_constructs_core-2.74.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-22 18:10:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "awslabs",
"github_project": "aws-solutions-constructs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-solutions-constructs.core"
}