Skip to content

Commit 20d46f8

Browse files
committed
chore: update aws instructions
1 parent eb5e88b commit 20d46f8

2 files changed

Lines changed: 220 additions & 25 deletions

File tree

docs/technologies/aws.md

Lines changed: 199 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Currently, we support writing evaluation script in Node.js. In future, we will a
4848

4949
You must export a default function inside the evaluation script. This function must return an object containing the following properties:
5050

51-
- `status` - A string that can be `success` or `fail` depending on whether the user passed the challenge. If it returns `success`, we will mark the evaluation as success for the given challenge. If it returns `fail`, we will mark the evaluation as failed.
52-
- `errorMessage` - An optional string value that can be used to display an error message to the user. You can use this property to give the user hints in case the evaluation fails.
51+
- `status` - A string that can be `success` or `fail` depending on whether the user passed the challenge. If it returns `success`, we will mark the evaluation as success for the given challenge. If it returns `fail`, we will mark the evaluation as failed.
52+
- `errorMessage` - An optional string value that can be used to display an error message to the user. You can use this property to give the user hints in case the evaluation fails.
5353

5454
Remember that the user cannot skip challenges and have to complete all challenges in a given lab in a step-by-step order.
5555

@@ -113,15 +113,202 @@ Currently, only Pro users can use AWS cloud sandboxes. You can signup for a Pro
113113

114114
## Which services are enabled?
115115

116-
We enable services as required by instructors. Currently the following services have been enabled on AWS Sandbox accounts:
116+
We enable services as required by instructors.
117117

118-
- EC2
119-
- API Gateway
120-
- Lambda Functions
121-
- Cloudfront
122-
- S3
123-
- Cloudformation
124-
- Cloudwatch
125-
- Key Management Service (KMS)
118+
:::info
119+
Only us-east-1 region is enabled. Every other region is unoperational under codedamn sandbox
120+
:::
126121

127-
If you plan on creating a course that uses a service that is not listed above, <a href="https://codedamn.com/contact">contact our support</a> and we would be happy to enable it.
122+
Currently the following services have been enabled on AWS Sandbox accounts
123+
124+
<details>
125+
<summary>EC2</summary>
126+
127+
Enabled Services:
128+
```
129+
AllocateAddress
130+
AssignIpv6Addresses
131+
AssignPrivateIpAddresses
132+
AssociateAddress
133+
AssociateDhcpOptions
134+
AssociateEnclaveCertificateIamRole
135+
AssociateIamInstanceProfile
136+
AssociateInstanceEventWindow
137+
AssociateRouteTable
138+
AssociateSubnetCidrBlock
139+
AssociateTrunkInterface
140+
AssociateVerifiedAccessInstanceWebAcl
141+
AssociateVpcCidrBlock
142+
AttachInternetGateway
143+
AttachNetworkInterface
144+
AttachVerifiedAccessTrustProvider
145+
AttachVolume
146+
AuthorizeSecurityGroupEgress
147+
AuthorizeSecurityGroupIngress
148+
CancelConversionTask
149+
CancelExportTask
150+
CancelImageLaunchPermission
151+
CancelImportTask
152+
CancelSpotInstanceRequests
153+
ConfirmProductInstance
154+
CopyFpgaImage
155+
CopyImage
156+
CopySnapshot
157+
CreateDefaultSubnet
158+
CreateDefaultVpc
159+
CreateDhcpOptions
160+
CreateEgressOnlyInternetGateway
161+
CreateFlowLogs
162+
CreateImage
163+
CreateInstanceConnectEndpoint
164+
CreateInstanceEventWindow
165+
CreateInstanceExportTask
166+
CreateInternetGateway
167+
CreateKeyPair
168+
CreateLaunchTemplate
169+
CreateLaunchTemplateVersion
170+
CreateManagedPrefixList
171+
CreateNetworkAcl
172+
CreateNetworkAclEntry
173+
CreateNetworkInsightsAccessScope
174+
CreateNetworkInsightsPath
175+
CreateNetworkInterface
176+
CreateNetworkInterfacePermission
177+
CreateReplaceRootVolumeTask
178+
CreateRestoreImageTask
179+
CreateRoute
180+
CreateRouteTable
181+
CreateSecurityGroup
182+
CreateSnapshot
183+
CreateSnapshots
184+
CreateSpotDatafeedSubscription
185+
CreateStoreImageTask
186+
CreateSubnet
187+
CreateTags
188+
CreateVolume
189+
CreateVpc
190+
CreateVpcEndpoint
191+
CreateVpcEndpointConnectionNotification
192+
CreateVpcEndpointServiceConfiguration
193+
EnableEbsEncryptionByDefault
194+
EnableFastLaunch
195+
EnableFastSnapshotRestores
196+
EnableImageDeprecation
197+
EnableSerialConsoleAccess
198+
EnableVolumeIO
199+
ExportImage
200+
ImportImage
201+
ImportInstance
202+
ImportKeyPair
203+
ImportSnapshot
204+
ImportVolume
205+
MonitorInstances
206+
MoveAddressToVpc
207+
PauseVolumeIO
208+
PutResourcePolicy
209+
RebootInstances
210+
RegisterImage
211+
RegisterInstanceEventNotificationAttributes
212+
RejectVpcEndpointConnections
213+
ReleaseAddress
214+
ReleaseHosts
215+
ReplaceIamInstanceProfileAssociation
216+
ReplaceNetworkAclAssociation
217+
ReplaceNetworkAclEntry
218+
ReplaceRoute
219+
ReplaceRouteTableAssociation
220+
ReportInstanceStatus
221+
RequestSpotInstances
222+
ResetAddressAttribute
223+
ResetEbsDefaultKmsKeyId
224+
ResetFpgaImageAttribute
225+
ResetImageAttribute
226+
ResetInstanceAttribute
227+
ResetNetworkInterfaceAttribute
228+
ResetSnapshotAttribute
229+
RestoreImageFromRecycleBin
230+
RestoreManagedPrefixListVersion
231+
RestoreSnapshotFromRecycleBin
232+
RestoreSnapshotTier
233+
RevokeSecurityGroupEgress
234+
RevokeSecurityGroupIngress
235+
RunInstances
236+
SendDiagnosticInterrupt
237+
SendSpotInstanceInterruptions
238+
StartInstances
239+
StartNetworkInsightsAccessScopeAnalysis
240+
StartNetworkInsightsAnalysis
241+
StartVpcEndpointServicePrivateDnsVerification
242+
StopInstances
243+
TerminateInstances
244+
UnassignIpv6Addresses
245+
UnassignPrivateIpAddresses
246+
UnmonitorInstances
247+
UpdateSecurityGroupRuleDescriptionsEgress
248+
UpdateSecurityGroupRuleDescriptionsIngress
249+
Delete*
250+
Describe*
251+
Disassociate*
252+
Deregister*
253+
Detach*
254+
Disable*
255+
Get*
256+
List*
257+
Modify*
258+
```
259+
</details>
260+
<details>
261+
<summary>API Gatewaty</summary>
262+
263+
Full access
264+
265+
</details>
266+
<details>
267+
<summary>Lambda Functions</summary>
268+
269+
Full access
270+
271+
</details>
272+
<details>
273+
<summary>CloudFront</summary>
274+
275+
Full access
276+
277+
</details>
278+
279+
<details>
280+
<summary>CloudWatch</summary>
281+
282+
Full access
283+
284+
</details>
285+
<details>
286+
<summary>KMS</summary>
287+
288+
Full access
289+
290+
</details>
291+
<details>
292+
<summary>IAM</summary>
293+
294+
Full access
295+
296+
</details>
297+
<details>
298+
<summary>CloudShell</summary>
299+
300+
Full access
301+
302+
</details>
303+
<details>
304+
<summary>STS</summary>
305+
306+
Enabled services:
307+
308+
```
309+
DecodeAuthorizationMessage
310+
```
311+
312+
</details>
313+
314+
If you plan on creating a course that uses a service that is not listed above, <a href="https://codedamn.com/contact">contact our support</a> and we would be happy to see if we can enable it.

