Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 179d5c1

Browse files
authored
Upgrade to version v1.3.0
### Added - [Service Catalog AppRegistry](https://docs.aws.amazon.com/servicecatalog/latest/arguide/intro-app-registry.html) resource to register the CloudFormation template and underlying resources as an application in both Service Catalog AppRegistry and AWS Systems Manager Application Manager ### Changed - Upgraded CDK version to 2.44.0
2 parents 010fbdf + bf1eb31 commit 179d5c1

File tree

125 files changed

+965
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+965
-1400
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ __pycache__/
2121
**/venv*
2222
**/.venv*
2323
.python-version
24+
pyvenv.cfg
2425

2526
## Python Testing
2627
**/.pytest_cache
@@ -62,4 +63,4 @@ source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_e
6263
source/cdk_solution_helper_py/helpers_cdk/build/*
6364
source/cdk_solution_helper_py/helpers_common/build/*
6465
source/scheduler/common/build/*
65-
source/scheduler/cdk/build/*
66+
source/scheduler/cdk/build/*

CHANGELOG.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
# Change Log
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

8+
[1.3.0] - 2022-11-17
9+
10+
### Added
11+
12+
[Service Catalog AppRegistry](https://docs.aws.amazon.com/servicecatalog/latest/arguide/intro-app-registry.html) resource to register the CloudFormation template and underlying resources as an application in both Service Catalog AppRegistry and AWS Systems Manager Application Manager
13+
14+
### Changed
15+
16+
- Upgraded CDK version to 2.44.0
17+
718
## [1.2.0] - 2022-01-31
19+
820
### Added
9-
- The solution now supports batch segment jobs to get user segments with your solution version. Each user segment is
10-
sorted in descending order based on the probability that each user will interact with items in your inventory.
11-
- The solution now supports domain dataset groups.
1221

13-
### Changed
22+
- The solution now supports batch segment jobs to get user segments with your solution version. Each user segment is
23+
sorted in descending order based on the probability that each user will interact with items in your inventory.
24+
- The solution now supports domain dataset groups.
25+
26+
### Changed
27+
1428
- Upgraded to CDKv2.
1529

1630
## [1.1.0] - 2021-11-22
31+
1732
### Added
33+
1834
- The solution now creates an Amazon EventBridge event bus, and puts messages to the bus when resources have been
19-
created by the workflow. This can be useful when integrating with external systems.
35+
created by the workflow. This can be useful when integrating with external systems.
2036
- The solution now contains a command line interface (CLI) that allows schedule creation for existing resources in
21-
Amazon Personalize.
37+
Amazon Personalize.
2238

2339
## [1.0.1] - 2021-10-01
40+
2441
### Added
42+
2543
- The solution now exports the Amazon SNS Topic ARN as `SNSTopicArn`.
2644

27-
### Changed
45+
### Changed
46+
2847
- The SNS message format will change based on the protocol used. For Amazon SQS and Email-JSON endpoints, a JSON payload
29-
will be sent. The message sent to subscribed Email endpoints is unchanged.
48+
will be sent. The message sent to subscribed Email endpoints is unchanged.
3049
- The Amazon CloudWatch dashboard deployed by the solution will be replaced with a dashboard containing the stack's
31-
region name.
50+
region name.
3251

3352
## [1.0.0] - 2021-09-23
53+
3454
### Added
55+
3556
- All files, initial version

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ batch/
284284
└── job_config.json.out
285285
```
286286

287+
Note: It is not recommended to use `performAutoML` as this feature will be deprecated in the future. Please take the time to select the most appropriate recipe for the use-case and skip this feature. Refer [FAQs](https://github.com/aws-samples/amazon-personalize-samples/blob/master/PersonalizeCheatSheet2.0.md).
288+
287289
## Creating a custom build
288290
To customize the solution, follow the steps below:
289291

@@ -293,8 +295,8 @@ The following procedures assumes that all the OS-level configuration has been co
293295
* [AWS Command Line Interface](https://aws.amazon.com/cli/)
294296
* [Python](https://www.python.org/) 3.9 or newer
295297
* [Node.js](https://nodejs.org/en/) 16.x or newer
296-
* [AWS CDK](https://aws.amazon.com/cdk/) 2.7.0 or newer
297-
* [Amazon Corretto OpenJDK](https://docs.aws.amazon.com/corretto/) 11
298+
* [AWS CDK](https://aws.amazon.com/cdk/) 2.44.0 or newer
299+
* [Amazon Corretto OpenJDK](https://docs.aws.amazon.com/corretto/) 17.0.4.1
298300

299301
> **Please ensure you test the templates before updating any production deployments.**
300302
@@ -350,12 +352,12 @@ export VERSION=my-version
350352
export REGION_NAME=my-region
351353

352354
build-s3-cdk-dist deploy \
353-
--source-bucket-name DIST_BUCKET_PREFIX \
354-
--solution-name SOLUTION_NAME \
355-
--version_code VERSION \
355+
--source-bucket-name $DIST_BUCKET_PREFIX \
356+
--solution-name $SOLUTION_NAME \
357+
--version_code $VERSION \
356358
--cdk-app-path ../source/infrastructure/deploy.py \
357359
--cdk-app-entrypoint deploy:build_app \
358-
--region REGION_NAME \
360+
--region $REGION_NAME \
359361
--sync
360362
```
361363

source/aws_lambda/s3_event/handler.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ def lambda_handler(event, context):
102102

103103
for record in event.records:
104104
key = record.s3.get_object.key
105-
logger.info(
106-
f"processing Amazon S3 event notification record for s3://{bucket}/{key}"
107-
)
105+
logger.info(f"processing Amazon S3 event notification record for s3://{bucket}/{key}")
108106
metrics.add_metric("ConfigurationsProcessed", unit=MetricUnit.Count, value=1)
109107

110108
s3_config = s3.get_object(Bucket=bucket, Key=key)
@@ -115,22 +113,16 @@ def lambda_handler(event, context):
115113
configuration.load(config_text)
116114
if configuration.errors:
117115
send_configuration_error(configuration)
118-
metrics.add_metric(
119-
"ConfigurationsProcessedFailures", unit=MetricUnit.Count, value=1
120-
)
116+
metrics.add_metric("ConfigurationsProcessedFailures", unit=MetricUnit.Count, value=1)
121117
return
122118

123119
# configuration has loaded, validate it
124120
configuration.validate()
125121
if configuration.errors:
126-
metrics.add_metric(
127-
"ConfigurationsProcessedFailures", unit=MetricUnit.Count, value=1
128-
)
122+
metrics.add_metric("ConfigurationsProcessedFailures", unit=MetricUnit.Count, value=1)
129123
send_configuration_error(configuration)
130124
else:
131125
config = configuration.config_dict
132126
config = set_bucket(config, bucket, key)
133-
metrics.add_metric(
134-
"ConfigurationsProcessedSuccesses", unit=MetricUnit.Count, value=1
135-
)
127+
metrics.add_metric("ConfigurationsProcessedSuccesses", unit=MetricUnit.Count, value=1)
136128
start_execution(config)

source/aws_lambda/shared/date_helpers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121

2222
def parse_datetime(tm: str) -> int:
2323
if "month" in tm:
24-
logger.warning(
25-
"while months are supported, they are based off of the calendar of the start of year 1 CE"
26-
)
24+
logger.warning("while months are supported, they are based off of the calendar of the start of year 1 CE")
2725
if "year" in tm:
28-
logger.warning(
29-
"while years are supported, they are based off of the calendar of the start of year 1 CE"
30-
)
26+
logger.warning("while years are supported, they are based off of the calendar of the start of year 1 CE")
3127

3228
start_of_time = datetime.datetime.min
3329
cal = pdt.Calendar(version=pdt.VERSION_CONTEXT_STYLE)

source/aws_lambda/shared/events.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def wrapper(caller, resource: Resource, **kwargs):
5858

5959
return wrapper
6060

61-
def notify(
62-
self, resource: Resource, result: Dict, cutoff: Optional[datetime]
63-
) -> None:
61+
def notify(self, resource: Resource, result: Dict, cutoff: Optional[datetime]) -> None:
6462
"""
6563
Notify each target in the NOTIFY_LIST
6664
:param resource: the subject of the notification
@@ -73,6 +71,4 @@ def notify(
7371
try:
7472
notifier.notify(self.status, resource, result)
7573
except NotificationError as exc:
76-
logger.error(
77-
f"notifier {notifier.name} failed: {str(exc)}"
78-
) # log and continue through notifiers
74+
logger.error(f"notifier {notifier.name} failed: {str(exc)}") # log and continue through notifiers

source/aws_lambda/shared/notifiers/base.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ def notify(self, status: str, resource: Resource, result: Dict) -> None:
7474
logger.debug(f"{resource.name.camel} status update ({status}) on {result}")
7575

7676
if self._is_create(resource, result):
77-
logger.info(
78-
f"notifier {self.name} starting for creation of {resource.name.camel}"
79-
)
77+
logger.info(f"notifier {self.name} starting for creation of {resource.name.camel}")
8078
self.notify_create(status, resource, result)
8179
self.notified = True
8280
elif self._resource_stable(resource, result):
83-
logger.info(
84-
f"notifier {self.name} starting for completion of {resource.name.camel}"
85-
)
81+
logger.info(f"notifier {self.name} starting for completion of {resource.name.camel}")
8682
self.notify_complete(status, resource, result)
8783
self.notified = True
8884

@@ -116,9 +112,7 @@ def _resource_stable(self, resource: Resource, result: Dict) -> bool:
116112
last_updated = self.get_resource_last_updated(resource, result)
117113
created = self.get_resource_created(resource, result)
118114
status = self.get_resource_status(resource, result)
119-
latest_campaign_update = self.get_resource_latest_campaign_update(
120-
resource, result
121-
)
115+
latest_campaign_update = self.get_resource_latest_campaign_update(resource, result)
122116

123117
if not last_updated or not created:
124118
logger.info(
@@ -136,9 +130,7 @@ def _resource_stable(self, resource: Resource, result: Dict) -> bool:
136130
logger.info(f"{resource.name.camel} is updating, and not yet active")
137131
return False
138132
elif not self.cutoff:
139-
logger.debug(
140-
f"{resource.name.camel} has no cutoff specified for notification"
141-
)
133+
logger.debug(f"{resource.name.camel} has no cutoff specified for notification")
142134
return False
143135
elif last_updated <= self.cutoff:
144136
logger.info(f"{resource.name.camel} does not require update at this time")
@@ -147,9 +139,7 @@ def _resource_stable(self, resource: Resource, result: Dict) -> bool:
147139
logger.info(f"{resource.name.camel} is ready for notification")
148140
return True
149141

150-
def get_resource_latest_campaign_update(
151-
self, resource: Resource, result: Dict
152-
) -> Dict:
142+
def get_resource_latest_campaign_update(self, resource: Resource, result: Dict) -> Dict:
153143
"""
154144
Campaigns track their update status separately from the top-level status - return the update status
155145
:param resource: the Campaign resource
@@ -165,9 +155,7 @@ def get_resource_created(self, resource: Resource, result: Dict) -> datetime:
165155
:param result: the resource as returned from the SDK
166156
:return: datetime
167157
"""
168-
return jmespath.search(
169-
TIME_FMT.format(name=resource.name.camel, date="creationDateTime"), result
170-
)
158+
return jmespath.search(TIME_FMT.format(name=resource.name.camel, date="creationDateTime"), result)
171159

172160
def get_resource_last_updated(self, resource: Resource, result: Dict) -> datetime:
173161
"""

source/aws_lambda/shared/notifiers/notify_eventbridge.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ def notify_complete(self, status: str, resource: Resource, result: Dict) -> None
6565
seconds = int((updated - created).total_seconds())
6666
self._notify(status, arn, resource, duration=seconds)
6767

68-
def _notify(
69-
self, status: str, arn: str, resource: Resource, duration: int = 0
70-
) -> None:
68+
def _notify(self, status: str, arn: str, resource: Resource, duration: int = 0) -> None:
7169
"""
7270
The EventBridge notification implementation
7371
:param status: the resource status
@@ -93,6 +91,4 @@ def _notify(
9391
)
9492
if result["FailedEntryCount"] > 0:
9593
for entry in result["Entries"]:
96-
logger.error(
97-
f"EventBridge failure ({entry['ErrorCode']}) {entry['ErrorMessage']}"
98-
)
94+
logger.error(f"EventBridge failure ({entry['ErrorCode']}) {entry['ErrorMessage']}")

0 commit comments

Comments
 (0)