Skip to content

Commit

Permalink
Upgrading to latest Pulumi versions after runthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed May 7, 2021
1 parent 70388bb commit a6644b9
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 28 deletions.
1 change: 0 additions & 1 deletion aws-go-lambda-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ After cloning this repo, run these commands from the working directory:

Outputs:
invocation URL: "https://<gateway-id>.execute-api.us-west-2.amazonaws.com/prod/{message}"
lambda : "arn:aws:lambda:us-west-2:ACCOUNTID:function:basicLambda-75711af"

Resources:
+ 10 created
Expand Down
2 changes: 1 addition & 1 deletion aws-go-lambda-gateway/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pulumi/examples/aws-go-lambda-gateway

go 1.13
go 1.14

require (
github.com/aws/aws-lambda-go v1.15.0
Expand Down
4 changes: 4 additions & 0 deletions aws-go-lambda-gateway/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,14 @@ github.com/pulumi/pulumi-aws/sdk/v3 v3.1.0 h1:huTCq1WTR4f45JA1yJHqRVtS7v7aoKCYs4
github.com/pulumi/pulumi-aws/sdk/v3 v3.1.0/go.mod h1:Tiu0MSxPkufZDbNTXNMb8cKiIRWLt+7spM3DPuzLcBc=
github.com/pulumi/pulumi-aws/sdk/v4 v4.0.0-beta.2 h1:JRgJZklxoa4FgP77EHpLykXC6c/WXpq/4qJQqy9AJrc=
github.com/pulumi/pulumi-aws/sdk/v4 v4.0.0-beta.2/go.mod h1:Y8Y6tuCKKYQWSuWVnvGQ6hjnzXsEY6yPUiIZMqjCsgQ=
github.com/pulumi/pulumi-aws/sdk/v4 v4.0.0 h1:hotld6lXp7a1LiPsAgcp3BrGgvj3O/IB5QzdPukyC34=
github.com/pulumi/pulumi-aws/sdk/v4 v4.0.0/go.mod h1:TCdXM+R0dW0CFco+lb3Q7qRYWmYxDbJ7EPWYzRVHWMw=
github.com/pulumi/pulumi/sdk/v2 v2.2.1 h1:fNp+69Udcsft3ME+5lKt2IFT3imFAN6D98WiuiAIq/Q=
github.com/pulumi/pulumi/sdk/v2 v2.2.1/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4=
github.com/pulumi/pulumi/sdk/v3 v3.0.0-beta.2 h1:uw3nUFEtygkBTSVjL+kvE12pS8imafKcALPewEFVv1c=
github.com/pulumi/pulumi/sdk/v3 v3.0.0-beta.2/go.mod h1:GBHyQ7awNQSRmiKp/p8kIKrGrMOZeA/k2czoM/GOqds=
github.com/pulumi/pulumi/sdk/v3 v3.0.0 h1:zkragE05t1Rco/ymfqMU4UXdEmKMmOH0SXhUKQxujxQ=
github.com/pulumi/pulumi/sdk/v3 v3.0.0/go.mod h1:GBHyQ7awNQSRmiKp/p8kIKrGrMOZeA/k2czoM/GOqds=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
Expand Down
Binary file removed aws-go-lambda-gateway/handler/handler
Binary file not shown.
Binary file removed aws-go-lambda-gateway/handler/handler.zip
Binary file not shown.
10 changes: 5 additions & 5 deletions aws-go-lambda-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func main() {
RestApi: gateway.ID(),
PathPart: pulumi.String("{proxy+}"),
ParentId: gateway.RootResourceId,
}, pulumi.DependsOn([]pulumi.Resource{gateway}))
})
if err != nil {
return err
}
Expand All @@ -119,7 +119,7 @@ func main() {
Authorization: pulumi.String("NONE"),
RestApi: gateway.ID(),
ResourceId: apiresource.ID(),
}, pulumi.DependsOn([]pulumi.Resource{gateway, apiresource}))
})
if err != nil {
return err
}
Expand All @@ -133,7 +133,7 @@ func main() {
RestApi: gateway.ID(),
Type: pulumi.String("AWS_PROXY"),
Uri: function.InvokeArn,
}, pulumi.DependsOn([]pulumi.Resource{gateway, apiresource, function}))
})
if err != nil {
return err
}
Expand All @@ -145,7 +145,7 @@ func main() {
Function: function.Name,
Principal: pulumi.String("apigateway.amazonaws.com"),
SourceArn: pulumi.Sprintf("arn:aws:execute-api:%s:%s:%s/*/*/*", region.Name, account.AccountId, gateway.ID()),
}, pulumi.DependsOn([]pulumi.Resource{gateway, apiresource, function}))
}, pulumi.DependsOn([]pulumi.Resource{apiresource}))
if err != nil {
return err
}
Expand All @@ -156,7 +156,7 @@ func main() {
RestApi: gateway.ID(),
StageDescription: pulumi.String("Production"),
StageName: pulumi.String("prod"),
}, pulumi.DependsOn([]pulumi.Resource{gateway, apiresource, function, permission}))
}, pulumi.DependsOn([]pulumi.Resource{apiresource, function, permission}))
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions aws-go-slackbot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ go 1.14
require (
github.com/aws/aws-lambda-go v1.23.0 // indirect
github.com/aws/aws-sdk-go v1.38.26 // indirect
github.com/pulumi/pulumi-aws/sdk/v3 v3.38.1
github.com/pulumi/pulumi/sdk/v2 v2.25.2
github.com/pulumi/pulumi-aws/sdk/v4 v4.0.0
github.com/pulumi/pulumi/sdk/v3 v3.0.0
github.com/slack-go/slack v0.9.0 // indirect
)
111 changes: 111 additions & 0 deletions aws-go-slackbot/go.sum

