@aws-blocks/bb-app-setting 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/dist/index.cdk.js +3 -3
- package/dist/index.cdk.test.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/src/index.cdk.test.ts +2 -2
- package/src/index.cdk.ts +3 -3
- package/src/version.ts +1 -1
package/README.md
CHANGED
package/dist/index.cdk.js
CHANGED
|
@@ -150,7 +150,7 @@ function registerSecret(stack, parameterName) {
|
|
|
150
150
|
// First secret in this stack — create all shared infrastructure
|
|
151
151
|
state = { parameterNames: [parameterName] };
|
|
152
152
|
stack[SECRET_BULK_KEY] = state;
|
|
153
|
-
const secretInitFn = new lambda.Function(stack, '
|
|
153
|
+
const secretInitFn = new lambda.Function(stack, 'BlocksSecretInitFn', {
|
|
154
154
|
runtime: DEFAULT_NODE_RUNTIME,
|
|
155
155
|
handler: 'index.handler',
|
|
156
156
|
code: lambda.Code.fromInline(`
|
|
@@ -228,10 +228,10 @@ function registerSecret(stack, parameterName) {
|
|
|
228
228
|
},
|
|
229
229
|
},
|
|
230
230
|
}));
|
|
231
|
-
const provider = new cr.Provider(stack, '
|
|
231
|
+
const provider = new cr.Provider(stack, 'BlocksSecretProvider', {
|
|
232
232
|
onEventHandler: secretInitFn,
|
|
233
233
|
});
|
|
234
|
-
new cdk.CustomResource(stack, '
|
|
234
|
+
new cdk.CustomResource(stack, 'BlocksSecretsBulk', {
|
|
235
235
|
serviceToken: provider.serviceToken,
|
|
236
236
|
properties: {
|
|
237
237
|
ParameterNames: cdk.Lazy.list({ produce: () => state.parameterNames }),
|
package/dist/index.cdk.test.js
CHANGED
|
@@ -36,7 +36,7 @@ test('CDK: secret AppSetting SSM policy is scoped to specific parameter ARN (not
|
|
|
36
36
|
const { stack, parent } = setup();
|
|
37
37
|
new AppSetting(parent, 'my-secret', { secret: true, name: '/myapp/secret-key' });
|
|
38
38
|
const template = Template.fromStack(stack);
|
|
39
|
-
// The
|
|
39
|
+
// The BlocksSecretInitFn should have an IAM policy for ssm:PutParameter/DeleteParameter
|
|
40
40
|
// scoped to the specific parameter, NOT a wildcard
|
|
41
41
|
const policies = template.findResources('AWS::IAM::Policy');
|
|
42
42
|
const policyLogicalIds = Object.keys(policies);
|
|
@@ -110,7 +110,7 @@ test('CDK: non-secret AppSetting grants handler scoped SSM access', () => {
|
|
|
110
110
|
},
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
|
-
test('CDK: external secret is NOT enrolled in bulk-init (no
|
|
113
|
+
test('CDK: external secret is NOT enrolled in bulk-init (no BlocksSecretsBulk / BlocksSecretInitFn)', () => {
|
|
114
114
|
const { stack, parent } = setup();
|
|
115
115
|
AppSetting.fromExisting(parent, 'db-url', { name: '/blocks/sandbox/db-abc-connection-string', secret: true });
|
|
116
116
|
const template = Template.fromStack(stack);
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-blocks/bb-app-setting",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"author": "Amazon Web Services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"prebuild": "node ../../scripts/generate-version.mjs AppSetting",
|
|
29
29
|
"build": "tsc --build",
|
|
30
|
-
"test": "node --test dist/**/*.test.js"
|
|
30
|
+
"test": "node --test --test-concurrency=1 dist/**/*.test.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@aws-blocks/core": "^0.1.
|
|
34
|
-
"@aws-blocks/bb-logger": "^0.1.
|
|
33
|
+
"@aws-blocks/core": "^0.1.2",
|
|
34
|
+
"@aws-blocks/bb-logger": "^0.1.1",
|
|
35
35
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
36
36
|
"@standard-schema/spec": "^1.1.0"
|
|
37
37
|
},
|
package/src/index.cdk.test.ts
CHANGED
|
@@ -42,7 +42,7 @@ test('CDK: secret AppSetting SSM policy is scoped to specific parameter ARN (not
|
|
|
42
42
|
new AppSetting(parent, 'my-secret', { secret: true, name: '/myapp/secret-key' });
|
|
43
43
|
const template = Template.fromStack(stack);
|
|
44
44
|
|
|
45
|
-
// The
|
|
45
|
+
// The BlocksSecretInitFn should have an IAM policy for ssm:PutParameter/DeleteParameter
|
|
46
46
|
// scoped to the specific parameter, NOT a wildcard
|
|
47
47
|
const policies = template.findResources('AWS::IAM::Policy');
|
|
48
48
|
const policyLogicalIds = Object.keys(policies);
|
|
@@ -130,7 +130,7 @@ test('CDK: non-secret AppSetting grants handler scoped SSM access', () => {
|
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
test('CDK: external secret is NOT enrolled in bulk-init (no
|
|
133
|
+
test('CDK: external secret is NOT enrolled in bulk-init (no BlocksSecretsBulk / BlocksSecretInitFn)', () => {
|
|
134
134
|
const { stack, parent } = setup();
|
|
135
135
|
AppSetting.fromExisting(parent, 'db-url', { name: '/blocks/sandbox/db-abc-connection-string', secret: true });
|
|
136
136
|
const template = Template.fromStack(stack);
|
package/src/index.cdk.ts
CHANGED
|
@@ -194,7 +194,7 @@ function registerSecret(stack: cdk.Stack, parameterName: string): void {
|
|
|
194
194
|
state = { parameterNames: [parameterName] };
|
|
195
195
|
(stack as any)[SECRET_BULK_KEY] = state;
|
|
196
196
|
|
|
197
|
-
const secretInitFn = new lambda.Function(stack, '
|
|
197
|
+
const secretInitFn = new lambda.Function(stack, 'BlocksSecretInitFn', {
|
|
198
198
|
runtime: DEFAULT_NODE_RUNTIME,
|
|
199
199
|
handler: 'index.handler',
|
|
200
200
|
code: lambda.Code.fromInline(`
|
|
@@ -277,11 +277,11 @@ function registerSecret(stack: cdk.Stack, parameterName: string): void {
|
|
|
277
277
|
},
|
|
278
278
|
}));
|
|
279
279
|
|
|
280
|
-
const provider = new cr.Provider(stack, '
|
|
280
|
+
const provider = new cr.Provider(stack, 'BlocksSecretProvider', {
|
|
281
281
|
onEventHandler: secretInitFn,
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
new cdk.CustomResource(stack, '
|
|
284
|
+
new cdk.CustomResource(stack, 'BlocksSecretsBulk', {
|
|
285
285
|
serviceToken: provider.serviceToken,
|
|
286
286
|
properties: {
|
|
287
287
|
ParameterNames: cdk.Lazy.list({ produce: () => state!.parameterNames }),
|
package/src/version.ts
CHANGED