Skip to content

Commit

Permalink
fix(app): Intermittent Cognito user add bug
Browse files Browse the repository at this point in the history
As discussed in the below GH issue, we were seeing intermittent stack
deployment errors due to the AwsCustomResource for creating the demo
Cognito user. Upgrading CDK did not help by itself, but disabling
install_latest_aws_sdk *seems* to have made the configuration stable.
  • Loading branch information
athewsey committed May 6, 2024
1 parent c6bbe1b commit 79692ce
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions infra/cdk_src/cognito.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def __init__(
policy=AwsCustomResourcePolicy.from_sdk_calls(
resources=AwsCustomResourcePolicy.ANY_RESOURCE
),
install_latest_aws_sdk=True,
# TODO: Should we re-enable? Disabled for https://github.com/aws/aws-cdk/issues/30067
# install_latest_aws_sdk=True,
)

# Force set the password, to avoid inescapable FORCE_PASSWORD_CHANGE status:
Expand All @@ -98,7 +99,8 @@ def __init__(
policy=AwsCustomResourcePolicy.from_sdk_calls(
resources=AwsCustomResourcePolicy.ANY_RESOURCE
),
install_latest_aws_sdk=True,
# TODO: Should we re-enable? Disabled for https://github.com/aws/aws-cdk/issues/30067
# install_latest_aws_sdk=True,
)
set_password_cr.node.add_dependency(create_user_cr)

Expand Down
8 changes: 4 additions & 4 deletions infra/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"license": "MIT-0",
"private": true,
"dependencies": {
"aws-cdk": "2.126.0"
"aws-cdk": "2.140.0"
},
"engines": {
"node": ">=18"
Expand Down
7 changes: 5 additions & 2 deletions infra/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# aws-cdk-lib>=2.109.0 for Python 3.12 Lambda runtime, smstudio.domain to be able to set the
# "StudioWebPortal" user setting to force classic Studio experience
aws-cdk-lib==2.126.0
aws-cdk.aws-lambda-python-alpha==2.126.0-alpha.0
# >=2.140 to try and avoid 'Package @aws-sdk/client-cognito-identity-provider does not exist.' on
# AwsCustomResource (this version includes fix for related failure to upgrade AWS SDK)
# See: https://github.com/aws/aws-cdk/issues/30067
aws-cdk-lib==2.140.0
aws-cdk.aws-lambda-python-alpha==2.140.0-alpha.0
constructs>=10.0.0,<11.0.0
upsert-slr>=1.0.2,<2

0 comments on commit 79692ce

Please sign in to comment.