File tree Expand file tree Collapse file tree 9 files changed +38
-22
lines changed
Expand file tree Collapse file tree 9 files changed +38
-22
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ out.java
117117out /
118118tmp /
119119
120+ # generated files
121+ examples /github-repo /makebuild
122+ examples /github-repo /cmd /resource /config.go
123+
120124# Binaries for programs and plugins
121125* .exe
122126* .exe~
Original file line number Diff line number Diff line change 6464 description : Run pytest in the local virtualenv
6565 entry : >
6666 pytest
67- --cov-report=term
68- --cov-report=html
69- --cov="rpdk.go"
7067 --durations=5
7168 "tests/"
7269 language : system
Original file line number Diff line number Diff line change 11{
22 "typeName": "Example::GitHub::Repo",
33 "language": "go",
4- "runtime": "go1.x ",
5- "entrypoint": "handler ",
6- "testEntrypoint": "handler ",
4+ "runtime": "provided.al2 ",
5+ "entrypoint": "bootstrap ",
6+ "testEntrypoint": "bootstrap ",
77 "settings": {
88 "import_path": "github.com/aws-cloudformation/cloudformation-cli-go-plugin/examples/github-repo",
99 "protocolVersion": "2.0.0",
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ _Required_: Yes
4343
4444_ Type_ : String
4545
46- _ Minimum _ : <code >1</code >
46+ _ Minimum Length _ : <code >1</code >
4747
48- _ Maximum _ : <code >50</code >
48+ _ Maximum Length _ : <code >50</code >
4949
5050_ Update requires_ : [ No interruption] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt )
5151
@@ -67,9 +67,9 @@ _Required_: No
6767
6868_ Type_ : String
6969
70- _ Minimum _ : <code >20</code >
70+ _ Minimum Length _ : <code >20</code >
7171
72- _ Maximum _ : <code >250</code >
72+ _ Maximum Length _ : <code >250</code >
7373
7474_ Update requires_ : [ No interruption] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt )
7575
@@ -81,9 +81,9 @@ _Required_: No
8181
8282_ Type_ : String
8383
84- _ Minimum _ : <code >20</code >
84+ _ Minimum Length _ : <code >20</code >
8585
86- _ Maximum _ : <code >250</code >
86+ _ Maximum Length _ : <code >250</code >
8787
8888_ Update requires_ : [ No interruption] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt )
8989
Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ Resources:
1515 Principal :
1616 Service : resources.cloudformation.amazonaws.com
1717 Action : sts:AssumeRole
18+ Condition :
19+ StringEquals :
20+ aws:SourceAccount :
21+ Ref : AWS::AccountId
22+ StringLike :
23+ aws:SourceArn :
24+ Fn::Sub : arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:type/resource/Example-GitHub-Repo/*
1825 Path : " /"
1926 Policies :
2027 - PolicyName : ResourceTypePolicy
Original file line number Diff line number Diff line change @@ -9,9 +9,13 @@ Globals:
99Resources :
1010 TypeFunction :
1111 Type : AWS::Serverless::Function
12+ Metadata :
13+ BuildMethod : go1.x
1214 Properties :
13- Handler : handler
14- Runtime : go1.x
15+ Handler : bootstrap
16+ Runtime : provided.al2
17+ Architectures :
18+ - x86_64
1519 CodeUri : bin/
1620 # Uncomment to test with AWS resources
1721 # Environment:
@@ -20,7 +24,11 @@ Resources:
2024
2125 TestEntrypoint :
2226 Type : AWS::Serverless::Function
27+ Metadata :
28+ BuildMethod : go1.x
2329 Properties :
24- Handler : handler
25- Runtime : go1.x
30+ Handler : bootstrap
31+ Runtime : provided.al2
32+ Architectures :
33+ - x86_64
2634 CodeUri : bin/
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ class GoExecutableNotFoundError(SysExitRecommendedError):
3232class GoLanguagePlugin (LanguagePlugin ):
3333 MODULE_NAME = __name__
3434 NAME = "go"
35- RUNTIME = "go1.x "
36- ENTRY_POINT = "handler "
37- TEST_ENTRY_POINT = "handler "
35+ RUNTIME = "provided.al2 "
36+ ENTRY_POINT = "bootstrap "
37+ TEST_ENTRY_POINT = "bootstrap "
3838 CODE_URI = "bin/"
3939
4040 def __init__ (self ):
@@ -251,7 +251,7 @@ def pre_package(project: Project):
251251
252252 @staticmethod
253253 def _find_exe (project : Project ):
254- exe_glob = list ((project .root / "bin" ).glob ("handler " ))
254+ exe_glob = list ((project .root / "bin" ).glob ("bootstrap " ))
255255 if not exe_glob :
256256 LOG .debug ("No Go executable match" )
257257 raise GoExecutableNotFoundError (
Original file line number Diff line number Diff line change 55
66test :
77 cfn generate
8- env GOOS=linux go build -ldflags=" -s -w" -o bin/handler cmd/main.go
8+ env GOOS=linux go build -ldflags=" -s -w" -tags= " lambda.norpc, $( TAGS ) " - o bin/bootstrap cmd/main.go
99
1010clean :
1111 rm -rf bin
Original file line number Diff line number Diff line change 44.PHONY: build
55build:
66 cfn generate
7- env GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -tags="$(TAGS)" -o bin/handler cmd/main.go
7+ env GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -tags="lambda.norpc, $(TAGS)" -o bin/bootstrap cmd/main.go
You can’t perform that action at this time.
0 commit comments