Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump @openzeppelin/contracts from 4.9.2 to 4.9.3 in /module1/blockchain-handler #32

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
824b4de
Initial workshop commit
Aug 31, 2023
d6c24e0
Bump semver in /module2/graph_indexer/subgraph/sentences
dependabot[bot] Aug 31, 2023
915cf62
Bump protobufjs in /module2/graph_indexer/subgraph/genai
dependabot[bot] Aug 31, 2023
fab3c97
Bump protobufjs in /module2/graph_indexer/subgraph/sentences
dependabot[bot] Aug 31, 2023
691fa3e
Merge pull request #4 from aws-samples/dependabot/npm_and_yarn/module…
chrisdotn Aug 31, 2023
1537f58
Merge pull request #3 from aws-samples/dependabot/npm_and_yarn/module…
chrisdotn Aug 31, 2023
fdaf7e7
Added check for parameter stack (#5)
dpdornseifer Aug 31, 2023
9248f13
Set jwt token validity to one day (#6)
dpdornseifer Sep 4, 2023
de872ce
Minor fixes (#7)
dpdornseifer Sep 14, 2023
befdc11
Adapt the frontend lambda to the subgraph definition (#13)
chrisdotn Oct 10, 2023
9d3d113
Fix retrieving cloud9 security group id for security group rule creat…
malte-aws Oct 11, 2023
86765ee
Merge pull request #14 from malte-aws/fix-cloud9-sg-ref
chrisdotn Oct 11, 2023
cbc89f3
Bump urllib3 in /module1/wallets/lib/lambda/web3_layer (#16)
dependabot[bot] Oct 19, 2023
0641b41
Change contract artifact to use S3 Managed encryption
baizele Oct 25, 2023
822f8b1
Update e2e script to clearly identity UI url (#26)
ebaizel Oct 26, 2023
6b4c424
Merge pull request #27 from aws-samples/s3_managed_bucket_encryption
chrisdotn Oct 26, 2023
efa8b3a
Adding retry behavior to SM Endpoint APIG calls from Step Function
Oct 31, 2023
e7ef187
Add AMB watermark to frontend (#28)
the-rpc Oct 31, 2023
2e09544
Merge branch 'main' of https://github.com/aws-samples/web3-workshop i…
Oct 31, 2023
24d930b
Configuring retry interval for GenAI endpoint invocations from SFn
Oct 31, 2023
0533fbb
Merge pull request #30 from kaustavbecs/feature/AddRetryToSMEndpointA…
ebaizel Oct 31, 2023
55e39ec
Updating Readme for module2/sagemaker (#31)
kaustavbecs Nov 1, 2023
c0242c5
Bump pillow (#12)
dependabot[bot] Nov 2, 2023
f832555
Bump @babel/traverse in /module1/blockchain-handler (#17)
dependabot[bot] Nov 2, 2023
9f97a13
Bump @babel/traverse from 7.21.5 to 7.23.2 in /module1/nft-pipeline (…
dependabot[bot] Nov 2, 2023
9856fef
Bump @babel/traverse from 7.21.5 to 7.23.2 in /module1/frontend (#19)
dependabot[bot] Nov 2, 2023
ce21185
Bump @babel/traverse from 7.22.4 to 7.23.2 in /module1/api-gateway (#20)
dependabot[bot] Nov 2, 2023
9879382
Bump @babel/traverse from 7.22.5 to 7.23.2 in /module1/parameters (#21)
dependabot[bot] Nov 2, 2023
eea3435
Bump @babel/traverse from 7.22.6 to 7.23.2 in /module2/graph_indexer …
dependabot[bot] Nov 2, 2023
1c95253
Bump @babel/traverse in /module2/genai_nfts/genai-api-gateway (#23)
dependabot[bot] Nov 2, 2023
4a3aed6
Bump @babel/traverse in /module2/genai_nfts/genai-nft-pipeline (#24)
dependabot[bot] Nov 2, 2023
fcfe3fa
Bump @babel/traverse from 7.22.8 to 7.23.2 in /module2/chainquery (#25)
dependabot[bot] Nov 2, 2023
853fe01
Bump @openzeppelin/contracts in /module1/blockchain-handler
dependabot[bot] Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

!jest.config.js
*.d.ts
node_modules
.DS_Store

# CDK asset staging directory
.cdk.staging
cdk.out
cdk.context.json
env.json
dist/
.env
deployment_times
module1/frontend/frontend_output.json
module1/nft-pipeline/nft_pipeline_output.json
module1/nft-pipeline/repo/out/
module1/frontend/web3-workshop-frontend/
module2/genai-nft-pipeline/repo/out/
module2/sagemaker/.venv/
.venv/
*.pyc
*.tmp.out
*.tmp.payload
.user_op_hash
.passwd
.jwt
*doe.com
*.idea
.vscode/
module1/nft-pipeline/ContractRepo/
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ If you discover a potential security issue in this project we ask that you notif


## Licensing

See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,60 @@
## My Project
# web3-workshop

TODO: Fill this README out!
This repository contains all artifacts for the [Build Web3 on AWS](https://catalog.workshops.aws/buildweb3) workshop.

Be sure to:
## Deployment

* Change the title in this README
* Edit your repository description on GitHub
The detailed deployment instructions can be found in the workshop [Build Web3 on AWS](https://catalog.workshops.aws/buildweb3).


## Development

### Module 1
To run e2e integration tests for module 1, execute the following steps:

1. Clone the repository and change into the directory:
```sh
git clone https://github.com/aws-samples/web3-workshop.git
cd web3-workshop
```

2. Add the required credentials to `./tests/module1/run_e2e_pipeline.sh`.

3. Ensure that you have your [`aws cli` configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) correctly and have it pointing to the right AWS account.

4. Export the required `CDK` environment variables to configure the AWS region and account used for the deployment.
```sh
export CDK_DEPLOY_REGION=us-east-1
export CDK_DEPLOY_ACCOUNT=$(aws sts get-caller-identity | jq -r '.Account')
```

5. Run the e2e script:
```sh
./tests/module1/run_e2e_pipeline.sh
```

### Module 2
Module 2 requires module 1 to be fully configured and deployed in the same AWS account and region. Please ensure that all steps defined in `Module 1` have been executed successfully.

The deployment script requires [yq](https://github.com/mikefarah/yq) to modify YAML files on your local machine. It also assumes that you're working on a local machine (instead of a Cloud9 instance). If you don't have `yq` installed, the easiest way on a Mac is using homebrew: `brew install yq`. For other architectures, see the [installation guide](https://github.com/mikefarah/yq/#install).

1. Run the e2e script:
```sh
./tests/module2/run_e2e_pipeline.sh
```

### Cleanup
Separate cleanup scripts have been provided for module 1 and module 2.
If you have deployed module 2 and module 1, trigger the scripts in the following order
```sh
./tests/module2/cleanup.sh && \
./tests/module1/cleanup.sh
```

If only module 1 has been deployed run the following command:
```sh
./tests/module1/cleanup.sh
```

## Security

Expand Down
8 changes: 8 additions & 0 deletions module1/api-gateway/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out
6 changes: 6 additions & 0 deletions module1/api-gateway/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
!*.d.ts

# CDK asset staging directory
.cdk.staging
cdk.out
15 changes: 15 additions & 0 deletions module1/api-gateway/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Welcome to your CDK TypeScript project

You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`ApiGatewayStack`)
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.

The `cdk.json` file tells the CDK Toolkit how to execute your app.

## Useful commands

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk synth` emits the synthesized CloudFormation template
25 changes: 25 additions & 0 deletions module1/api-gateway/bin/api-gateway.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
import { App, Aspects } from 'aws-cdk-lib';
import { Web3WorkshopApiGatewayStack } from '../lib/api-gateway-stack';
import { AwsSolutionsChecks, NagSuppressions } from 'cdk-nag'

const app = new App();

const apiGatewayStack = new Web3WorkshopApiGatewayStack(app, 'Web3WorkshopApiGatewayStack', {
env: {
account: process.env.CDK_DEPLOY_ACCOUNT,
region: process.env.CDK_DEPLOY_REGION
}
});

Aspects.of(app).add(new AwsSolutionsChecks())

NagSuppressions.addStackSuppressions(apiGatewayStack, [
{ id: 'AwsSolutions-SF2', reason: 'X-Ray tracing is not necessary, and logging is enabled' },
{ id: 'AwsSolutions-IAM4', reason: 'Permissions are needed to log to CloudWatch' },
{ id: 'AwsSolutions-IAM5', reason: 'Permission to read CF stack is restrictive enough' },
{ id: 'AwsSolutions-APIG2', reason: 'Request validation is handled on the backend' },
{ id: 'AwsSolutions-APIG4', reason: 'Options requests without authentication are required for CORS pre-flight requests' },
{ id: 'AwsSolutions-COG4', reason: 'Options requests without authentication are required for CORS pre-flight requests' },
], true);
48 changes: 48 additions & 0 deletions module1/api-gateway/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"app": "npx ts-node --prefer-ts-exts bin/api-gateway.ts",
"watch": {
"include": ["**"],
"exclude": [
"README.md",
"cdk*.json",
"**/*.d.ts",
"**/*.js",
"tsconfig.json",
"package*.json",
"yarn.lock",
"node_modules",
"test"
]
},
"context": {
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
"@aws-cdk/core:checkSecretUsage": true,
"@aws-cdk/core:target-partitions": ["aws", "aws-cn"],
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
"@aws-cdk/aws-iam:minimizePolicies": true,
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
"@aws-cdk/core:enablePartitionLiterals": true,
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
"@aws-cdk/aws-iam:standardizedServicePrincipals": true,
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
"@aws-cdk/aws-route53-patters:useCertificate": true,
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
"@aws-cdk/aws-redshift:columnId": true,
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true
}
}
8 changes: 8 additions & 0 deletions module1/api-gateway/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
}
};
Loading