@aws-solutions-constructs/resources 2.95.1 → 2.96.0
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/.jsii +3 -3
- package/package.json +3 -3
- package/test/integ.key-policy-updater.js.snapshot/asset.e97825c838d70ceb13ba2f6223a7d94ed35687b70bfb224a0b9128e698e3f28e/index.d.ts +30 -0
- package/test/integ.key-policy-updater.js.snapshot/asset.e97825c838d70ceb13ba2f6223a7d94ed35687b70bfb224a0b9128e698e3f28e/index.js +129 -0
- package/test/integ.key-policy-updater.js.snapshot/cdk.out +1 -1
- package/test/integ.key-policy-updater.js.snapshot/integ.json +2 -2
- package/test/integ.key-policy-updater.js.snapshot/key-policy-updater.assets.json +4 -4
- package/test/integ.key-policy-updater.js.snapshot/key-policy-updater.template.json +1 -1
- package/test/integ.key-policy-updater.js.snapshot/keypolicyupdaterIntegDefaultTestDeployAssert2855331B.assets.json +1 -1
- package/test/integ.key-policy-updater.js.snapshot/manifest.json +66 -42
- package/test/integ.key-policy-updater.js.snapshot/tree.json +1 -1
- package/test/integ.template-writer-from-asset.js.snapshot/asset.b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d/index.d.ts +22 -0
- package/test/integ.template-writer-from-asset.js.snapshot/asset.b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d/index.js +71 -0
- package/test/integ.template-writer-from-asset.js.snapshot/cdk.out +1 -1
- package/test/integ.template-writer-from-asset.js.snapshot/integ.json +2 -2
- package/test/integ.template-writer-from-asset.js.snapshot/manifest.json +66 -42
- package/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json +4 -4
- package/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.template.json +1 -1
- package/test/integ.template-writer-from-asset.js.snapshot/templatewriterfromassetIntegDefaultTestDeployAssert3AE00E9B.assets.json +1 -1
- package/test/integ.template-writer-from-asset.js.snapshot/tree.json +1 -1
- package/test/integ.template-writer-from-large-asset.js.snapshot/asset.b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d/index.d.ts +22 -0
- package/test/integ.template-writer-from-large-asset.js.snapshot/asset.b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d/index.js +71 -0
- package/test/integ.template-writer-from-large-asset.js.snapshot/cdk.out +1 -1
- package/test/integ.template-writer-from-large-asset.js.snapshot/integ.json +2 -2
- package/test/integ.template-writer-from-large-asset.js.snapshot/manifest.json +66 -42
- package/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.assets.json +4 -4
- package/test/integ.template-writer-from-large-asset.js.snapshot/template-writer-from-large-asset.template.json +1 -1
- package/test/integ.template-writer-from-large-asset.js.snapshot/templatewriterfromlargeassetIntegDefaultTestDeployAssertA02D2FEC.assets.json +1 -1
- package/test/integ.template-writer-from-large-asset.js.snapshot/tree.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
export declare const handler: (event: any, context: any) => Promise<{
|
|
14
|
+
Status: string;
|
|
15
|
+
Reason: string;
|
|
16
|
+
PhysicalResourceId: any;
|
|
17
|
+
StackId: any;
|
|
18
|
+
RequestId: any;
|
|
19
|
+
LogicalResourceId: any;
|
|
20
|
+
Data: {};
|
|
21
|
+
}>;
|
|
22
|
+
export declare function replaceTarget(template: string | undefined, templateValue: any): string | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
6
|
+
* with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
11
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.handler = void 0;
|
|
16
|
+
exports.replaceTarget = replaceTarget;
|
|
17
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
18
|
+
const crypto = require("crypto");
|
|
19
|
+
const s3Client = new client_s3_1.S3Client({ region: process.env.REGION });
|
|
20
|
+
const handler = async (event, context) => {
|
|
21
|
+
let status = 'SUCCESS';
|
|
22
|
+
let responseData = {};
|
|
23
|
+
// These are the standard Create/Update/Delete custom resource request types defined here:
|
|
24
|
+
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requesttypes.html
|
|
25
|
+
if (event.RequestType === 'Create' || event.RequestType === 'Update') {
|
|
26
|
+
try {
|
|
27
|
+
const templateValues = JSON.parse(event.ResourceProperties.TemplateValues).templateValues;
|
|
28
|
+
const templateInputBucket = event.ResourceProperties.TemplateInputBucket;
|
|
29
|
+
const templateInputKey = event.ResourceProperties.TemplateInputKey;
|
|
30
|
+
const templateOutputBucket = event.ResourceProperties.TemplateOutputBucket;
|
|
31
|
+
const templateOutputKey = crypto.randomBytes(32).toString('hex');
|
|
32
|
+
const getObjectResponse = await s3Client.send(new client_s3_1.GetObjectCommand({
|
|
33
|
+
Bucket: templateInputBucket,
|
|
34
|
+
Key: templateInputKey
|
|
35
|
+
}));
|
|
36
|
+
let template = await getObjectResponse.Body?.transformToString();
|
|
37
|
+
templateValues.forEach((templateValue) => {
|
|
38
|
+
template = replaceTarget(template, templateValue);
|
|
39
|
+
});
|
|
40
|
+
await s3Client.send(new client_s3_1.PutObjectCommand({
|
|
41
|
+
Bucket: templateOutputBucket,
|
|
42
|
+
Key: templateOutputKey,
|
|
43
|
+
Body: template
|
|
44
|
+
}));
|
|
45
|
+
responseData = {
|
|
46
|
+
TemplateOutputKey: templateOutputKey
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
status = 'FAILED';
|
|
51
|
+
responseData = {
|
|
52
|
+
Error: err
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
Status: status,
|
|
58
|
+
Reason: JSON.stringify(responseData),
|
|
59
|
+
PhysicalResourceId: event.PhysicalResourceId ?? context.logStreamName,
|
|
60
|
+
StackId: event.StackId,
|
|
61
|
+
RequestId: event.RequestId,
|
|
62
|
+
LogicalResourceId: event.LogicalResourceId,
|
|
63
|
+
Data: responseData,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.handler = handler;
|
|
67
|
+
function replaceTarget(template, templateValue) {
|
|
68
|
+
template = template?.replace(new RegExp(`\\b${templateValue.id}\\b`, 'g'), templateValue.value);
|
|
69
|
+
return template;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7OztBQTRESCxzQ0FNQztBQWhFRCxrREFBa0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"48.0.0",
|
|
3
3
|
"testCases": {
|
|
4
4
|
"template-writer-from-asset/Integ/DefaultTest": {
|
|
5
5
|
"stacks": [
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"assertionStackName": "templatewriterfromassetIntegDefaultTestDeployAssert3AE00E9B"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"minimumCliVersion": "2.
|
|
12
|
+
"minimumCliVersion": "2.1029.2"
|
|
13
13
|
}
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"validateOnSynth": false,
|
|
67
67
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
|
|
68
68
|
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
|
|
69
|
-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/
|
|
69
|
+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/11f4a549abf3d9a1620c7bbb03d9493c231addfeee240a74e7fcbc1e9f4b71bb.json",
|
|
70
70
|
"requiresBootstrapStackVersion": 6,
|
|
71
71
|
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
|
|
72
72
|
"additionalDependencies": [
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
"runtime": "*",
|
|
264
264
|
"handler": "*",
|
|
265
265
|
"timeout": "*",
|
|
266
|
-
"
|
|
266
|
+
"loggingFormat": "JSON",
|
|
267
267
|
"applicationLogLevelV2": "FATAL",
|
|
268
268
|
"logGroup": "*",
|
|
269
269
|
"vpc": "*",
|
|
@@ -478,57 +478,48 @@
|
|
|
478
478
|
"properties": {
|
|
479
479
|
"module": "aws-cdk-lib",
|
|
480
480
|
"flags": {
|
|
481
|
-
"@aws-cdk/
|
|
481
|
+
"@aws-cdk/aws-signer:signingProfileNamePassedToCfn": {
|
|
482
482
|
"recommendedValue": true,
|
|
483
|
-
"explanation": "
|
|
484
|
-
},
|
|
485
|
-
"aws-cdk:enableDiffNoFail": {
|
|
486
|
-
"recommendedValue": true,
|
|
487
|
-
"explanation": "Make `cdk diff` not fail when there are differences"
|
|
483
|
+
"explanation": "Pass signingProfileName to CfnSigningProfile"
|
|
488
484
|
},
|
|
489
485
|
"@aws-cdk/core:newStyleStackSynthesis": {
|
|
490
486
|
"recommendedValue": true,
|
|
491
|
-
"explanation": "Switch to new stack synthesis method which enables CI/CD"
|
|
487
|
+
"explanation": "Switch to new stack synthesis method which enables CI/CD",
|
|
488
|
+
"unconfiguredBehavesLike": {
|
|
489
|
+
"v2": true
|
|
490
|
+
}
|
|
492
491
|
},
|
|
493
492
|
"@aws-cdk/core:stackRelativeExports": {
|
|
494
493
|
"recommendedValue": true,
|
|
495
|
-
"explanation": "Name exports based on the construct paths relative to the stack, rather than the global construct path"
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
"explanation": "DockerImageAsset properly supports `.dockerignore` files by default"
|
|
500
|
-
},
|
|
501
|
-
"@aws-cdk/aws-secretsmanager:parseOwnedSecretName": {
|
|
502
|
-
"recommendedValue": true,
|
|
503
|
-
"explanation": "Fix the referencing of SecretsManager names from ARNs"
|
|
504
|
-
},
|
|
505
|
-
"@aws-cdk/aws-kms:defaultKeyPolicies": {
|
|
506
|
-
"recommendedValue": true,
|
|
507
|
-
"explanation": "Tighten default KMS key policies"
|
|
508
|
-
},
|
|
509
|
-
"@aws-cdk/aws-s3:grantWriteWithoutAcl": {
|
|
510
|
-
"recommendedValue": true,
|
|
511
|
-
"explanation": "Remove `PutObjectAcl` from Bucket.grantWrite"
|
|
494
|
+
"explanation": "Name exports based on the construct paths relative to the stack, rather than the global construct path",
|
|
495
|
+
"unconfiguredBehavesLike": {
|
|
496
|
+
"v2": true
|
|
497
|
+
}
|
|
512
498
|
},
|
|
513
|
-
"@aws-cdk/aws-ecs-patterns:
|
|
499
|
+
"@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener": {
|
|
514
500
|
"recommendedValue": true,
|
|
515
|
-
"explanation": "
|
|
501
|
+
"explanation": "Disable implicit openListener when custom security groups are provided"
|
|
516
502
|
},
|
|
517
503
|
"@aws-cdk/aws-rds:lowercaseDbIdentifier": {
|
|
518
504
|
"recommendedValue": true,
|
|
519
|
-
"explanation": "Force lowercasing of RDS Cluster names in CDK"
|
|
505
|
+
"explanation": "Force lowercasing of RDS Cluster names in CDK",
|
|
506
|
+
"unconfiguredBehavesLike": {
|
|
507
|
+
"v2": true
|
|
508
|
+
}
|
|
520
509
|
},
|
|
521
510
|
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": {
|
|
522
511
|
"recommendedValue": true,
|
|
523
|
-
"explanation": "Allow adding/removing multiple UsagePlanKeys independently"
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
"explanation": "Enable this feature flag to have elastic file systems encrypted at rest by default."
|
|
512
|
+
"explanation": "Allow adding/removing multiple UsagePlanKeys independently",
|
|
513
|
+
"unconfiguredBehavesLike": {
|
|
514
|
+
"v2": true
|
|
515
|
+
}
|
|
528
516
|
},
|
|
529
517
|
"@aws-cdk/aws-lambda:recognizeVersionProps": {
|
|
530
518
|
"recommendedValue": true,
|
|
531
|
-
"explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`."
|
|
519
|
+
"explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`.",
|
|
520
|
+
"unconfiguredBehavesLike": {
|
|
521
|
+
"v2": true
|
|
522
|
+
}
|
|
532
523
|
},
|
|
533
524
|
"@aws-cdk/aws-lambda:recognizeLayerVersion": {
|
|
534
525
|
"userValue": true,
|
|
@@ -537,7 +528,10 @@
|
|
|
537
528
|
},
|
|
538
529
|
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": {
|
|
539
530
|
"recommendedValue": true,
|
|
540
|
-
"explanation": "Enable this feature flag to have cloudfront distributions use the security policy TLSv1.2_2021 by default."
|
|
531
|
+
"explanation": "Enable this feature flag to have cloudfront distributions use the security policy TLSv1.2_2021 by default.",
|
|
532
|
+
"unconfiguredBehavesLike": {
|
|
533
|
+
"v2": true
|
|
534
|
+
}
|
|
541
535
|
},
|
|
542
536
|
"@aws-cdk/core:checkSecretUsage": {
|
|
543
537
|
"userValue": true,
|
|
@@ -614,7 +608,7 @@
|
|
|
614
608
|
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": {
|
|
615
609
|
"userValue": true,
|
|
616
610
|
"recommendedValue": true,
|
|
617
|
-
"explanation": "Enable this feature to
|
|
611
|
+
"explanation": "Enable this feature to create default policy names for imported roles that depend on the stack the role is in."
|
|
618
612
|
},
|
|
619
613
|
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": {
|
|
620
614
|
"userValue": true,
|
|
@@ -758,7 +752,10 @@
|
|
|
758
752
|
},
|
|
759
753
|
"@aws-cdk/pipelines:reduceAssetRoleTrustScope": {
|
|
760
754
|
"recommendedValue": true,
|
|
761
|
-
"explanation": "Remove the root account principal from PipelineAssetsFileRole trust policy"
|
|
755
|
+
"explanation": "Remove the root account principal from PipelineAssetsFileRole trust policy",
|
|
756
|
+
"unconfiguredBehavesLike": {
|
|
757
|
+
"v2": true
|
|
758
|
+
}
|
|
762
759
|
},
|
|
763
760
|
"@aws-cdk/aws-eks:nodegroupNameAttribute": {
|
|
764
761
|
"userValue": true,
|
|
@@ -787,7 +784,10 @@
|
|
|
787
784
|
},
|
|
788
785
|
"@aws-cdk/aws-stepfunctions-tasks:useNewS3UriParametersForBedrockInvokeModelTask": {
|
|
789
786
|
"recommendedValue": true,
|
|
790
|
-
"explanation": "When enabled, use new props for S3 URI field in task definition of state machine for bedrock invoke model."
|
|
787
|
+
"explanation": "When enabled, use new props for S3 URI field in task definition of state machine for bedrock invoke model.",
|
|
788
|
+
"unconfiguredBehavesLike": {
|
|
789
|
+
"v2": true
|
|
790
|
+
}
|
|
791
791
|
},
|
|
792
792
|
"@aws-cdk/core:explicitStackTags": {
|
|
793
793
|
"userValue": true,
|
|
@@ -851,7 +851,10 @@
|
|
|
851
851
|
},
|
|
852
852
|
"@aws-cdk/core:aspectStabilization": {
|
|
853
853
|
"recommendedValue": true,
|
|
854
|
-
"explanation": "When enabled, a stabilization loop will be run when invoking Aspects during synthesis."
|
|
854
|
+
"explanation": "When enabled, a stabilization loop will be run when invoking Aspects during synthesis.",
|
|
855
|
+
"unconfiguredBehavesLike": {
|
|
856
|
+
"v2": true
|
|
857
|
+
}
|
|
855
858
|
},
|
|
856
859
|
"@aws-cdk/aws-route53-targets:userPoolDomainNameMethodWithoutCustomResource": {
|
|
857
860
|
"userValue": true,
|
|
@@ -885,7 +888,10 @@
|
|
|
885
888
|
},
|
|
886
889
|
"@aws-cdk/pipelines:reduceStageRoleTrustScope": {
|
|
887
890
|
"recommendedValue": true,
|
|
888
|
-
"explanation": "Remove the root account principal from Stage addActions trust policy"
|
|
891
|
+
"explanation": "Remove the root account principal from Stage addActions trust policy",
|
|
892
|
+
"unconfiguredBehavesLike": {
|
|
893
|
+
"v2": true
|
|
894
|
+
}
|
|
889
895
|
},
|
|
890
896
|
"@aws-cdk/aws-events:requireEventBusPolicySid": {
|
|
891
897
|
"userValue": true,
|
|
@@ -908,7 +914,10 @@
|
|
|
908
914
|
},
|
|
909
915
|
"@aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope": {
|
|
910
916
|
"recommendedValue": true,
|
|
911
|
-
"explanation": "When enabled, scopes down the trust policy for the cross-account action role"
|
|
917
|
+
"explanation": "When enabled, scopes down the trust policy for the cross-account action role",
|
|
918
|
+
"unconfiguredBehavesLike": {
|
|
919
|
+
"v2": true
|
|
920
|
+
}
|
|
912
921
|
},
|
|
913
922
|
"@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2": {
|
|
914
923
|
"userValue": true,
|
|
@@ -938,6 +947,21 @@
|
|
|
938
947
|
"userValue": true,
|
|
939
948
|
"recommendedValue": true,
|
|
940
949
|
"explanation": "When enabled, CDK creates and manages loggroup for the lambda function"
|
|
950
|
+
},
|
|
951
|
+
"@aws-cdk/aws-elasticloadbalancingv2:networkLoadBalancerWithSecurityGroupByDefault": {
|
|
952
|
+
"recommendedValue": true,
|
|
953
|
+
"explanation": "When enabled, Network Load Balancer will be created with a security group by default."
|
|
954
|
+
},
|
|
955
|
+
"@aws-cdk/aws-stepfunctions-tasks:httpInvokeDynamicJsonPathEndpoint": {
|
|
956
|
+
"recommendedValue": true,
|
|
957
|
+
"explanation": "When enabled, allows using a dynamic apiEndpoint with JSONPath format in HttpInvoke tasks.",
|
|
958
|
+
"unconfiguredBehavesLike": {
|
|
959
|
+
"v2": true
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
"@aws-cdk/aws-ecs-patterns:uniqueTargetGroupId": {
|
|
963
|
+
"recommendedValue": true,
|
|
964
|
+
"explanation": "When enabled, ECS patterns will generate unique target group IDs to prevent conflicts during load balancer replacement"
|
|
941
965
|
}
|
|
942
966
|
}
|
|
943
967
|
}
|
package/test/integ.template-writer-from-asset.js.snapshot/template-writer-from-asset.assets.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "48.0.0",
|
|
3
3
|
"files": {
|
|
4
4
|
"97cd237b0ae069fe0711bcc6a711e213fdaf0956421de5b964de9ccd0d2b23a1": {
|
|
5
5
|
"displayName": "TemplateAsset",
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"
|
|
60
|
+
"11f4a549abf3d9a1620c7bbb03d9493c231addfeee240a74e7fcbc1e9f4b71bb": {
|
|
61
61
|
"displayName": "template-writer-from-asset Template",
|
|
62
62
|
"source": {
|
|
63
63
|
"path": "template-writer-from-asset.template.json",
|
|
64
64
|
"packaging": "file"
|
|
65
65
|
},
|
|
66
66
|
"destinations": {
|
|
67
|
-
"current_account-current_region-
|
|
67
|
+
"current_account-current_region-55c5fb36": {
|
|
68
68
|
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
|
|
69
|
-
"objectKey": "
|
|
69
|
+
"objectKey": "11f4a549abf3d9a1620c7bbb03d9493c231addfeee240a74e7fcbc1e9f4b71bb.json",
|
|
70
70
|
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"2.206.0"},"children":{"template-writer-from-asset":{"id":"template-writer-from-asset","path":"template-writer-from-asset","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"2.206.0"},"children":{"TemplateAsset":{"id":"TemplateAsset","path":"template-writer-from-asset/TemplateAsset","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.206.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TemplateAsset/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.206.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TemplateAsset/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.206.0","metadata":[]}}}},"TestOutputAsset":{"id":"TestOutputAsset","path":"template-writer-from-asset/TestOutputAsset","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.206.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TestOutputAsset/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.206.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TestOutputAsset/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.206.0","metadata":[]}}}},"LambdaFunctionServiceRole":{"id":"LambdaFunctionServiceRole","path":"template-writer-from-asset/LambdaFunctionServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"2.206.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"inlinePolicies":"*"},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportLambdaFunctionServiceRole":{"id":"ImportLambdaFunctionServiceRole","path":"template-writer-from-asset/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"2.206.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunctionServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"policies":[{"policyName":"LambdaFunctionServiceRolePolicy","policyDocument":{"Statement":[{"Action":["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"],"Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":logs:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":log-group:/aws/lambda/*"]]}}],"Version":"2012-10-17"}}]}}}}},"LambdaFunction":{"id":"LambdaFunction","path":"template-writer-from-asset/LambdaFunction","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"2.206.0","metadata":[{"role":"*","tracing":"Active","runtime":"*","handler":"*","code":"*","timeout":"*","memorySize":"*"},{"addEnvironment":["*","*",{"removeInEdge":true}]}]},"children":{"Code":{"id":"Code","path":"template-writer-from-asset/LambdaFunction/Code","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.206.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/LambdaFunction/Code/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.206.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/LambdaFunction/Code/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.206.0","metadata":[]}}}},"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunction/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"s3Bucket":{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"s3Key":"b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d.zip"},"environment":{"variables":{"AWS_NODEJS_CONNECTION_REUSE_ENABLED":"1"}},"handler":"index.handler","role":{"Fn::GetAtt":["LambdaFunctionServiceRole0C4CDE0B","Arn"]},"runtime":"nodejs20.x","tracingConfig":{"mode":"Active"}}}},"inlinePolicyAddedToExecutionRole-0":{"id":"inlinePolicyAddedToExecutionRole-0","path":"template-writer-from-asset/LambdaFunction/inlinePolicyAddedToExecutionRole-0","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.206.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunction/inlinePolicyAddedToExecutionRole-0/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":["xray:PutTelemetryRecords","xray:PutTraceSegments"],"Effect":"Allow","Resource":"*"}],"Version":"2012-10-17"},"policyName":"LambdaFunctioninlinePolicyAddedToExecutionRole007875684","roles":[{"Ref":"LambdaFunctionServiceRole0C4CDE0B"}]}}}}}}},"TestTemplateWriterPolicy":{"id":"TestTemplateWriterPolicy","path":"template-writer-from-asset/TestTemplateWriterPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.206.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"s3:GetObject","Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"/97cd237b0ae069fe0711bcc6a711e213fdaf0956421de5b964de9ccd0d2b23a1.97cd237b0ae069fe0711bcc6a711e213fdaf0956421de5b964de9ccd0d2b23a1"]]}},{"Action":"s3:PutObject","Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"/*"]]}}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterPolicy8177DE02","roles":[{"Ref":"LambdaFunctionServiceRole0C4CDE0B"}]}}}}},"TestTemplateWriterProvider":{"id":"TestTemplateWriterProvider","path":"template-writer-from-asset/TestTemplateWriterProvider","constructInfo":{"fqn":"aws-cdk-lib.custom_resources.Provider","version":"2.206.0"},"children":{"framework-onEvent":{"id":"framework-onEvent","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"2.206.0","metadata":[{"code":"*","description":"*","runtime":"*","handler":"*","timeout":"*","logFormat":"*","applicationLogLevelV2":"FATAL","logGroup":"*","vpc":"*","vpcSubnets":"*","securityGroups":"*","role":"*","functionName":"*","environmentEncryption":"*"},{"addEnvironment":["*","*"]}]},"children":{"ServiceRole":{"id":"ServiceRole","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"2.206.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]},{"addToPrincipalPolicy":[{}]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"2.206.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]]}]}}},"DefaultPolicy":{"id":"DefaultPolicy","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/DefaultPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.206.0","metadata":["*",{"attachToRole":["*"]},{"attachToRole":["*"]},{"addStatements":[{}]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:InvokeFunction","Effect":"Allow","Resource":[{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]},{"Fn::Join":["",[{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]},":*"]]}]}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterProviderframeworkonEventServiceRoleDefaultPolicy08B90D53","roles":[{"Ref":"TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A"}]}}}}}}},"Code":{"id":"Code","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.206.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.206.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.206.0","metadata":[]}}}},"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"s3Bucket":{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"s3Key":"bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca.zip"},"description":"AWS CDK resource provider framework - onEvent (template-writer-from-asset/TestTemplateWriterProvider)","environment":{"variables":{"USER_ON_EVENT_FUNCTION_ARN":{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]}}},"handler":"framework.onEvent","loggingConfig":{"logFormat":"JSON","applicationLogLevel":"FATAL"},"role":{"Fn::GetAtt":["TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A","Arn"]},"runtime":"nodejs22.x","timeout":900}}},"inlinePolicyAddedToExecutionRole-0":{"id":"inlinePolicyAddedToExecutionRole-0","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/inlinePolicyAddedToExecutionRole-0","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.206.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/inlinePolicyAddedToExecutionRole-0/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.206.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:GetFunction","Effect":"Allow","Resource":{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]}}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterProviderframeworkonEventinlinePolicyAddedToExecutionRole08CC44E87","roles":[{"Ref":"TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A"}]}}}}}}}}},"TestTemplateWriterCustomResource":{"id":"TestTemplateWriterCustomResource","path":"template-writer-from-asset/TestTemplateWriterCustomResource","constructInfo":{"fqn":"aws-cdk-lib.CustomResource","version":"2.206.0","metadata":["*","*","*"]},"children":{"Default":{"id":"Default","path":"template-writer-from-asset/TestTemplateWriterCustomResource/Default","constructInfo":{"fqn":"aws-cdk-lib.CfnResource","version":"2.206.0"}}}},"Integ":{"id":"Integ","path":"template-writer-from-asset/Integ","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"2.206.0-alpha.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"template-writer-from-asset/Integ/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"2.206.0-alpha.0"},"children":{"Default":{"id":"Default","path":"template-writer-from-asset/Integ/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"2.206.0"},"children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"2.206.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"2.206.0"}}}}}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"template-writer-from-asset/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"2.206.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"template-writer-from-asset/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"2.206.0"}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}}}}
|
|
1
|
+
{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"2.223.0"},"children":{"template-writer-from-asset":{"id":"template-writer-from-asset","path":"template-writer-from-asset","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"2.223.0"},"children":{"TemplateAsset":{"id":"TemplateAsset","path":"template-writer-from-asset/TemplateAsset","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.223.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TemplateAsset/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.223.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TemplateAsset/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.223.0","metadata":[]}}}},"TestOutputAsset":{"id":"TestOutputAsset","path":"template-writer-from-asset/TestOutputAsset","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.223.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TestOutputAsset/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.223.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TestOutputAsset/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.223.0","metadata":[]}}}},"LambdaFunctionServiceRole":{"id":"LambdaFunctionServiceRole","path":"template-writer-from-asset/LambdaFunctionServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"2.223.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"inlinePolicies":"*"},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportLambdaFunctionServiceRole":{"id":"ImportLambdaFunctionServiceRole","path":"template-writer-from-asset/LambdaFunctionServiceRole/ImportLambdaFunctionServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"2.223.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunctionServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"policies":[{"policyName":"LambdaFunctionServiceRolePolicy","policyDocument":{"Statement":[{"Action":["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"],"Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":logs:",{"Ref":"AWS::Region"},":",{"Ref":"AWS::AccountId"},":log-group:/aws/lambda/*"]]}}],"Version":"2012-10-17"}}]}}}}},"LambdaFunction":{"id":"LambdaFunction","path":"template-writer-from-asset/LambdaFunction","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"2.223.0","metadata":[{"role":"*","tracing":"Active","runtime":"*","handler":"*","code":"*","timeout":"*","memorySize":"*"},{"addEnvironment":["*","*",{"removeInEdge":true}]}]},"children":{"Code":{"id":"Code","path":"template-writer-from-asset/LambdaFunction/Code","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.223.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/LambdaFunction/Code/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.223.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/LambdaFunction/Code/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.223.0","metadata":[]}}}},"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunction/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"s3Bucket":{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"s3Key":"b670072ae403f5d0f7c4ac0413a63bb9f093a32fd1620d0908d53ce809c7575d.zip"},"environment":{"variables":{"AWS_NODEJS_CONNECTION_REUSE_ENABLED":"1"}},"handler":"index.handler","role":{"Fn::GetAtt":["LambdaFunctionServiceRole0C4CDE0B","Arn"]},"runtime":"nodejs22.x","tracingConfig":{"mode":"Active"}}}},"inlinePolicyAddedToExecutionRole-0":{"id":"inlinePolicyAddedToExecutionRole-0","path":"template-writer-from-asset/LambdaFunction/inlinePolicyAddedToExecutionRole-0","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.223.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/LambdaFunction/inlinePolicyAddedToExecutionRole-0/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":["xray:PutTelemetryRecords","xray:PutTraceSegments"],"Effect":"Allow","Resource":"*"}],"Version":"2012-10-17"},"policyName":"LambdaFunctioninlinePolicyAddedToExecutionRole007875684","roles":[{"Ref":"LambdaFunctionServiceRole0C4CDE0B"}]}}}}}}},"TestTemplateWriterPolicy":{"id":"TestTemplateWriterPolicy","path":"template-writer-from-asset/TestTemplateWriterPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.223.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"s3:GetObject","Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"/97cd237b0ae069fe0711bcc6a711e213fdaf0956421de5b964de9ccd0d2b23a1.97cd237b0ae069fe0711bcc6a711e213fdaf0956421de5b964de9ccd0d2b23a1"]]}},{"Action":"s3:PutObject","Effect":"Allow","Resource":{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"/*"]]}}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterPolicy8177DE02","roles":[{"Ref":"LambdaFunctionServiceRole0C4CDE0B"}]}}}}},"TestTemplateWriterProvider":{"id":"TestTemplateWriterProvider","path":"template-writer-from-asset/TestTemplateWriterProvider","constructInfo":{"fqn":"aws-cdk-lib.custom_resources.Provider","version":"2.223.0"},"children":{"framework-onEvent":{"id":"framework-onEvent","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"2.223.0","metadata":[{"code":"*","description":"*","runtime":"*","handler":"*","timeout":"*","loggingFormat":"JSON","applicationLogLevelV2":"FATAL","logGroup":"*","vpc":"*","vpcSubnets":"*","securityGroups":"*","role":"*","functionName":"*","environmentEncryption":"*"},{"addEnvironment":["*","*"]}]},"children":{"ServiceRole":{"id":"ServiceRole","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"2.223.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]},{"addToPrincipalPolicy":[{}]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"2.223.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"]]}]}}},"DefaultPolicy":{"id":"DefaultPolicy","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/DefaultPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.223.0","metadata":["*",{"attachToRole":["*"]},{"attachToRole":["*"]},{"addStatements":[{}]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:InvokeFunction","Effect":"Allow","Resource":[{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]},{"Fn::Join":["",[{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]},":*"]]}]}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterProviderframeworkonEventServiceRoleDefaultPolicy08B90D53","roles":[{"Ref":"TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A"}]}}}}}}},"Code":{"id":"Code","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code","constructInfo":{"fqn":"aws-cdk-lib.aws_s3_assets.Asset","version":"2.223.0"},"children":{"Stage":{"id":"Stage","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code/Stage","constructInfo":{"fqn":"aws-cdk-lib.AssetStaging","version":"2.223.0"}},"AssetBucket":{"id":"AssetBucket","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Code/AssetBucket","constructInfo":{"fqn":"aws-cdk-lib.aws_s3.BucketBase","version":"2.223.0","metadata":[]}}}},"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"s3Bucket":{"Fn::Sub":"cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"},"s3Key":"bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca.zip"},"description":"AWS CDK resource provider framework - onEvent (template-writer-from-asset/TestTemplateWriterProvider)","environment":{"variables":{"USER_ON_EVENT_FUNCTION_ARN":{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]}}},"handler":"framework.onEvent","loggingConfig":{"logFormat":"JSON","applicationLogLevel":"FATAL"},"role":{"Fn::GetAtt":["TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A","Arn"]},"runtime":"nodejs22.x","timeout":900}}},"inlinePolicyAddedToExecutionRole-0":{"id":"inlinePolicyAddedToExecutionRole-0","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/inlinePolicyAddedToExecutionRole-0","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"2.223.0","metadata":[{"statements":"*"},{"addStatements":[{}]},{"attachToRole":["*"]},{"attachToRole":["*"]}]},"children":{"Resource":{"id":"Resource","path":"template-writer-from-asset/TestTemplateWriterProvider/framework-onEvent/inlinePolicyAddedToExecutionRole-0/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"2.223.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:GetFunction","Effect":"Allow","Resource":{"Fn::GetAtt":["LambdaFunctionBF21E41F","Arn"]}}],"Version":"2012-10-17"},"policyName":"TestTemplateWriterProviderframeworkonEventinlinePolicyAddedToExecutionRole08CC44E87","roles":[{"Ref":"TestTemplateWriterProviderframeworkonEventServiceRoleED11CF9A"}]}}}}}}}}},"TestTemplateWriterCustomResource":{"id":"TestTemplateWriterCustomResource","path":"template-writer-from-asset/TestTemplateWriterCustomResource","constructInfo":{"fqn":"aws-cdk-lib.CustomResource","version":"2.223.0","metadata":["*","*","*"]},"children":{"Default":{"id":"Default","path":"template-writer-from-asset/TestTemplateWriterCustomResource/Default","constructInfo":{"fqn":"aws-cdk-lib.CfnResource","version":"2.223.0"}}}},"Integ":{"id":"Integ","path":"template-writer-from-asset/Integ","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"2.223.0-alpha.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"template-writer-from-asset/Integ/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"2.223.0-alpha.0"},"children":{"Default":{"id":"Default","path":"template-writer-from-asset/Integ/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"2.223.0"},"children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"2.223.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"template-writer-from-asset/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"2.223.0"}}}}}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"template-writer-from-asset/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"2.223.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"template-writer-from-asset/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"2.223.0"}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}}}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
export declare const handler: (event: any, context: any) => Promise<{
|
|
14
|
+
Status: string;
|
|
15
|
+
Reason: string;
|
|
16
|
+
PhysicalResourceId: any;
|
|
17
|
+
StackId: any;
|
|
18
|
+
RequestId: any;
|
|
19
|
+
LogicalResourceId: any;
|
|
20
|
+
Data: {};
|
|
21
|
+
}>;
|
|
22
|
+
export declare function replaceTarget(template: string | undefined, templateValue: any): string | undefined;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
6
|
+
* with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
11
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.handler = void 0;
|
|
16
|
+
exports.replaceTarget = replaceTarget;
|
|
17
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
18
|
+
const crypto = require("crypto");
|
|
19
|
+
const s3Client = new client_s3_1.S3Client({ region: process.env.REGION });
|
|
20
|
+
const handler = async (event, context) => {
|
|
21
|
+
let status = 'SUCCESS';
|
|
22
|
+
let responseData = {};
|
|
23
|
+
// These are the standard Create/Update/Delete custom resource request types defined here:
|
|
24
|
+
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requesttypes.html
|
|
25
|
+
if (event.RequestType === 'Create' || event.RequestType === 'Update') {
|
|
26
|
+
try {
|
|
27
|
+
const templateValues = JSON.parse(event.ResourceProperties.TemplateValues).templateValues;
|
|
28
|
+
const templateInputBucket = event.ResourceProperties.TemplateInputBucket;
|
|
29
|
+
const templateInputKey = event.ResourceProperties.TemplateInputKey;
|
|
30
|
+
const templateOutputBucket = event.ResourceProperties.TemplateOutputBucket;
|
|
31
|
+
const templateOutputKey = crypto.randomBytes(32).toString('hex');
|
|
32
|
+
const getObjectResponse = await s3Client.send(new client_s3_1.GetObjectCommand({
|
|
33
|
+
Bucket: templateInputBucket,
|
|
34
|
+
Key: templateInputKey
|
|
35
|
+
}));
|
|
36
|
+
let template = await getObjectResponse.Body?.transformToString();
|
|
37
|
+
templateValues.forEach((templateValue) => {
|
|
38
|
+
template = replaceTarget(template, templateValue);
|
|
39
|
+
});
|
|
40
|
+
await s3Client.send(new client_s3_1.PutObjectCommand({
|
|
41
|
+
Bucket: templateOutputBucket,
|
|
42
|
+
Key: templateOutputKey,
|
|
43
|
+
Body: template
|
|
44
|
+
}));
|
|
45
|
+
responseData = {
|
|
46
|
+
TemplateOutputKey: templateOutputKey
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
status = 'FAILED';
|
|
51
|
+
responseData = {
|
|
52
|
+
Error: err
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
Status: status,
|
|
58
|
+
Reason: JSON.stringify(responseData),
|
|
59
|
+
PhysicalResourceId: event.PhysicalResourceId ?? context.logStreamName,
|
|
60
|
+
StackId: event.StackId,
|
|
61
|
+
RequestId: event.RequestId,
|
|
62
|
+
LogicalResourceId: event.LogicalResourceId,
|
|
63
|
+
Data: responseData,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.handler = handler;
|
|
67
|
+
function replaceTarget(template, templateValue) {
|
|
68
|
+
template = template?.replace(new RegExp(`\\b${templateValue.id}\\b`, 'g'), templateValue.value);
|
|
69
|
+
return template;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7O0dBV0c7OztBQTRESCxzQ0FNQztBQWhFRCxrREFBa0Y7QUFDbEYsaUNBQWlDO0FBRWpDLE1BQU0sUUFBUSxHQUFHLElBQUksb0JBQVEsQ0FBQyxFQUFFLE1BQU0sRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7QUFFdkQsTUFBTSxPQUFPLEdBQUcsS0FBSyxFQUFFLEtBQVUsRUFBRSxPQUFZLEVBQUUsRUFBRTtJQUN4RCxJQUFJLE1BQU0sR0FBRyxTQUFTLENBQUM7SUFDdkIsSUFBSSxZQUFZLEdBQUcsRUFBR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Ti5zdHJpbmdpZnkocmVzcG9uc2VEYXRhKSxcbiAgICBQaHlzaWNhbFJlc291cmNlSWQ6IGV2ZW50LlBoeXNpY2FsUmVzb3VyY2VJZCA/PyBjb250ZXh0LmxvZ1N0cmVhbU5hbWUsXG4gICAgU3RhY2tJZDogZXZlbnQuU3RhY2tJZCxcbiAgICBSZXF1ZXN0SWQ6IGV2ZW50LlJlcXVlc3RJZCxcbiAgICBMb2dpY2FsUmVzb3VyY2VJZDogZXZlbnQuTG9naWNhbFJlc291cmNlSWQsXG4gICAgRGF0YTogcmVzcG9uc2VEYXRhLFxuICB9O1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIHJlcGxhY2VUYXJnZXQodGVtcGxhdGU6IHN0cmluZyB8IHVuZGVmaW5lZCwgdGVtcGxhdGVWYWx1ZTogYW55KSB7XG4gIHRlbXBsYXRlID0gdGVtcGxhdGU/LnJlcGxhY2UoXG4gICAgbmV3IFJlZ0V4cChgXFxcXGIke3RlbXBsYXRlVmFsdWUuaWR9XFxcXGJgLCAnZycpLFxuICAgIHRlbXBsYXRlVmFsdWUudmFsdWVcbiAgKTtcbiAgcmV0dXJuIHRlbXBsYXRlO1xufVxuIl19
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"48.0.0"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "48.0.0",
|
|
3
3
|
"testCases": {
|
|
4
4
|
"template-writer-from-large-asset/Integ/DefaultTest": {
|
|
5
5
|
"stacks": [
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"assertionStackName": "templatewriterfromlargeassetIntegDefaultTestDeployAssertA02D2FEC"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"minimumCliVersion": "2.
|
|
12
|
+
"minimumCliVersion": "2.1029.2"
|
|
13
13
|
}
|