Skip to content

Commit f7d204e

Browse files
Initial commit
0 parents  commit f7d204e

19 files changed

+783
-0
lines changed

.github/workflows/build_push.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create and publish a Docker image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ['master']
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Log in to the Container registry
24+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
38+
with:
39+
context: ./app
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,intellij+all,visualstudiocode,terraform,go
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,intellij+all,visualstudiocode,terraform,go
4+
5+
### Go ###
6+
# If you prefer the allow list template instead of the deny list, see community template:
7+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
8+
#
9+
# Binaries for programs and plugins
10+
*.exe
11+
*.exe~
12+
*.dll
13+
*.so
14+
*.dylib
15+
16+
# Test binary, built with `go test -c`
17+
*.test
18+
19+
# Output of the go coverage tool, specifically when used with LiteIDE
20+
*.out
21+
22+
# Dependency directories (remove the comment below to include it)
23+
# vendor/
24+
25+
# Go workspace file
26+
go.work
27+
28+
### Go Patch ###
29+
/vendor/
30+
/Godeps/
31+
32+
### Intellij+all ###
33+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
34+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
35+
36+
# User-specific stuff
37+
.idea/**/workspace.xml
38+
.idea/**/tasks.xml
39+
.idea/**/usage.statistics.xml
40+
.idea/**/dictionaries
41+
.idea/**/shelf
42+
43+
# AWS User-specific
44+
.idea/**/aws.xml
45+
46+
# Generated files
47+
.idea/**/contentModel.xml
48+
49+
# Sensitive or high-churn files
50+
.idea/**/dataSources/
51+
.idea/**/dataSources.ids
52+
.idea/**/dataSources.local.xml
53+
.idea/**/sqlDataSources.xml
54+
.idea/**/dynamic.xml
55+
.idea/**/uiDesigner.xml
56+
.idea/**/dbnavigator.xml
57+
58+
# Gradle
59+
.idea/**/gradle.xml
60+
.idea/**/libraries
61+
62+
# Gradle and Maven with auto-import
63+
# When using Gradle or Maven with auto-import, you should exclude module files,
64+
# since they will be recreated, and may cause churn. Uncomment if using
65+
# auto-import.
66+
# .idea/artifacts
67+
# .idea/compiler.xml
68+
# .idea/jarRepositories.xml
69+
# .idea/modules.xml
70+
# .idea/*.iml
71+
# .idea/modules
72+
# *.iml
73+
# *.ipr
74+
75+
# CMake
76+
cmake-build-*/
77+
78+
# Mongo Explorer plugin
79+
.idea/**/mongoSettings.xml
80+
81+
# File-based project format
82+
*.iws
83+
84+
# IntelliJ
85+
out/
86+
87+
# mpeltonen/sbt-idea plugin
88+
.idea_modules/
89+
90+
# JIRA plugin
91+
atlassian-ide-plugin.xml
92+
93+
# Cursive Clojure plugin
94+
.idea/replstate.xml
95+
96+
# SonarLint plugin
97+
.idea/sonarlint/
98+
99+
# Crashlytics plugin (for Android Studio and IntelliJ)
100+
com_crashlytics_export_strings.xml
101+
crashlytics.properties
102+
crashlytics-build.properties
103+
fabric.properties
104+
105+
# Editor-based Rest Client
106+
.idea/httpRequests
107+
108+
# Android studio 3.1+ serialized cache file
109+
.idea/caches/build_file_checksums.ser
110+
111+
### Intellij+all Patch ###
112+
# Ignore everything but code style settings and run configurations
113+
# that are supposed to be shared within teams.
114+
115+
.idea/*
116+
117+
!.idea/codeStyles
118+
!.idea/runConfigurations
119+
120+
### Linux ###
121+
*~
122+
123+
# temporary files which can be created if a process still has a handle open of a deleted file
124+
.fuse_hidden*
125+
126+
# KDE directory preferences
127+
.directory
128+
129+
# Linux trash folder which might appear on any partition or disk
130+
.Trash-*
131+
132+
# .nfs files are created when an open file is removed but is still being accessed
133+
.nfs*
134+
135+
### macOS ###
136+
# General
137+
.DS_Store
138+
.AppleDouble
139+
.LSOverride
140+
141+
# Icon must end with two \r
142+
Icon
143+
144+
145+
# Thumbnails
146+
._*
147+
148+
# Files that might appear in the root of a volume
149+
.DocumentRevisions-V100
150+
.fseventsd
151+
.Spotlight-V100
152+
.TemporaryItems
153+
.Trashes
154+
.VolumeIcon.icns
155+
.com.apple.timemachine.donotpresent
156+
157+
# Directories potentially created on remote AFP share
158+
.AppleDB
159+
.AppleDesktop
160+
Network Trash Folder
161+
Temporary Items
162+
.apdisk
163+
164+
### Terraform ###
165+
# Local .terraform directories
166+
**/.terraform/*
167+
168+
# .tfstate files
169+
*.tfstate
170+
*.tfstate.*
171+
172+
# Crash log files
173+
crash.log
174+
crash.*.log
175+
176+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
177+
# password, private keys, and other secrets. These should not be part of version
178+
# control as they are data points which are potentially sensitive and subject
179+
# to change depending on the environment.
180+
*.tfvars
181+
*.tfvars.json
182+
183+
# Ignore override files as they are usually used to override resources locally and so
184+
# are not checked in
185+
override.tf
186+
override.tf.json
187+
*_override.tf
188+
*_override.tf.json
189+
190+
# Include override files you do wish to add to version control using negated pattern
191+
# !example_override.tf
192+
193+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
194+
# example: *tfplan*
195+
196+
# Ignore CLI configuration files
197+
.terraformrc
198+
terraform.rc
199+
200+
### VisualStudioCode ###
201+
.vscode/*
202+
!.vscode/settings.json
203+
!.vscode/tasks.json
204+
!.vscode/launch.json
205+
!.vscode/extensions.json
206+
!.vscode/*.code-snippets
207+
208+
# Local History for Visual Studio Code
209+
.history/
210+
211+
# Built Visual Studio Code Extensions
212+
*.vsix
213+
214+
### VisualStudioCode Patch ###
215+
# Ignore all local history of files
216+
.history
217+
.ionide
218+
219+
# Support for Project snippet scope
220+
221+
### Windows ###
222+
# Windows thumbnail cache files
223+
Thumbs.db
224+
Thumbs.db:encryptable
225+
ehthumbs.db
226+
ehthumbs_vista.db
227+
228+
# Dump file
229+
*.stackdump
230+
231+
# Folder config file
232+
[Dd]esktop.ini
233+
234+
# Recycle Bin used on file shares
235+
$RECYCLE.BIN/
236+
237+
# Windows Installer files
238+
*.cab
239+
*.msi
240+
*.msix
241+
*.msm
242+
*.msp
243+
244+
# Windows shortcuts
245+
*.lnk
246+
247+
# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows,intellij+all,visualstudiocode,terraform,go

.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.62.3
4+
hooks:
5+
- id: terraform_fmt
6+
- id: terraform_validate
7+
- id: terraform_docs
8+
- id: terraform_tflint
9+
args:
10+
- '--args=--config=./tflint.hcl'

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# AWS EKS IAM Roles for Service Accounts Example

app/Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ARG GO_VERSION=1.18
2+
FROM golang:${GO_VERSION}-bullseye AS build
3+
4+
WORKDIR /go/src/app
5+
ADD . .
6+
7+
RUN go get -d -v ./...
8+
9+
RUN CGO_ENABLED=0 go build -installsuffix 'static' -o /app .
10+
11+
FROM gcr.io/distroless/static AS final
12+
13+
USER nonroot:nonroot
14+
15+
COPY --from=build --chown=nonroot:nonroot /app /app
16+
17+
ENTRYPOINT ["/app"]

app/go.mod

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module github.com/samuelbagattin/medium-irsa/app
2+
3+
go 1.18
4+
5+
require github.com/aws/aws-sdk-go v1.43.31
6+
7+
require github.com/jmespath/go-jmespath v0.4.0 // indirect

app/go.sum

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
github.com/aws/aws-sdk-go v1.43.31 h1:yJZIr8nMV1hXjAvvOLUFqZRJcHV7udPQBfhJqawDzI0=
2+
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
3+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
4+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
6+
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
7+
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
8+
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
9+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
10+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
11+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
12+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
13+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
14+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
15+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
16+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
18+
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
19+
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
20+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
21+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
22+
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
23+
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)