Skip to content

Instantly share code, notes, and snippets.

@alsmola
alsmola / policy.yml
Last active May 8, 2022 22:22
Permissions for IAM deploy role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"signer:GetSigningProfile",
"signer:PutSigningProfile"
]
"Resource": "arn:aws:signer:us-east-1:[account-number]:/signing-profiles/[signing-profile-name]"
@alsmola
alsmola / serverless.yml
Last active May 8, 2022 18:11
Serverless configuration for a SigningProfile and CodeSigningConfig
Resources:
SigningProfile:
Type: AWS::Signer::SigningProfile
Properties:
PlatformId: AWSLambda-SHA384-ECDSA
CodesignedFunctionConfig:
Type: AWS::Lambda::CodeSigningConfig
Properties:
Description: "GitHub Action Code Signing for Lambdas"
AllowedPublishers:
@alsmola
alsmola / deploy.yml
Created May 8, 2022 18:03
GitHub Action configuration to deploy to AWS via OIDC and Serverless
name: Deploy main to production
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
# CircleCI configuration to publish markdown files to Confluence
version: 2
jobs:
build:
branches:
only:
- master
docker:
- image: circleci/golang:1.13.11
@alsmola
alsmola / main.go
Last active March 26, 2021 02:03
Template for Lambda external select menu handler for Serverless Slack Block Kit application
package main
import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/slack-go/slack"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
@alsmola
alsmola / main.go
Created March 6, 2021 22:25
Template for Lambda auth callback handler for Serverless Slack Block Kit application
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
@alsmola
alsmola / main.go
Last active March 26, 2021 02:04
Template for Lambda events handler for Serverless Slack Block Kit application
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"github.com/aws/aws-lambda-go/events"
@alsmola
alsmola / main.go
Last active March 26, 2021 02:03
Template for Lambda interactions handler for Serverless Slack Block Kit application
package main
import (
"context"
"encoding/json"
"fmt"
"net/url"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
@alsmola
alsmola / Makefile
Last active March 6, 2021 21:58
Template for Makefile for Serverless Slack Block Kit application
.PHONY: build clean deploy
build:
env GOOS=linux go build -ldflags="-s -w" -o bin/interactionsBin interactions/main.go
env GOOS=linux go build -ldflags="-s -w" -o bin/eventHandlerBin eventhandler/main.go
env GOOS=linux go build -ldflags="-s -w" -o bin/authCallbackBin authcallback/main.go
env GOOS=linux go build -ldflags="-s -w" -o bin/selectMenuBin selectmenu/main.go
clean:
rm -rf ./bin ./vendor Gopkg.lock
@alsmola
alsmola / serverless.yml
Last active March 6, 2021 21:58
Template for Serverless Slack Block Kit application.
service: pupster # change service name
provider:
name: aws
runtime: go1.x
region: us-east-1 #update region
iamRoleStatements: # add IAM statements here
package:
exclude:
- ./**