Skip to content

Commit

Permalink
feat: migrate from deprecated go1.x to provided.al2 and use arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
midu-git authored and ChrisPates committed Oct 25, 2023
1 parent 014accf commit 410be6f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ test:
go-build:
go build -o $(APP_NAME) main.go

build-SSOSyncFunction:
GOOS=linux GOARCH=arm64 go build -o bootstrap main.go
cp ./bootstrap $(ARTIFACTS_DIR)/.

.PHONY: clean
clean:
rm -f $(OUTPUT) $(PACKAGED_TEMPLATE)
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func Handler(ctx context.Context, event events.CodePipelineEvent) (string, error
func init() {
// init config
cfg = config.New()
cfg.IsLambda = len(os.Getenv("_LAMBDA_SERVER_PORT")) > 0
cfg.IsLambda = len(os.Getenv("AWS_LAMBDA_FUNCTION_NAME")) > 0

// initialize cobra
cobra.OnInitialize(initConfig)
Expand Down
8 changes: 6 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ Resources:
SSOSyncFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: go1.x
Handler: dist/ssosync_linux_amd64_v1/ssosync
Runtime: provided.al2
Handler: bootstrap
Architectures:
- arm64
Timeout: 300
Environment:
Variables:
Expand Down Expand Up @@ -185,6 +187,8 @@ Resources:
Properties:
Enabled: true
Schedule: !Ref ScheduleExpression
Metadata:
BuildMethod: makefile

AWSGoogleCredentialsSecret:
Type: "AWS::SecretsManager::Secret"
Expand Down

0 comments on commit 410be6f

Please sign in to comment.