raindancers-cloudfront 0.0.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/LICENSE +202 -0
- package/README.md +176 -0
- package/lib/bicep/deploy/deploy.d.ts +46 -0
- package/lib/bicep/deploy/deploy.js +123 -0
- package/lib/bicep/deploy/index.d.ts +3 -0
- package/lib/bicep/deploy/index.js +20 -0
- package/lib/bicep/deploy/template.d.ts +75 -0
- package/lib/bicep/deploy/template.js +364 -0
- package/lib/bicep/deploy/templateBuilder.d.ts +16 -0
- package/lib/bicep/deploy/templateBuilder.js +35 -0
- package/lib/bicep/index.d.ts +3 -0
- package/lib/bicep/index.js +40 -0
- package/lib/bicep/patterns/azureAdApplicationFederated.d.ts +58 -0
- package/lib/bicep/patterns/azureAdApplicationFederated.js +317 -0
- package/lib/bicep/patterns/index.d.ts +1 -0
- package/lib/bicep/patterns/index.js +18 -0
- package/lib/bicep/resources/azure/appServicePlan.d.ts +11 -0
- package/lib/bicep/resources/azure/appServicePlan.js +24 -0
- package/lib/bicep/resources/azure/applicationInsights.d.ts +13 -0
- package/lib/bicep/resources/azure/applicationInsights.js +27 -0
- package/lib/bicep/resources/azure/deploymentScript.d.ts +16 -0
- package/lib/bicep/resources/azure/deploymentScript.js +43 -0
- package/lib/bicep/resources/azure/functionApp.d.ts +20 -0
- package/lib/bicep/resources/azure/functionApp.js +54 -0
- package/lib/bicep/resources/azure/index.d.ts +8 -0
- package/lib/bicep/resources/azure/index.js +25 -0
- package/lib/bicep/resources/azure/logAnalyticsWorkspace.d.ts +11 -0
- package/lib/bicep/resources/azure/logAnalyticsWorkspace.js +26 -0
- package/lib/bicep/resources/azure/managedIdentity.d.ts +13 -0
- package/lib/bicep/resources/azure/managedIdentity.js +24 -0
- package/lib/bicep/resources/azure/roleAssignment.d.ts +18 -0
- package/lib/bicep/resources/azure/roleAssignment.js +34 -0
- package/lib/bicep/resources/azure/storageAccount.d.ts +11 -0
- package/lib/bicep/resources/azure/storageAccount.js +28 -0
- package/lib/bicep/resources/graph/appRoleAssignment.d.ts +25 -0
- package/lib/bicep/resources/graph/appRoleAssignment.js +33 -0
- package/lib/bicep/resources/graph/application.d.ts +51 -0
- package/lib/bicep/resources/graph/application.js +88 -0
- package/lib/bicep/resources/graph/bicepConstruct.d.ts +14 -0
- package/lib/bicep/resources/graph/bicepConstruct.js +29 -0
- package/lib/bicep/resources/graph/existingServicePrincipal.d.ts +19 -0
- package/lib/bicep/resources/graph/existingServicePrincipal.js +26 -0
- package/lib/bicep/resources/graph/federatedIdentityCredential.d.ts +29 -0
- package/lib/bicep/resources/graph/federatedIdentityCredential.js +31 -0
- package/lib/bicep/resources/graph/group.d.ts +26 -0
- package/lib/bicep/resources/graph/group.js +31 -0
- package/lib/bicep/resources/graph/index.d.ts +8 -0
- package/lib/bicep/resources/graph/index.js +25 -0
- package/lib/bicep/resources/graph/servicePrincipal.d.ts +22 -0
- package/lib/bicep/resources/graph/servicePrincipal.js +27 -0
- package/lib/bicep/resources/graph/types/index.d.ts +1 -0
- package/lib/bicep/resources/graph/types/index.js +18 -0
- package/lib/bicep/resources/graph/types/permissions.d.ts +54 -0
- package/lib/bicep/resources/graph/types/permissions.js +73 -0
- package/lib/bicep/resources/index.d.ts +2 -0
- package/lib/bicep/resources/index.js +39 -0
- package/lib/cloudfront/auth/authLambdaFunctions.d.ts +20 -0
- package/lib/cloudfront/auth/authLambdaFunctions.js +159 -0
- package/lib/cloudfront/auth/authSecretManager.d.ts +19 -0
- package/lib/cloudfront/auth/authSecretManager.js +92 -0
- package/lib/cloudfront/auth/cognitoAuthSecretManager.d.ts +20 -0
- package/lib/cloudfront/auth/cognitoAuthSecretManager.js +93 -0
- package/lib/cloudfront/auth/index.d.ts +3 -0
- package/lib/cloudfront/auth/index.js +20 -0
- package/lib/cloudfront/authSecurityTable.d.ts +10 -0
- package/lib/cloudfront/authSecurityTable.js +78 -0
- package/lib/cloudfront/cloudfront-functions/function-composer.d.ts +21 -0
- package/lib/cloudfront/cloudfront-functions/function-composer.js +132 -0
- package/lib/cloudfront/cloudfrontCertificate.d.ts +40 -0
- package/lib/cloudfront/cloudfrontCertificate.js +116 -0
- package/lib/cloudfront/cloudfrontWebAcl.d.ts +72 -0
- package/lib/cloudfront/cloudfrontWebAcl.js +249 -0
- package/lib/cloudfront/countries.d.ts +260 -0
- package/lib/cloudfront/countries.js +263 -0
- package/lib/cloudfront/deployment/viteFrontendDeployment.d.ts +12 -0
- package/lib/cloudfront/deployment/viteFrontendDeployment.js +63 -0
- package/lib/cloudfront/index.d.ts +11 -0
- package/lib/cloudfront/index.js +28 -0
- package/lib/cloudfront/jwtDecoder.d.ts +5 -0
- package/lib/cloudfront/jwtDecoder.js +57 -0
- package/lib/cloudfront/logging/auditLogArchive.d.ts +18 -0
- package/lib/cloudfront/logging/auditLogArchive.js +205 -0
- package/lib/cloudfront/logging/index.d.ts +1 -0
- package/lib/cloudfront/logging/index.js +18 -0
- package/lib/cloudfront/oauthEdgeRole.d.ts +9 -0
- package/lib/cloudfront/oauthEdgeRole.js +56 -0
- package/lib/cloudfront/patterns/authInfrastructure.d.ts +34 -0
- package/lib/cloudfront/patterns/authInfrastructure.js +140 -0
- package/lib/cloudfront/patterns/cognito-secured-cloudfront.d.ts +36 -0
- package/lib/cloudfront/patterns/cognito-secured-cloudfront.js +285 -0
- package/lib/cloudfront/patterns/cognitoAuthInfrastructure.d.ts +28 -0
- package/lib/cloudfront/patterns/cognitoAuthInfrastructure.js +157 -0
- package/lib/cloudfront/patterns/index.d.ts +4 -0
- package/lib/cloudfront/patterns/index.js +21 -0
- package/lib/cloudfront/patterns/securedCloudFront.d.ts +73 -0
- package/lib/cloudfront/patterns/securedCloudFront.js +416 -0
- package/lib/cloudfront/ssmCrossRegionWriter.d.ts +9 -0
- package/lib/cloudfront/ssmCrossRegionWriter.js +65 -0
- package/lib/cloudfront/syncSecretToKvs.d.ts +9 -0
- package/lib/cloudfront/syncSecretToKvs.js +89 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +19 -0
- package/package.json +105 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# DevContainer Setup.
|
|
2
|
+
|
|
3
|
+
This directory contains the configuration and setup scripts for the development container environment.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The devcontainer is based on the TypeScript/Node.js 22 image and includes AWS development tools, Python, and Docker support.
|
|
8
|
+
|
|
9
|
+
## WSL2 Setup for Optimal Performance
|
|
10
|
+
|
|
11
|
+
**Recommended**: Clone and work with this repository directly in WSL2 for significantly better performance (5-10x faster than Windows filesystem access).
|
|
12
|
+
|
|
13
|
+
### Prerequisites
|
|
14
|
+
- Windows 10/11 with WSL2 enabled
|
|
15
|
+
- Docker Desktop for Windows with WSL2 backend enabled
|
|
16
|
+
- VS Code with Remote Development extension pack installed
|
|
17
|
+
|
|
18
|
+
### Setup Steps
|
|
19
|
+
|
|
20
|
+
1. **Open a WSL2 terminal** (e.g., Ubuntu from Windows Terminal)
|
|
21
|
+
|
|
22
|
+
2. **Clone the repository in WSL2 filesystem**:
|
|
23
|
+
```bash
|
|
24
|
+
cd ~
|
|
25
|
+
git clone <repository-url>
|
|
26
|
+
cd cdk-api
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. **Open in VS Code**:
|
|
30
|
+
```bash
|
|
31
|
+
code .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
4. **Reopen in Container**: When prompted by VS Code, click "Reopen in Container"
|
|
35
|
+
- Or use Command Palette: `Dev Containers: Reopen in Container`
|
|
36
|
+
|
|
37
|
+
### GitHub CLI Setup
|
|
38
|
+
|
|
39
|
+
If you need to clone private repositories or authenticate with GitHub from within WSL2, you may need to install GitHub CLI:
|
|
40
|
+
|
|
41
|
+
1. **Open Windows Terminal and access your WSL2 distro as root**:
|
|
42
|
+
```bash
|
|
43
|
+
wsl -u root
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. **Install GitHub CLI**:
|
|
47
|
+
```bash
|
|
48
|
+
apt update && apt install gh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. **Exit root and authenticate** (as your regular user):
|
|
52
|
+
```bash
|
|
53
|
+
exit
|
|
54
|
+
gh auth login
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Follow the prompts and select:
|
|
58
|
+
- **GitHub.com**
|
|
59
|
+
- **HTTPS** protocol
|
|
60
|
+
- **Login with a web browser** (device code flow)
|
|
61
|
+
- Copy the one-time code and press Enter to open the browser
|
|
62
|
+
- Paste the code in GitHub to complete authentication
|
|
63
|
+
|
|
64
|
+
**Note**: This installs `gh` in your WSL2 distro, not in the devcontainer. The devcontainer will inherit your WSL2 git credentials when cloning repositories.
|
|
65
|
+
|
|
66
|
+
### Verify Your Setup
|
|
67
|
+
|
|
68
|
+
To confirm you're running with optimal performance:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Check filesystem type (should show ext4, not 9p)
|
|
72
|
+
df -h /workspaces/cdk-api
|
|
73
|
+
|
|
74
|
+
# Check kernel (should show WSL2)
|
|
75
|
+
uname -a
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Expected output**: `/dev/sd*` device with `ext4` filesystem and `microsoft-standard-WSL2` kernel.
|
|
79
|
+
|
|
80
|
+
### Architecture
|
|
81
|
+
|
|
82
|
+
Your development environment runs as: **Windows → WSL2 → Docker → Dev Container**
|
|
83
|
+
|
|
84
|
+
- Files are stored natively in WSL2's ext4 filesystem (not Windows NTFS)
|
|
85
|
+
- Docker engine runs in WSL2
|
|
86
|
+
- Dev container runs in Docker with direct access to WSL2 filesystem
|
|
87
|
+
- Result: Native Linux I/O performance for operations like `npm install` and `yarn`
|
|
88
|
+
|
|
89
|
+
### Note on Remote Explorer
|
|
90
|
+
|
|
91
|
+
The devcontainer will appear under **Dev Containers** in VS Code Remote Explorer, not under WSL Targets. This is correct - you're connected to the container, which is hosted by Docker in WSL2.
|
|
92
|
+
|
|
93
|
+
## Setup Process
|
|
94
|
+
|
|
95
|
+
When the devcontainer is created, the `postCreateCommand` runs:
|
|
96
|
+
```bash
|
|
97
|
+
chmod +x .devcontainer/setup.sh .devcontainer/scripts/*.sh && .devcontainer/setup.sh
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This command:
|
|
101
|
+
1. Makes all shell scripts executable (`chmod +x`)
|
|
102
|
+
2. Runs the main setup script (`setup.sh`) only if the chmod succeeds (`&&`)
|
|
103
|
+
|
|
104
|
+
## What Gets Installed
|
|
105
|
+
|
|
106
|
+
### Base Features
|
|
107
|
+
- **TypeScript/Node.js 22**: Main development environment
|
|
108
|
+
- **AWS CLI**: Command line interface for AWS services
|
|
109
|
+
- **Docker-in-Docker**: Ability to run Docker containers within the devcontainer
|
|
110
|
+
- **Python**: Python runtime and tools
|
|
111
|
+
|
|
112
|
+
### VS Code Extensions
|
|
113
|
+
- TypeScript language support
|
|
114
|
+
- AWS Toolkit for VS Code
|
|
115
|
+
- Amazon Q for VS Code
|
|
116
|
+
- GitHub Actions support
|
|
117
|
+
- JSON language support
|
|
118
|
+
- Python language support and linting
|
|
119
|
+
|
|
120
|
+
### Setup Scripts
|
|
121
|
+
|
|
122
|
+
The main `setup.sh` orchestrates the following individual setup scripts:
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
#### 2. Dependencies Installation (`scripts/install-deps.sh`)
|
|
126
|
+
- Runs `yarn install` to install project dependencies
|
|
127
|
+
|
|
128
|
+
#### 3. AWS Setup (`scripts/aws-setup.sh`)
|
|
129
|
+
- Creates AWS configuration directory
|
|
130
|
+
- Sets up AWS SSO profile configuration
|
|
131
|
+
- Configures default region (ap-southeast-2)
|
|
132
|
+
- **Note**: Contains placeholder values that need to be updated
|
|
133
|
+
|
|
134
|
+
#### 4. MCP Setup (`scripts/mcp-setup.sh`)
|
|
135
|
+
- Configures Model Context Protocol for Amazon Q
|
|
136
|
+
- Sets up filesystem, git, and AWS MCP servers
|
|
137
|
+
- Creates configuration in `~/.config/amazonq/mcp.json`
|
|
138
|
+
|
|
139
|
+
## Configuration Files
|
|
140
|
+
|
|
141
|
+
- `devcontainer.json`: Main devcontainer configuration
|
|
142
|
+
- `setup.sh`: Main setup orchestrator
|
|
143
|
+
- `scripts/`: Individual setup scripts for different components
|
|
144
|
+
|
|
145
|
+
## User
|
|
146
|
+
|
|
147
|
+
The container runs as the `node` user for several important reasons:
|
|
148
|
+
- **Security**: Avoids running as root, following the principle of least privilege
|
|
149
|
+
- **Compatibility**: Pre-configured with proper permissions for Node.js development and NPM/Yarn package management
|
|
150
|
+
- **Standards**: Follows Node.js Docker image conventions and integrates well with VS Code devcontainers
|
|
151
|
+
- **Environment**: Provides a proper home directory (`/home/node`) for configuration files and shell access
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Known Issues
|
|
155
|
+
|
|
156
|
+
### MCP Setup
|
|
157
|
+
The Model Context Protocol (MCP) setup is not 100% configured correctly. Some manual configuration may be required after the devcontainer is created.
|
|
158
|
+
|
|
159
|
+
### Git LFS
|
|
160
|
+
The repository is configured for Git LFS but `git-lfs` is not installed in the devcontainer. You may see warnings about missing Git LFS. To resolve, either:
|
|
161
|
+
- Install Git LFS: `sudo apt-get update && sudo apt-get install git-lfs`
|
|
162
|
+
- Or remove Git LFS hooks if not needed: `rm .git/hooks/post-commit`
|
|
163
|
+
|
|
164
|
+
## Logs
|
|
165
|
+
|
|
166
|
+
Setup progress is logged to `~/setup.log` for troubleshooting.
|
|
167
|
+
|
|
168
|
+
## Customization
|
|
169
|
+
|
|
170
|
+
To modify the setup:
|
|
171
|
+
1. Edit the relevant script in the `scripts/` directory
|
|
172
|
+
2. Update AWS configuration in `aws-setup.sh` with your actual values
|
|
173
|
+
3. Modify NPM configuration in `npm-setup.sh` if using different registries
|
|
174
|
+
4. Rebuild the devcontainer to apply changes
|
|
175
|
+
|
|
176
|
+
**Adding New Scripts**: You can create additional setup scripts in the `scripts/` directory. They will automatically be made executable by the `postCreateCommand`. Remember to call your new script from `setup.sh` to include it in the setup process.template
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as core from 'aws-cdk-lib';
|
|
2
|
+
import { aws_iam as iam } from 'aws-cdk-lib';
|
|
3
|
+
import * as constructs from 'constructs';
|
|
4
|
+
export interface AzureFederatedCredentials {
|
|
5
|
+
readonly clientId: string;
|
|
6
|
+
readonly tenantId: string;
|
|
7
|
+
readonly subscriptionId: string;
|
|
8
|
+
readonly lambdaRoleName: string;
|
|
9
|
+
readonly spObjectId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FunctionCodeProps {
|
|
12
|
+
readonly s3BucketName: string;
|
|
13
|
+
readonly s3ObjectKey: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BicepDeploymentProps {
|
|
16
|
+
readonly template: string;
|
|
17
|
+
readonly parameters?: Record<string, string>;
|
|
18
|
+
readonly azureFederatedCredentials: AzureFederatedCredentials;
|
|
19
|
+
readonly resourceGroupName: string;
|
|
20
|
+
readonly deploymentName?: string;
|
|
21
|
+
readonly cloudformationStackArn?: string;
|
|
22
|
+
readonly functionCode?: FunctionCodeProps;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Deploys Azure Bicep templates via CloudFormation Custom Resource.
|
|
26
|
+
*
|
|
27
|
+
* This construct uses a Docker-based Lambda function because Azure CLI and Bicep
|
|
28
|
+
* exceed Lambda's 250MB deployment package limit (~170MB combined). Docker Lambda
|
|
29
|
+
* provides a 10GB image size limit, allowing us to pre-install Azure CLI and Bicep
|
|
30
|
+
* in the container image.
|
|
31
|
+
*
|
|
32
|
+
* The Lambda executes `az deployment group create` to deploy Bicep templates and
|
|
33
|
+
* returns outputs to CloudFormation, enabling atomic multi-cloud deployments where
|
|
34
|
+
* AWS resources can depend on Azure resources within a single CDK stack.
|
|
35
|
+
*
|
|
36
|
+
* For simple Azure AD operations (app registrations, etc.), consider using the
|
|
37
|
+
* SOP (Standard Operating Procedure) pattern instead, which makes direct Graph API
|
|
38
|
+
* calls without requiring Azure CLI or Docker.
|
|
39
|
+
*/
|
|
40
|
+
export declare class BicepDeployment extends constructs.Construct {
|
|
41
|
+
readonly customResource: core.CustomResource;
|
|
42
|
+
readonly outputs: Record<string, string>;
|
|
43
|
+
readonly lambdaRole: iam.IRole;
|
|
44
|
+
constructor(scope: constructs.Construct, id: string, props: BicepDeploymentProps);
|
|
45
|
+
getOutput(key: string): string;
|
|
46
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BicepDeployment = void 0;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const core = __importStar(require("aws-cdk-lib"));
|
|
40
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
41
|
+
const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
|
|
42
|
+
const constructs = __importStar(require("constructs"));
|
|
43
|
+
/**
|
|
44
|
+
* Deploys Azure Bicep templates via CloudFormation Custom Resource.
|
|
45
|
+
*
|
|
46
|
+
* This construct uses a Docker-based Lambda function because Azure CLI and Bicep
|
|
47
|
+
* exceed Lambda's 250MB deployment package limit (~170MB combined). Docker Lambda
|
|
48
|
+
* provides a 10GB image size limit, allowing us to pre-install Azure CLI and Bicep
|
|
49
|
+
* in the container image.
|
|
50
|
+
*
|
|
51
|
+
* The Lambda executes `az deployment group create` to deploy Bicep templates and
|
|
52
|
+
* returns outputs to CloudFormation, enabling atomic multi-cloud deployments where
|
|
53
|
+
* AWS resources can depend on Azure resources within a single CDK stack.
|
|
54
|
+
*
|
|
55
|
+
* For simple Azure AD operations (app registrations, etc.), consider using the
|
|
56
|
+
* SOP (Standard Operating Procedure) pattern instead, which makes direct Graph API
|
|
57
|
+
* calls without requiring Azure CLI or Docker.
|
|
58
|
+
*/
|
|
59
|
+
class BicepDeployment extends constructs.Construct {
|
|
60
|
+
constructor(scope, id, props) {
|
|
61
|
+
super(scope, id);
|
|
62
|
+
const deploymentName = props.deploymentName || `cdk-${id}`;
|
|
63
|
+
const bicepDir = 'cdk.out/bicep';
|
|
64
|
+
if (!fs.existsSync(bicepDir)) {
|
|
65
|
+
fs.mkdirSync(bicepDir, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
fs.writeFileSync(`${bicepDir}/${deploymentName}.bicep`, props.template);
|
|
68
|
+
// Create Lambda role with predictable name if specified
|
|
69
|
+
let lambdaRole;
|
|
70
|
+
if (props.azureFederatedCredentials.lambdaRoleName) {
|
|
71
|
+
lambdaRole = new aws_cdk_lib_1.aws_iam.Role(this, 'LambdaRole', {
|
|
72
|
+
roleName: props.azureFederatedCredentials.lambdaRoleName,
|
|
73
|
+
assumedBy: new aws_cdk_lib_1.aws_iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
74
|
+
managedPolicies: [
|
|
75
|
+
aws_cdk_lib_1.aws_iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaBasicExecutionRole'),
|
|
76
|
+
],
|
|
77
|
+
inlinePolicies: {
|
|
78
|
+
STSPolicy: new aws_cdk_lib_1.aws_iam.PolicyDocument({
|
|
79
|
+
statements: [
|
|
80
|
+
new aws_cdk_lib_1.aws_iam.PolicyStatement({
|
|
81
|
+
effect: aws_cdk_lib_1.aws_iam.Effect.ALLOW,
|
|
82
|
+
actions: ['sts:GetWebIdentityToken'],
|
|
83
|
+
resources: ['*'],
|
|
84
|
+
}),
|
|
85
|
+
],
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const handler = new lambda.DockerImageFunction(this, 'Handler', {
|
|
91
|
+
code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, 'lambda')),
|
|
92
|
+
timeout: core.Duration.minutes(15),
|
|
93
|
+
memorySize: 512,
|
|
94
|
+
role: lambdaRole,
|
|
95
|
+
});
|
|
96
|
+
this.lambdaRole = handler.role;
|
|
97
|
+
if (props.functionCode) {
|
|
98
|
+
const assetBucket = aws_cdk_lib_1.aws_s3.Bucket.fromBucketName(this, 'AssetBucket', props.functionCode.s3BucketName);
|
|
99
|
+
assetBucket.grantRead(handler);
|
|
100
|
+
}
|
|
101
|
+
this.customResource = new core.CustomResource(this, 'Resource', {
|
|
102
|
+
resourceType: 'Custom::BicepDeployment',
|
|
103
|
+
serviceToken: handler.functionArn,
|
|
104
|
+
properties: {
|
|
105
|
+
TemplateFile: props.template,
|
|
106
|
+
Parameters: JSON.stringify(props.parameters || {}),
|
|
107
|
+
AzureClientId: props.azureFederatedCredentials.clientId,
|
|
108
|
+
AzureTenantId: props.azureFederatedCredentials.tenantId,
|
|
109
|
+
AzureSubscriptionId: props.azureFederatedCredentials.subscriptionId,
|
|
110
|
+
ResourceGroupName: props.resourceGroupName,
|
|
111
|
+
DeploymentName: deploymentName,
|
|
112
|
+
FunctionCodeS3Bucket: props.functionCode?.s3BucketName,
|
|
113
|
+
FunctionCodeS3Key: props.functionCode?.s3ObjectKey,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
this.outputs = {};
|
|
117
|
+
}
|
|
118
|
+
getOutput(key) {
|
|
119
|
+
return this.customResource.getAttString(key);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.BicepDeployment = BicepDeployment;
|
|
123
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2JpY2VwL2RlcGxveS9kZXBsb3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7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RlbnRpYWxzLmNsaWVudElkLFxuICAgICAgICBBenVyZVRlbmFudElkOiBwcm9wcy5henVyZUZlZGVyYXRlZENyZWRlbnRpYWxzLnRlbmFudElkLFxuICAgICAgICBBenVyZVN1YnNjcmlwdGlvbklkOiBwcm9wcy5henVyZUZlZGVyYXRlZENyZWRlbnRpYWxzLnN1YnNjcmlwdGlvbklkLFxuICAgICAgICBSZXNvdXJjZUdyb3VwTmFtZTogcHJvcHMucmVzb3VyY2VHcm91cE5hbWUsXG4gICAgICAgIERlcGxveW1lbnROYW1lOiBkZXBsb3ltZW50TmFtZSxcbiAgICAgICAgRnVuY3Rpb25Db2RlUzNCdWNrZXQ6IHByb3BzLmZ1bmN0aW9uQ29kZT8uczNCdWNrZXROYW1lLFxuICAgICAgICBGdW5jdGlvbkNvZGVTM0tleTogcHJvcHMuZnVuY3Rpb25Db2RlPy5zM09iamVjdEtleSxcbiAgICAgIH0sXG4gICAgfSk7XG5cbiAgICB0aGlzLm91dHB1dHMgPSB7fTtcbiAgfVxuXG4gIHB1YmxpYyBnZXRPdXRwdXQoa2V5OiBzdHJpbmcpOiBzdHJpbmcge1xuICAgIHJldHVybiB0aGlzLmN1c3RvbVJlc291cmNlLmdldEF0dFN0cmluZyhrZXkpO1xuICB9XG59XG4iXX0=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./deploy"), exports);
|
|
18
|
+
__exportStar(require("./template"), exports);
|
|
19
|
+
__exportStar(require("./templateBuilder"), exports);
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYmljZXAvZGVwbG95L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBeUI7QUFDekIsNkNBQTJCO0FBQzNCLG9EQUFrQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vZGVwbG95JztcbmV4cG9ydCAqIGZyb20gJy4vdGVtcGxhdGUnO1xuZXhwb3J0ICogZnJvbSAnLi90ZW1wbGF0ZUJ1aWxkZXInO1xuIl19
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight Bicep synthesizer for generating Bicep templates from TypeScript.
|
|
3
|
+
* Provides type-safe Bicep generation without requiring external dependencies.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum BicepParameterType {
|
|
6
|
+
STRING = "string",
|
|
7
|
+
INT = "int",
|
|
8
|
+
BOOL = "bool",
|
|
9
|
+
OBJECT = "object",
|
|
10
|
+
ARRAY = "array"
|
|
11
|
+
}
|
|
12
|
+
export declare enum BicepExtension {
|
|
13
|
+
MICROSOFT_GRAPH_STABLE = "br:mcr.microsoft.com/bicep/extensions/microsoftgraph/v1.0:1.0.0",
|
|
14
|
+
KUBERNETES_STABLE = "Microsoft.KubernetesConfiguration/stable"
|
|
15
|
+
}
|
|
16
|
+
export interface BicepParameter {
|
|
17
|
+
type: BicepParameterType;
|
|
18
|
+
description?: string;
|
|
19
|
+
defaultValue?: any;
|
|
20
|
+
allowedValues?: any[];
|
|
21
|
+
}
|
|
22
|
+
export interface BicepResource {
|
|
23
|
+
type: string;
|
|
24
|
+
apiVersion: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
kind?: string;
|
|
27
|
+
location?: string;
|
|
28
|
+
properties?: Record<string, any>;
|
|
29
|
+
dependsOn?: string[];
|
|
30
|
+
comment?: string;
|
|
31
|
+
linterSuppressions?: string[];
|
|
32
|
+
propertySuppressions?: Record<string, string[]>;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface BicepOutput {
|
|
36
|
+
type: BicepParameterType;
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
export interface BicepMetadata {
|
|
40
|
+
name?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
version?: string;
|
|
43
|
+
cloudformation?: {
|
|
44
|
+
stackArn?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare class BicepTemplate {
|
|
48
|
+
private parameters;
|
|
49
|
+
private resources;
|
|
50
|
+
private outputs;
|
|
51
|
+
private extensions;
|
|
52
|
+
private metadata;
|
|
53
|
+
addStringParameter(name: string, description?: string, defaultValue?: string): void;
|
|
54
|
+
addIntParameter(name: string, description?: string, defaultValue?: number): void;
|
|
55
|
+
addBoolParameter(name: string, description?: string, defaultValue?: boolean): void;
|
|
56
|
+
addObjectParameter(name: string, description?: string, defaultValue?: Record<string, any>): void;
|
|
57
|
+
addArrayParameter(name: string, description?: string, defaultValue?: any[]): void;
|
|
58
|
+
addExtension(extension: BicepExtension): void;
|
|
59
|
+
setMetadata(metadata: BicepMetadata): void;
|
|
60
|
+
addResource(name: string, resource: BicepResource): void;
|
|
61
|
+
addStringOutput(name: string, value: string): void;
|
|
62
|
+
addIntOutput(name: string, value: string): void;
|
|
63
|
+
addBoolOutput(name: string, value: string): void;
|
|
64
|
+
addObjectOutput(name: string, value: string): void;
|
|
65
|
+
addArrayOutput(name: string, value: string): void;
|
|
66
|
+
synthesize(): string;
|
|
67
|
+
private formatValue;
|
|
68
|
+
private formatObject;
|
|
69
|
+
private isEmptyValue;
|
|
70
|
+
private toCamelCase;
|
|
71
|
+
private toPascalCase;
|
|
72
|
+
private getGuidComment;
|
|
73
|
+
private getResourceSection;
|
|
74
|
+
private formatSectionHeader;
|
|
75
|
+
}
|