This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deploy (#35) * Dev/provider (#5) * Add keyrock * Increase chart version * Add PDP * Add kong * Adding AS * Add AS to DSC values * Add participant label * Change issuer version and add data volume * Fix data volume * Test AS pre-release * Change to latest AS release * Switch to default PDC values * Rename folder of PDP * Make DID CM optional * Renaming walt-id chart * Renaimg default URLs and secret names for walt chart name change * verifier using did registry (#6) * Verifier using DID Registry (#8) * Allow to disable certain apps when deploying with Helm and various fixes for plain Helm deployment with Ingress (#10) * Allow to disable certain apps when deploying with Helm * Adding example values file * Add waltId ingress * Updating walt-id config and adding keycloak * Update doc * Adding verifier * Add TIL * Remove doubled PDP app * Adding Keyrock and dsba-pdp * Adding kong * Adding AS * Extend doc * Update examples/service-provider-ips/README.md Fix typo Co-authored-by: Tim Smyth <[email protected]> --------- Co-authored-by: Tim Smyth <[email protected]> Co-authored-by: Tim Smyth <[email protected]> * Updated images of keycloak-vc-issuer and waltid (#11) * Update values.yaml * Update values.yaml (#14) * Add TMForum APIs (#13) * Add TMForum APIs * Remove spec URL * Switching to Test-Image --------- Co-authored-by: Stefan Wiedemann <[email protected]> * Change TMForum chart (#17) * Add TMForum APIs * Remove spec URL * Switching to Test-Image * Change TMForum chart --------- Co-authored-by: Stefan Wiedemann <[email protected]> * enable the proxy (#18) * Update values.yaml (#20) * Update values.yaml (#22) * Extend documentation (#30) * Extend documentation * typo * Extend doc for providing config parameters (#32) * Extend documentation * typo * Extend doc for providing config parameters * Update README.md Co-authored-by: Tim Smyth <[email protected]> --------- Co-authored-by: Tim Smyth <[email protected]> * Integration with AWS Garnet (#33) * Adding folder for AWS STF * Add TOC * Fix TOC * rename aws-smart-territory-framework to aws-garnet in file structure * add content structure to AWS Garnet integration example documentation * add placeholder EKS nginx Ingress Controller Configuration * add resources to help deploy eks cluster * clean up unused resources * add steps to create eks cluster * add steps to deploy nginx ingress controller * restructure readme separating 2 possible configurations * add modified cdk stack for deployment of aws garnet iot module only * add steps to deploy isolated aws garnet iot module and integrate to amazon eks cluster * fix scenario image order * improve diagram image quality * fix diagram order * fix diagram order * add useful kubectl scripts for debugging * add separate structures for scenario 1 and scenario 2 * add instructions for scenario2 deployment * fix scenario 2 disable orion deployment * add links to internal files in project structure * add podLogs placeholder for doc links * Update ToC link --------- Co-authored-by: EC2 Default User <[email protected]> Co-authored-by: asanode-aws <[email protected]> * Update values.yaml * Added redis caching support (#34) Co-authored-by: Stefan Wiedemann <[email protected]> --------- Co-authored-by: Dennis Wendland <[email protected]> Co-authored-by: Tim Smyth <[email protected]> Co-authored-by: Tim Smyth <[email protected]> Co-authored-by: beknazaresenbek <[email protected]> Co-authored-by: EC2 Default User <[email protected]> Co-authored-by: asanode-aws <[email protected]> * fix indent, remove yaml anchors (#37) * Deploy --------- Co-authored-by: Stefan Wiedemann <[email protected]> Co-authored-by: Tim Smyth <[email protected]> Co-authored-by: Tim Smyth <[email protected]> Co-authored-by: beknazaresenbek <[email protected]> Co-authored-by: EC2 Default User <[email protected]> Co-authored-by: asanode-aws <[email protected]>
- Loading branch information
1 parent
15a38d7
commit 8163101
Showing
43 changed files
with
4,684 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+64.4 KB
...-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/bucket_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+91.2 KB
...-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/bucket_type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.2 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/cdkoutputs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74 KB
...ws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/cfoutputs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.1 KB
...-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/deletething.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+110 KB
...garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/deviceshadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.3 KB
...arnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/deviceshadow2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+123 KB
...t/scenario-1-deployment/aws-garnet-iot-module/docs/images/deviceshadowlist2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+303 KB
...aws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/entities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+147 KB
...net/scenario-1-deployment/aws-garnet-iot-module/docs/images/geospatialbikes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+108 KB
...aws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/getthing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.9 KB
...ws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/iotbucket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
...ws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/lambdavpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+114 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/listthings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+140 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/orion_arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+338 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/parameters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/postdevice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+64.9 KB
...et/scenario-1-deployment/aws-garnet-iot-module/docs/images/postmandelentity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.4 KB
...et/scenario-1-deployment/aws-garnet-iot-module/docs/images/postmangetentity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+82.8 KB
...arnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/postmanheader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+82.8 KB
...t/scenario-1-deployment/aws-garnet-iot-module/docs/images/postmanpostentity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+112 KB
...s-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/postshadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+173 KB
...arnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/referencearch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+128 KB
...garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/scorpio_arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.8 KB
...-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/shadowstate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+706 KB
.../aws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/stf-yt2.png
Oops, something went wrong.
Binary file added
BIN
+194 KB
...-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/stfiot_arch.png
Oops, something went wrong.
Binary file added
BIN
+137 KB
...s/aws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/things.png
Oops, something went wrong.
Binary file added
BIN
+60.5 KB
...s/aws-garnet/scenario-1-deployment/aws-garnet-iot-module/docs/images/upsert.png
Oops, something went wrong.
98 changes: 98 additions & 0 deletions
98
...nario-1-deployment/aws-garnet-iot-module/lib/stacks/garnet-constructs/privatesub/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { Aws, CfnOutput, Duration, Names } from "aws-cdk-lib" | ||
import { EndpointType, LambdaRestApi } from "aws-cdk-lib/aws-apigateway" | ||
import { InterfaceVpcEndpoint, Peer, Port, SecurityGroup, Vpc } from "aws-cdk-lib/aws-ec2" | ||
import { AnyPrincipal, Effect, PolicyDocument, PolicyStatement } from "aws-cdk-lib/aws-iam" | ||
import { Architecture, Code, Function, Runtime } from "aws-cdk-lib/aws-lambda" | ||
import { Construct } from "constructs" | ||
|
||
export interface GarnetPrivateSubProps { | ||
vpc: Vpc | ||
} | ||
|
||
export class GarnetPrivateSub extends Construct { | ||
|
||
public readonly private_sub_endpoint: string | ||
|
||
constructor(scope: Construct, id: string, props: GarnetPrivateSubProps) { | ||
super(scope, id) | ||
|
||
// SECURITY GROUP | ||
const sg_garnet_vpc_endpoint = new SecurityGroup(this, 'PrivateSubSecurityGroup', { | ||
securityGroupName: `garnet-private-sub-endpoint-sg-${Names.uniqueId(this).slice(-8).toLowerCase()}`, | ||
vpc: props.vpc, | ||
allowAllOutbound: true | ||
}) | ||
sg_garnet_vpc_endpoint.addIngressRule(Peer.anyIpv4(), Port.tcp(443)) | ||
|
||
// VPC ENDPOINT | ||
const vpc_endpoint = new InterfaceVpcEndpoint(this, 'GarnetPrivateSubEndpoint', { | ||
vpc: props.vpc, | ||
service: { | ||
name: `com.amazonaws.${Aws.REGION}.execute-api`, | ||
port: 443 | ||
}, | ||
privateDnsEnabled: true, | ||
securityGroups: [sg_garnet_vpc_endpoint] | ||
}) | ||
|
||
// LAMBDA | ||
const lambda_garnet_private_sub_path = `${__dirname}/lambda/garnetSub` | ||
const lambda_garnet_private_sub = new Function(this, 'GarnetSubFunction', { | ||
functionName: `garnet-private-sub-lambda-${Names.uniqueId(this).slice(-8).toLowerCase()}`, | ||
runtime: Runtime.NODEJS_18_X, | ||
code: Code.fromAsset(lambda_garnet_private_sub_path), | ||
handler: 'index.handler', | ||
timeout: Duration.seconds(50), | ||
architecture: Architecture.ARM_64, | ||
environment: { | ||
AWSIOTREGION: Aws.REGION | ||
} | ||
}) | ||
|
||
lambda_garnet_private_sub.addToRolePolicy(new PolicyStatement({ | ||
actions: ["iot:Publish"], | ||
resources: [`arn:aws:iot:${Aws.REGION}:${Aws.ACCOUNT_ID}:topic/garnet/subscriptions/*`] | ||
})) | ||
|
||
// POLICY | ||
const api_policy = new PolicyDocument({ | ||
statements: [ | ||
new PolicyStatement({ | ||
principals: [new AnyPrincipal], | ||
actions: ['execute-api:Invoke'], | ||
resources: ['execute-api:/*'], | ||
effect: Effect.DENY, | ||
conditions: { | ||
StringNotEquals: { | ||
"aws:SourceVpce": vpc_endpoint.vpcEndpointId | ||
} | ||
} | ||
}), | ||
new PolicyStatement({ | ||
principals: [new AnyPrincipal], | ||
actions: ['execute-api:Invoke'], | ||
resources: ['execute-api:/*'], | ||
effect: Effect.ALLOW | ||
}) | ||
] | ||
}) | ||
|
||
|
||
const api_private_sub = new LambdaRestApi(this, 'ApiPrivateSub', { | ||
restApiName:'garnet-private-sub-endpoint-api', | ||
endpointTypes: [EndpointType.PRIVATE], | ||
handler: lambda_garnet_private_sub, | ||
policy: api_policy | ||
}) | ||
|
||
this.private_sub_endpoint = api_private_sub.url | ||
|
||
new CfnOutput(this, 'ApiEndpoint', { | ||
value: api_private_sub.url, | ||
description: 'Private API Endpoint for Subscriptions' | ||
}) | ||
|
||
|
||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
...t/aws-garnet-iot-module/lib/stacks/garnet-constructs/privatesub/lambda/garnetSub/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const iot_region = process.env.AWSIOTREGION | ||
const { IoTDataPlaneClient, PublishCommand } = require("@aws-sdk/client-iot-data-plane") | ||
const iotdata = new IoTDataPlaneClient({region: iot_region}) | ||
|
||
exports.handler = async (event) => { | ||
try { | ||
const {body} = event | ||
if(!body){ | ||
return { | ||
statusCode: 400, | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify({message: 'Bad Request. Notification is the only type valid'}) | ||
} | ||
} | ||
const payload = JSON.parse(body) | ||
if(payload?.type != "Notification") { | ||
console.log('ERROR not Notification') | ||
return { | ||
statusCode: 400, | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify({message: 'Bad Request. Notification is the only type valid'}) | ||
} | ||
} | ||
// GET THE SUBSCRIPTION NAME FROM SUBSCRIPTION ID | ||
const subName = `${payload.subscriptionId.split(':').slice(-1)}` | ||
const publish = await iotdata.send( | ||
new PublishCommand({ | ||
topic: `garnet/subscriptions/${subName}`, | ||
payload: JSON.stringify(payload) | ||
}) | ||
) | ||
|
||
const response = { | ||
statusCode: 200 | ||
} | ||
return response | ||
|
||
} catch (e) { | ||
const response = { | ||
statusCode: 500, | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
body: JSON.stringify({message: e.message}), | ||
} | ||
console.log(e) | ||
return response | ||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.