docs/technologies/solidity-hardhat.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,32 +82,40 @@ Therefore, your testing script would look like as follows:
8282

8383
```sh
8484
# move the test file to user directory (hardhat testing util requires it)
85-
mkdir -p $USER_CODE_DIR/test
86-
mv $TEST_FILE_NAME $USER_CODE_DIR/test
85+
mkdir -p /home/damner/code/test
86+
mkdir -p /home/damner/code/.labtests
87+
mv $TEST_FILE_NAME /home/damner/code/test/codedamn-evaluation.test.js
8788

8889
# run hardhat testing util assuming we have correct mocha settings
89-
cd $USER_CODE_DIR
90-
yarn --silent hardhat test > $UNIT_TEST_OUTPUT_FILE
90+
cd /home/damner/code
91+
yarn --silent hardhat test 2>&1 > /home/damner/code/.labtests/payload.json
9192

92-
# run a light node script to extract out results and write them back in expected format
93+
# process.js - run a light node script to extract out results and write them back in expected format
94+
cat > /home/damner/code/.labtests/process.js << EOF
95+
import fs from 'node:fs'
9396
94-
cat > /home/damner/.test/process-results.js << EOF
95-
const fs = require('fs')
96-
const fileData = fs.readFileSync(process.env.UNIT_TEST_OUTPUT_FILE, { encoding: 'utf8' })
97+
const fileData = fs.readFileSync('/home/damner/code/.labtests/payload.json', { encoding: 'utf8' })
9798
const payload = JSON.parse(fileData.slice(fileData.indexOf('{')))
98-
const answers = payload?.tests?.map((result, i) => {
99+
const answers = payload?.tests?.map(result => {
99100
if(result.err.stack) {
100101
console.error(result.err.message)
101102
return false
102103
} else {
103-
console.log(\`Test ${i} passed\`)
104+
console.log('Test passed')
104105
return true
105106
}
106107
}) || []
107108
fs.writeFileSync(process.env.UNIT_TEST_OUTPUT_FILE, JSON.stringify(answers))
108109
EOF
109110

110-
node /home/damner/.test/process-results.js
111+
# package.json
112+
cat > /home/damner/code/.labtests/package.json << EOF
113+
{
114+
"type": "module"
115+
}
116+
EOF
117+
118+
node /home/damner/code/.labtests/process.js
111119
```
112120

113121
You might need to have a little understanding of bash scripting. Let us understand how the evaluation bash script is working:
@@ -124,8 +132,8 @@ module.exports = {
124132
solidity: '0.8.4',
125133
mocha: {
126134
// * the reporter here needs to be JSON
127-
reporter: 'json',
128-
},
135+
reporter: 'json'
136+
}
129137
}
130138
```
131139

0 commit comments

Comments
 (0)