Skip to content

Commit

Permalink
chore: upgrade to wing 0.50 (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Rybicki <[email protected]>
  • Loading branch information
skorfmann and Chriscbr authored Dec 21, 2023
1 parent d71ac9a commit 807dafb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
role-session-name: gh-actions-winglang # makes it easy to identify, e.g. in AWS Cloudtrail
aws-region: ${{ env.AWS_REGION }}
- name: Deploy Winglang App
uses: winglang/wing-github-action/actions/deploy@v0.1.0
uses: winglang/wing-github-action/actions/deploy@828c1b5de735ea5489194776483d423df1f7a401
with:
entry: main.w
target: 'tf-aws'
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
role-session-name: gh-actions-winglang
aws-region: ${{ env.AWS_REGION }}
- name: Terraform Plan
uses: winglang/wing-github-action/actions/pull-request-diff@v0.1.0
uses: winglang/wing-github-action/actions/pull-request-diff@828c1b5de735ea5489194776483d423df1f7a401
with:
entry: main.w
target: 'tf-aws'
Expand Down
5 changes: 2 additions & 3 deletions dynamodb.w
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub class DynamoDBTableAws {
new(props: DynamoDBTableProps) {
this.hashKey = props.hashKey;
this.table = new tfaws.dynamodbTable.DynamodbTable(
name: "${this.node.id}-${this.node.addr.substring(this.node.addr.length - 8)}",
name: "{this.node.id}-{this.node.addr.substring(this.node.addr.length - 8)}",
billingMode: "PAY_PER_REQUEST",
hashKey: this.hashKey,
attribute: [
Expand Down Expand Up @@ -178,12 +178,11 @@ pub class DynamoDBTable {
} elif target == "tf-aws" {
this.tableAws = new DynamoDBTableAws(props);
} else {
throw("DynamoDBTable doesn't support target '${target}'");
throw("DynamoDBTable doesn't support target '{target}'");
}
}

pub onLift(host: std.IInflightHost, ops: Array<str>) {
log("onLift called on DynamoDBTable with ops ${ops}");
// currently simulator does not require permissions
// may change with https://github.com/winglang/wing/issues/3082
if let tableAws = this.tableAws {
Expand Down
7 changes: 5 additions & 2 deletions main.w
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let _entryToMap = inflight (entry: Entry) => {
},
"Score" => ddb.Attribute {
type: ddb.AttributeType.Number,
value: "${entry.score}",
value: "{entry.score}",
},
};
};
Expand Down Expand Up @@ -64,7 +64,7 @@ class Store {
this.table.putItem(_entryToMap(entry));
}

inflight getEntry(name: str): Entry? {
pub inflight getEntry(name: str): Entry? {
let item = this.table.getItem(Map<ddb.Attribute> {
"Name" => ddb.Attribute {
type: ddb.AttributeType.String,
Expand Down Expand Up @@ -184,6 +184,9 @@ let foods = [

new cloud.OnDeploy(inflight () => {
for food in foods {
if !store.getEntry(food)? {
continue;
}
store.setEntry(Entry {
name: food,
score: 1500,
Expand Down
13 changes: 0 additions & 13 deletions plugin.s3-backend.js

This file was deleted.

0 comments on commit 807dafb

Please sign in to comment.