Large diffs are not rendered by default.

Binary file removed aws-go-slackbot/handler/handler
Binary file not shown.
Binary file removed aws-go-slackbot/handler/handler.zip
Binary file not shown.
14 changes: 7 additions & 7 deletions aws-go-slackbot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package main
import (
"fmt"

"github.com/pulumi/pulumi-aws/sdk/v3/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/dynamodb"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/lambda"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi/config"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/dynamodb"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/lambda"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
Expand Down
1 change: 0 additions & 1 deletion aws-py-apigateway-lambda-serverless/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def swagger_route_handler(arn):
protocol_type="HTTP"
)

# Note to self: example provided here was incorrect: https://www.pulumi.com/docs/reference/pkg/aws/apigatewayv2/integration/
http_lambda_backend = aws.apigatewayv2.Integration("example",
api_id= http_endpoint.id,
integration_type="AWS_PROXY",
Expand Down
4 changes: 2 additions & 2 deletions aws-py-apigateway-lambda-serverless/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pulumi>=2.0.0,<3.0.0
pulumi-aws>=3.2.0,<4.0.0
pulumi>=3.0.0,<4.0.0
pulumi-aws>=4.0.0,<5.0.0
5 changes: 1 addition & 4 deletions aws-py-slackbot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import re
import json
import boto3
import requests
import iam
import base64
import pulumi
Expand Down Expand Up @@ -123,6 +122,4 @@ def swagger_route_handler(arn):
function=lambda_func.name,
principal="apigateway.amazonaws.com",
source_arn=deployment.execution_arn.apply(lambda arn: arn + "*/*"),
)

# export const url = endpoint.url;
)
4 changes: 2 additions & 2 deletions aws-py-slackbot/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
slack-sdk==3.5.0
pulumi>=2.0.0,<3.0.0
pulumi-aws>=3.0.0,<4.0.0
pulumi>=3.0.0,<4.0.0
pulumi-aws>=4.0.0,<5.0.0
boto3==1.16.58
6 changes: 3 additions & 3 deletions aws-ts-apigateway-lambda-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"@types/node": "^10.0.0"
},
"dependencies": {
"@pulumi/aws": "^3.25.1",
"@pulumi/awsx": "^0.24.0",
"@pulumi/pulumi": "^2.0.0"
"@pulumi/aws": "^4.0.0",
"@pulumi/awsx": "^0.30.0",
"@pulumi/pulumi": "^3.0.0"
}
}

0 comments on commit a6644b9

Please sign in to comment.