Skip to content

Commit 410be6f

Browse files
midu-gitChrisPates
authored andcommitted
feat: migrate from deprecated go1.x to provided.al2 and use arm64
1 parent 014accf commit 410be6f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ test:
1616
go-build:
1717
go build -o $(APP_NAME) main.go
1818

19+
build-SSOSyncFunction:
20+
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
21+
cp ./bootstrap $(ARTIFACTS_DIR)/.
22+
1923
.PHONY: clean
2024
clean:
2125
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)

cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
136136
func init() {
137137
// init config
138138
cfg = config.New()
139-
cfg.IsLambda = len(os.Getenv("_LAMBDA_SERVER_PORT")) > 0
139+
cfg.IsLambda = len(os.Getenv("AWS_LAMBDA_FUNCTION_NAME")) > 0
140140

141141
// initialize cobra
142142
cobra.OnInitialize(initConfig)

template.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ Resources:
129129
SSOSyncFunction:
130130
Type: AWS::Serverless::Function
131131
Properties:
132-
Runtime: go1.x
133-
Handler: dist/ssosync_linux_amd64_v1/ssosync
132+
Runtime: provided.al2
133+
Handler: bootstrap
134+
Architectures:
135+
- arm64
134136
Timeout: 300
135137
Environment:
136138
Variables:
@@ -185,6 +187,8 @@ Resources:
185187
Properties:
186188
Enabled: true
187189
Schedule: !Ref ScheduleExpression
190+
Metadata:
191+
BuildMethod: makefile
188192

189193
AWSGoogleCredentialsSecret:
190194
Type: "AWS::SecretsManager::Secret"

0 commit comments

Comments
 (0)