Skip to content

Commit 6508f78

Browse files
author
Elad Ben-Israel
authoredSep 19, 2018
feat: use stringified tokens for resource attributes instead of strong types (#712)
This change removes all strong-types generated to represent CloudFormation resource attributes that return a string (such as `QueueArn`, `DeploymentGroupId`) and replaces them with `string` that contains a stringified token (via #518). This allows working with these attributes as if they were regular strings, and dramatically simplifies the type-system and unneeded wrapping when assigning values to such attributes. The ".ref" property of each resource has been replaced with a property named according to the actual semantic meaning of the intrinsic reference (such as `queueArn`), and also returns a `string`. Users can test if a string contains stringified tokens using the function `unresolved(o)`, which can be applied to either strings or objects (previously was `isToken(o)`). Fixes #695 (opened #744 to follow up on non-string attributes)
1 parent 680f0df commit 6508f78

File tree

134 files changed

+1106
-1079
lines changed

Some content is hidden

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

134 files changed

+1106
-1079
lines changed
 

Diff for: ‎build.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ if [ ! -d node_modules ]; then
55
/bin/bash ./install.sh
66
fi
77

8+
fail() {
9+
echo "❌ Last command failed. Scroll up to see errors in log."
10+
exit 1
11+
}
12+
813
/bin/bash ./git-secrets-scan.sh
914

1015
BUILD_INDICATOR=".BUILD_COMPLETED"
@@ -19,10 +24,10 @@ trap "rm -rf $MERKLE_BUILD_CACHE" EXIT
1924

2025
echo "============================================================================================="
2126
echo "building..."
22-
time lerna exec --stream "npm run build"
27+
time lerna run --no-bail --stream build || fail
2328

2429
echo "============================================================================================="
2530
echo "testing..."
26-
lerna run --stream test
31+
lerna run --no-bail --stream test || fail
2732

2833
touch $BUILD_INDICATOR

Diff for: ‎docs/src/examples.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ The following example creates the Aurora database **MyAuroraDatabase**.
168168
new rds.DatabaseCluster(this, 'MyRdsDb', {
169169
defaultDatabaseName: 'MyAuroraDatabase',
170170
masterUser: {
171-
username: new cdk.Token('admin'),
172-
password: new cdk.Token('123456')
171+
username: 'admin',
172+
password: '123456'
173173
},
174174
engine: rds.DatabaseClusterEngine.Aurora,
175175
instanceProps: {

0 commit comments

Comments
 (0)