Skip to content
Open

Vpc #433

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
589 commits
Select commit Hold shift + click to select a range
1343d73
Create kube prometheus stack (#193)
sekka1 Oct 7, 2021
f9057c6
Adding nginx-ingress (#195)
sekka1 Oct 7, 2021
3651ade
Nginx update for the workspace
sekka1 Oct 7, 2021
77bd746
Creating loki log (#196)
sekka1 Oct 7, 2021
9c0c4f6
Updating ingress class usage
sekka1 Oct 7, 2021
7354195
Merge branch 'main' of github.com:ManagedKube/kubernetes-ops
sekka1 Oct 7, 2021
9988e35
Updating ingress class usage
sekka1 Oct 7, 2021
764cee9
Updating ingress class usage
sekka1 Oct 7, 2021
64dc02e
Adding istio
sekka1 Oct 7, 2021
eabc5f2
updating vars attribs
sekka1 Oct 7, 2021
3618b41
Rounding out istio install
sekka1 Oct 7, 2021
00ec5d3
Rounding out istio install
sekka1 Oct 7, 2021
0bf2a07
Adding istiod values
sekka1 Oct 7, 2021
4e999bb
Removing local source comment
sekka1 Oct 7, 2021
65d29dc
Setting to a tagged version
sekka1 Oct 7, 2021
aec4913
Add a fix to instructions if error has occured (#170)
ColtonMcEwen Oct 7, 2021
634e7ec
Adding diagram into the readme
sekka1 Oct 7, 2021
5841f5a
Merge branch 'main' of github.com:ManagedKube/kubernetes-ops
sekka1 Oct 7, 2021
099df2b
Adding second helm values input
sekka1 Oct 7, 2021
b2f6cb9
Adding route53 hosted zone
sekka1 Oct 7, 2021
fc2a1cc
External-dns helm module (#198)
sekka1 Oct 7, 2021
71998b3
External dns (#199)
sekka1 Oct 7, 2021
26e3ffa
Adding output
sekka1 Oct 7, 2021
1476ea4
Adding output
sekka1 Oct 7, 2021
76f25f7
Adding tls cert
sekka1 Oct 8, 2021
e3f8323
Disabling istio sidecar for the patch pod
sekka1 Oct 8, 2021
c8cfd2d
Fixing backend protocol
sekka1 Oct 8, 2021
3acf8de
Adding istio sidecar disable for admissionwebhook
sekka1 Oct 8, 2021
11527fa
Cert manager (#200)
sekka1 Oct 8, 2021
5d4f2a7
Adding cert-manager
sekka1 Oct 8, 2021
1ce057c
Watching istio for hostnames
sekka1 Oct 8, 2021
2dc2879
Watching istio for hostnames
sekka1 Oct 8, 2021
4ca3c85
Watching istio for hostnames
sekka1 Oct 8, 2021
f8431e4
Istio Networking (#202)
sekka1 Oct 8, 2021
e32b5f1
Internal ELB example (#203)
sekka1 Oct 8, 2021
041f026
Kubernetes-external-secrets (#204)
sekka1 Oct 8, 2021
4f3bb74
Updating base prometheus chart (#206)
sekka1 Oct 8, 2021
0fef38e
Updating prometheus (#207)
sekka1 Oct 8, 2021
9e5115c
Adding Prom Cert (#208)
sekka1 Oct 8, 2021
064ec68
Adding EKS logs doc
sekka1 Oct 14, 2021
1ef48fc
Adding node version
sekka1 Oct 14, 2021
2aedbbb
Parameterizing the base doman name
sekka1 Oct 14, 2021
91d84f8
Adding readme and default cert
sekka1 Oct 14, 2021
c1ce244
Adding nginx default cert
sekka1 Oct 14, 2021
d8d79a6
Updaing loki helm to v2.5.0
sekka1 Oct 15, 2021
c001a98
Pegging helm version (#210)
sekka1 Nov 10, 2021
4532984
samples to set up staging environment (#213)
seethatgo Nov 21, 2021
6054a2c
Mongodbatlas (#216)
sekka1 Nov 23, 2021
e09e9c8
README for staging example (#215)
seethatgo Nov 23, 2021
bcf71fd
Mongodbatlas (#217)
sekka1 Nov 23, 2021
af06764
Cleaning up variables.tf file for eks module (#211)
mybarretto Nov 23, 2021
d8d03bd
Adding new loki-stack storing the logs on an s3 bucket (#212)
grebois Nov 24, 2021
84fbb9b
Adding wireguard docs
sekka1 Nov 24, 2021
95dfb04
Route53 - removing hardcoded provider (#219)
sekka1 Dec 1, 2021
4ab3416
Updating readme with aws provider region settings
sekka1 Dec 1, 2021
dc6148e
Istio Main Gateway (#220)
sekka1 Dec 2, 2021
e2064cd
EKS data module (#221)
sekka1 Dec 2, 2021
d1e8daf
Mongo aws secret (#223)
sekka1 Dec 7, 2021
0500df3
Create terraform-pipeline-staging.yaml (#222)
seethatgo Dec 8, 2021
d8cb30f
Mongo - 100.64.0.0/16 inbound sg access (#225)
sekka1 Dec 9, 2021
6c641e4
MongoDB Atlas - Users module (#226)
sekka1 Dec 9, 2021
e7532fa
Removing unused input vars (#227)
sekka1 Dec 9, 2021
402f8a7
Mongo - User name parameterization (#228)
sekka1 Dec 9, 2021
545ddd4
Fixing var usage (#229)
sekka1 Dec 9, 2021
879bcca
Example of prometheus scraping istio endpoints (#233)
sekka1 Dec 17, 2021
bd25a28
AWS/Github OIDC Federation permissions (#235)
sekka1 Jan 4, 2022
9f69d1e
Github AWS OIDC (#237)
sekka1 Jan 4, 2022
7a35104
Removing github-oidc-provider - it is now in its own repo
sekka1 Jan 4, 2022
db84906
Instance creation (#238)
sekka1 Jan 7, 2022
584b230
EKS - updating module to use v18.0.6 (#239)
sekka1 Jan 12, 2022
982b370
EKS - v17.24.0 (#240)
sekka1 Jan 12, 2022
d53c5f5
EC2 updates
sekka1 Jan 12, 2022
9cc9709
Fixing params
sekka1 Jan 12, 2022
97ef10c
ssh public key var update
sekka1 Jan 13, 2022
7e8f068
ssh public key var update
sekka1 Jan 13, 2022
ddd2b2f
Removing datadog role
sekka1 Jan 13, 2022
0fff232
Changing default instance type
sekka1 Jan 13, 2022
6fde5db
Removing cloud-init items
sekka1 Jan 13, 2022
dfcaefe
Defining input type
sekka1 Jan 17, 2022
a93caaf
Setting default
sekka1 Jan 20, 2022
51a7407
Mongo Atlas - IAM Policy (#241)
sekka1 Jan 20, 2022
15cb704
Mongo Atlas user output (#242)
sekka1 Jan 20, 2022
d19c20c
Mongo outputs (#243)
sekka1 Jan 21, 2022
0ae9f37
Kubernetes - namespace (#244)
sekka1 Jan 24, 2022
1665e56
Aws sg (#246)
sekka1 Jan 27, 2022
27de113
output vars for route table ids public and privates subnets and name …
bcarranza Feb 8, 2022
7cc72b7
add secondary cidr_blocks as output var in vpc mod (#248)
bcarranza Feb 9, 2022
21607a8
Adding an optional custom user for Mongo Atlas (#249)
mybarretto Feb 10, 2022
939653d
Exposing IAM Role ARNs as outputs of the EKS module (#250)
mybarretto Feb 10, 2022
4eb82f4
Removing provider (#251)
garland-kan-sage Feb 10, 2022
2f7a468
MSK updates (#252)
sekka1 Feb 11, 2022
8a377d6
MSK CRL enable (#253)
sekka1 Feb 11, 2022
d11f102
Certificate on-demand in istio-gateway and new input params gateway h…
bcarranza Feb 18, 2022
38d4415
default values cert_common_name and cert_dns_name (#258)
bcarranza Feb 19, 2022
0b1029a
sintaxs error: replace host with hosts (#259)
bcarranza Feb 22, 2022
a656e02
External secrets (#262)
sekka1 Feb 24, 2022
75d63e8
Datadog (#263)
sekka1 Mar 3, 2022
66696ee
EKS Module 18.7.2 Update (#261)
sekka1 Mar 4, 2022
b1b9dca
Re-usable workflow to update a remote repository (#264)
sekka1 Mar 5, 2022
cc095a9
Additional examples
sekka1 Mar 8, 2022
e2c327e
Kube prom stack 33.2.0 (#266)
sekka1 Mar 9, 2022
9e30262
New input var account_id (#267)
bcarranza Mar 9, 2022
481f262
EMR (#268)
sekka1 Mar 10, 2022
a5e380d
Athena (#269)
sekka1 Mar 10, 2022
aa5b776
Adding alertmanagerConfigSelector
sekka1 Mar 11, 2022
24a8d54
Msk update (#270)
sekka1 Mar 11, 2022
c147afd
Adding where this policy came from
sekka1 Mar 11, 2022
40c694e
removing
sekka1 Mar 11, 2022
6d12b2c
Adding source policy location
sekka1 Mar 11, 2022
532cc69
AWS Airflow (#271)
sekka1 Mar 15, 2022
58b23b1
AWS QLDB (#272)
sekka1 Mar 15, 2022
c7a6985
testkube (#274)
sekka1 Mar 23, 2022
d1423c7
Gha testkube (#275)
sekka1 Mar 23, 2022
7183092
Manifest set (#276)
sekka1 Mar 24, 2022
ff77fbc
kube-prometheus-stack - 34.1.1 (#277)
sekka1 Mar 28, 2022
66c3d7e
Adding information on how to send a test alert
sekka1 Mar 29, 2022
8f5aca2
Updating default managed node group values
sekka1 Apr 5, 2022
5bf122b
Mongo Atlas User List (#278)
sekka1 Apr 7, 2022
bd4e6ac
Fixing output
sekka1 Apr 7, 2022
61ac8a7
Grafana tempo (#279)
sekka1 Apr 11, 2022
fa82a85
Mongo alerts (#280)
sekka1 Apr 12, 2022
7400cf8
Grafana tempo example app to generate data for APM
sekka1 Apr 12, 2022
ad9c6e4
Enable percent encoding password (#281)
bcarranza Apr 18, 2022
7c00728
Istio 1.12.6 (#282)
sekka1 Apr 20, 2022
b218493
Adding getting slack api token info
Apr 20, 2022
2759999
K8s assumable role (#283)
sekka1 Apr 20, 2022
961b865
Adding all scopes needed
Apr 22, 2022
dc4697e
Mongo default alerts (#284)
sekka1 Apr 22, 2022
3fc7fdb
Opentelemetry updates (#287)
sekka1 May 10, 2022
2405712
terragrunt-dev environment (#288)
sekka1 May 12, 2022
16aba1b
Terragrunt-dev - vpc (#289)
sekka1 May 12, 2022
7cb75af
Pipeline terraform dev (#290)
sekka1 May 12, 2022
1b57711
Adding lock file
May 12, 2022
97e594e
EKS (#291)
sekka1 May 12, 2022
9c25084
EKS (#292)
sekka1 May 12, 2022
20fc411
EKS - Adding user (#293)
sekka1 May 12, 2022
629d6d8
Updating user
May 13, 2022
a0b7f2d
Adding sso admin role
May 13, 2022
d4726a8
EKS - fixing the name (#294)
sekka1 May 13, 2022
face8c9
VPC
May 13, 2022
8c9c06d
EKS (#295)
sekka1 May 13, 2022
674aeac
Route53 (#296)
sekka1 May 13, 2022
0b5b8d7
Cluster autoscaler (#297)
sekka1 May 13, 2022
40f695f
Cert Manager (#298)
sekka1 May 13, 2022
84ab270
Cert Manager Update (#299)
sekka1 May 13, 2022
8eb54e0
Istio (#300)
sekka1 May 17, 2022
577f29d
Istio (#301)
sekka1 May 17, 2022
bddc394
CR-150 Security Group Default Management (#307)
bcarranza Jun 1, 2022
d5f007c
Feat: pod assumable arns policy list (#308)
bcarranza Jun 13, 2022
1d1702f
Aws s3 encrypt update (#309)
sekka1 Jun 14, 2022
272a1d5
aws-s3-encrypt-update-2 (#310)
sekka1 Jun 15, 2022
9316c94
AWS S3 updates (#312)
sekka1 Jun 15, 2022
990d869
Updating Readme
sekka1 Jun 15, 2022
67e9055
Updating
sekka1 Jun 15, 2022
5e5fd51
Terragrunt - Prometheus Stack (#313)
sekka1 Jun 16, 2022
05da0a7
Terragrunt GHA destroy pipeline (#314)
sekka1 Jun 16, 2022
c245a4e
Adding kubergrunt exec location
sekka1 Jun 16, 2022
7ec2647
Adding progress doc
sekka1 Jun 16, 2022
1fcaa9b
Adding destroy pipeline
sekka1 Jun 16, 2022
d1ee485
Removing istio and prometheus to rename the folders
sekka1 Jun 16, 2022
aa759e8
Removing cert-manager for the rename
sekka1 Jun 16, 2022
ed5e6f4
Updating progress doc with the new structure
sekka1 Jun 16, 2022
e66b7c8
Terragrunt - TestKube (#315)
sekka1 Jun 16, 2022
b53dba7
Removing testkube
sekka1 Jun 16, 2022
652fc34
Updating doc
sekka1 Jun 16, 2022
0ab6396
Updating kubergrunt version
sekka1 Jun 16, 2022
695c643
Feat cloudpass cloudwatch cloudtrail alarm (#311)
bcarranza Jun 16, 2022
fb9b7ba
100-route53-hostedzone (#317)
sekka1 Jun 16, 2022
c5ea170
Adding notes
sekka1 Jun 16, 2022
3e7f116
Removing --terragrunt-non-interactive arg
sekka1 Jun 16, 2022
eda01c1
150-vpc (#318)
sekka1 Jun 16, 2022
c62840c
200-eks (#319)
sekka1 Jun 16, 2022
c7c21d1
250-eks-cluster-autoscaler (#320)
sekka1 Jun 16, 2022
18b8383
Updating doc
sekka1 Jun 16, 2022
3d9d068
200-eks (#323)
sekka1 Jun 16, 2022
dc947db
Updating docs
sekka1 Jun 16, 2022
e0b45a1
EKS - Auth - Back to regular auth config map usage (#322)
sekka1 Jun 16, 2022
746553b
EKS - setting to the release tagged version (#324)
sekka1 Jun 16, 2022
afd4845
updating doc
sekka1 Jun 16, 2022
334e47a
250-eks-cluster-autoscaler (#325)
sekka1 Jun 16, 2022
22f82b4
100-cert-manager (#321)
sekka1 Jun 16, 2022
28e0188
100-cert-manager (#327)
sekka1 Jun 16, 2022
73864ac
Adding lock file
sekka1 Jun 16, 2022
6674de7
100-cert-manager-issuers (#328)
sekka1 Jun 17, 2022
897d5e3
Cert-manager - refactor (#326)
sekka1 Jun 17, 2022
b062d84
Setting to the release tags
sekka1 Jun 17, 2022
f695b6f
110-testkube (#329)
sekka1 Jun 17, 2022
b4925cc
110-testkube-infra-base (#330)
sekka1 Jun 17, 2022
8e7aef5
110 testkube local (#331)
sekka1 Jun 17, 2022
6465b46
Updating release tag
sekka1 Jun 17, 2022
189e065
gha-testkube-run (#332)
sekka1 Jun 17, 2022
0b223a2
120-external-dns (#334)
sekka1 Jun 17, 2022
a9145b1
external-dns-update (#335)
sekka1 Jun 17, 2022
149b863
Setting to a released tag
sekka1 Jun 17, 2022
4e3c6c6
130-external-secrets (#336)
sekka1 Jun 17, 2022
aea2a0d
Updating doc
sekka1 Jun 17, 2022
eded033
Pegging helm provider to the older version (#337)
sekka1 Jun 17, 2022
58080fb
updating doc
sekka1 Jun 17, 2022
cf285ef
130-external-secret-store (#338)
sekka1 Jun 17, 2022
a3a7a48
enabled rotation for kms eks cluster (#333)
bcarranza Jun 20, 2022
c87c434
200-istio (#339)
sekka1 Jun 21, 2022
ae4d07c
200 istio (#340)
sekka1 Jun 21, 2022
6b15630
Updating docs
sekka1 Jun 21, 2022
be14fc3
Feat bucket-owner-enforce s3 (#341)
bcarranza Jun 21, 2022
3f0bb7f
kube-prometheus-stack (#343)
sekka1 Jun 23, 2022
7cc199f
kube-prom-stack-cert (#344)
sekka1 Jun 23, 2022
ca92406
istio-domain-wildcard-cert (#345)
sekka1 Jun 23, 2022
5a06e23
Adding more notes about the cert
sekka1 Jun 23, 2022
524f32b
Adding grafana url
sekka1 Jun 24, 2022
b8f16f1
CloudTrail Improvements to avoid prowler alerts (#342)
bcarranza Jun 24, 2022
1778a73
change 365 retention days in cloudwatch (#347)
bcarranza Jun 27, 2022
72a3ecc
adding testkube notes
sekka1 Jun 28, 2022
154f9e2
220-grafana-loki (#348)
sekka1 Jun 28, 2022
5e25cf6
Adding lock file
sekka1 Jun 28, 2022
4a6e3ba
adding terraform lock file
sekka1 Jun 28, 2022
c23fce2
230-opentelemetry (#349)
sekka1 Jun 28, 2022
f014474
230-opentelemetry-operator (#350)
sekka1 Jun 28, 2022
98288e6
Adding notes
sekka1 Jun 28, 2022
ba843c7
230-opentelemetry-collector (#351)
sekka1 Jun 28, 2022
0d96d3c
adding notes
sekka1 Jun 28, 2022
23d2f9b
500-sample-app-opentelemetry (#352)
sekka1 Jun 28, 2022
f817b62
ingress for the sample app 1
sekka1 Jun 28, 2022
9e69396
Enabling ingress
sekka1 Jun 28, 2022
5200de1
Removing ingress
sekka1 Jun 28, 2022
5992b53
Enabling ingress
sekka1 Jun 28, 2022
d4840d4
Adding TLS
sekka1 Jun 28, 2022
1fa4c62
istio-external-dns-star-dns (#353)
sekka1 Jun 28, 2022
04533f9
Updating notes
sekka1 Jun 28, 2022
ef5c60d
510-sample-app-opentel-2 (#354)
sekka1 Jun 28, 2022
4bb7928
Fixing namespace
sekka1 Jun 28, 2022
aaa7361
Fixing input command
sekka1 Jun 28, 2022
97824ad
fixing-ingress-path (#355)
sekka1 Jun 29, 2022
26e5fc0
Add Kms to cloudposse in cloud-trail-watch-alarms (#356)
bcarranza Jun 30, 2022
e7c351c
Fixing ingress path (#357)
sekka1 Jul 1, 2022
5c3efa4
eks-update-1-22 (#358)
sekka1 Jul 1, 2022
dbdbe7c
Add kms to eks cloudwatch log group (#360)
bcarranza Jul 6, 2022
7006499
rfc1918 and rfc6598 in default_security_group_egress (#361)
bcarranza Jul 11, 2022
6124ac5
Feat add kms cloudtrail (#362)
bcarranza Jul 18, 2022
24872e3
fix kms version v2.0.40 (#363)
bcarranza Jul 18, 2022
2433fe7
Adding doc link
sekka1 Jul 20, 2022
6c783e9
Istio Kiali (#364)
sekka1 Jul 25, 2022
dbeacfb
adding kiali
sekka1 Jul 25, 2022
ff1e7f5
Updating kiali (#365)
sekka1 Jul 25, 2022
6522999
Updating kiali to the latest version
sekka1 Jul 25, 2022
d5bcc36
VPC with two public subnets
davidabouhalaka May 15, 2023
b4d7095
add local runs
davidabouhalaka May 15, 2023
6fb113d
fix local runs
davidabouhalaka May 15, 2023
7173032
fix typo
davidabouhalaka May 15, 2023
dbb8492
EKS change
davidabouhalaka May 15, 2023
5510762
EKS demo
davidabouhalaka May 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
121 changes: 121 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM golang:1.15

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Configure apt, install packages and tools
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog unzip bash-completion vim 2>&1 \
#
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install git openssh-client less iproute2 procps lsb-release \
#
# Build Go tools w/module support
&& mkdir -p /tmp/gotools \
&& cd /tmp/gotools \
&& GOPATH=/tmp/gotools GO111MODULE=on go get -v golang.org/x/tools/gopls@latest 2>&1 \
&& GOPATH=/tmp/gotools GO111MODULE=on go get -v \
honnef.co/go/tools/...@latest \
golang.org/x/tools/cmd/gorename@latest \
golang.org/x/tools/cmd/goimports@latest \
golang.org/x/tools/cmd/guru@latest \
golang.org/x/lint/golint@latest \
github.com/mdempsky/gocode@latest \
github.com/cweill/gotests/...@latest \
github.com/haya14busa/goplay/cmd/goplay@latest \
github.com/sqs/goreturns@latest \
github.com/josharian/impl@latest \
github.com/davidrjenni/reftools/cmd/fillstruct@latest \
github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest \
github.com/ramya-rao-a/go-outline@latest \
github.com/acroca/go-symbols@latest \
github.com/godoctor/godoctor@latest \
github.com/rogpeppe/godef@latest \
github.com/zmb3/gogetdoc@latest \
github.com/fatih/gomodifytags@latest \
github.com/mgechev/revive@latest \
github.com/go-delve/delve/cmd/dlv@latest 2>&1 \
#
# Build Go tools w/o module support
&& GOPATH=/tmp/gotools go get -v github.com/alecthomas/gometalinter 2>&1 \
#
# Build gocode-gomod
&& GOPATH=/tmp/gotools go get -x -d github.com/stamblerre/gocode 2>&1 \
&& GOPATH=/tmp/gotools go build -o gocode-gomod github.com/stamblerre/gocode \
#
# Install Go tools
&& mv /tmp/gotools/bin/* /usr/local/bin/ \
&& mv gocode-gomod /usr/local/bin/ \
#
# Install golangci-lint
# && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin 2>&1 \
# Fails on OSX. Problem seems to be the SSL certs are not correct in this local docker installation
#
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
&& groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
# [Optional] Add sudo support
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
#
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /tmp/gotools

# Manually installing golangci-lint
RUN wget --no-check-certificate https://github.com/golangci/golangci-lint/releases/download/v1.30.0/golangci-lint-1.30.0-linux-amd64.deb
RUN dpkg -i golangci-lint-1.30.0-linux-amd64.deb

# Update this to "on" or "off" as appropriate
ENV GO111MODULE=auto

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

# Install kubectl
RUN sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl
RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
RUN echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
RUN sudo apt-get update
RUN sudo apt-get install -y kubectl

# Install Terraform
WORKDIR /tmp
RUN wget https://releases.hashicorp.com/terraform/0.15.0/terraform_0.15.0_linux_amd64.zip
RUN unzip terraform_0.15.0_linux_amd64.zip
RUN cp /tmp/terraform /usr/local/bin/terraform

# Install Terragrunt
RUN wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.26.7/terragrunt_linux_amd64
RUN chmod 755 ./terragrunt_linux_amd64
RUN cp terragrunt_linux_amd64 /usr/local/bin/terragrunt

# Install saml2aws
RUN wget https://github.com/Versent/saml2aws/releases/download/v2.27.1/saml2aws_2.27.1_linux_amd64.tar.gz
RUN tar -zxvf saml2aws_2.27.1_linux_amd64.tar.gz
RUN cp saml2aws /usr/local/bin/saml2aws

# Install aws cli
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install

# Install helm
RUN wget https://get.helm.sh/helm-v3.5.4-linux-amd64.tar.gz
RUN tar -zxvf helm-v3.5.4-linux-amd64.tar.gz
RUN cp linux-amd64/helm /usr/local/bin/helm
1 change: 1 addition & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Source: https://github.com/microsoft/vscode-remote-try-go
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Doc config: https://code.visualstudio.com/docs/remote/containers
// Config reference: https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_attached-container-configuration-reference
// Host network mode: https://docs.microsoft.com/en-us/visualstudio/codespaces/reference/configuring#host-network-mode
{
"name": "ManagedKube",
"dockerFile": "Dockerfile",
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--network=host" ],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [9000],

// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"go.gopath": "/go",
"go.inferGopath": true,
"go.useLanguageServer": true
},

// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"golang.Go",
"4ops.terraform"
],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "go version",

// Comment out the next line to run as root
"remoteUser": "vscode",

// https://code.visualstudio.com/docs/remote/containers-advanced#_adding-another-local-file-mount
"mounts": [
// Mounting local kubeconfig into the container
"source=${localEnv:HOME}/.kube/config,target=/home/vscode/.kube/config,type=bind,consistency=cached",
// Mounting local saml2aws into the container
"source=${localEnv:HOME}/.saml2aws,target=/home/vscode/.saml2aws,type=bind,consistency=cached",
// Mounting the local terraform cloud login token into the container
"source=${localEnv:HOME}/.terraform.d,target=/home/vscode/.terraform.d,type=bind,consistency=cached",
]
}
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

*.terragrunt-cache

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
154 changes: 154 additions & 0 deletions .github/workflows/terraform-pipeline-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# The name of the pipeline. Must be unique.
name: "Terraform - AWS"

on:
push:
# only run when files in this path changes
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns-1
paths:
- 'terraform-environments/aws/dev/**'
branches:
- main
pull_request:
# only run when files in this path changes
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-using-positive-and-negative-patterns-1
paths:
- 'terraform-environments/aws/dev/**'

jobs:
## This generates a matrix of changed directory to run Terraform on
generate_matrix:
runs-on: ubuntu-latest
env:
# The path that you want to construct the matrix on. Only files in this
# path that has changed will be included in.
TERRAFORM_CHECK_PATH: terraform-environments/aws/dev
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: get parent directory and set matrix
id: set-matrix
run: |
# A list of files that changed
git diff --name-only HEAD^ HEAD $TERRAFORM_CHECK_PATH > files1.txt

# Output a list of parent folder stripping out the file name
# leaving only the parent dir name
while IFS= read -r file
do
parent_dir=$(dirname -- "$file")
echo $parent_dir >> file2.txt
done < files1.txt

echo "## All changed directories"
cat file2.txt

# There can be duplicates in the parent dir name if multiple
# files changed in that parent dir. This is to output a list
# that is unqiue so that we don't run the plan on the same
# folder multiple times.
cat file2.txt | uniq > file3.txt

echo "## Unique list of changed dirs only"
cat file3.txt
echo "##"

# Set the parent dir into the Github Actions json matrix
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#fromjson
tf_config=''
while IFS= read -r file
do
echo "file = $file"
# parent_dir=$(dirname -- "$file")
# echo "parent_dir = $parent_dir"

if [[ -z $tf_config ]]; then
tf_config="{\"tf_config\":\"$file\"}"
else
tf_config="$tf_config, {\"tf_config\":\"$file\"}"
fi
done < file3.txt

tf_config="{\"include\":[$tf_config]}"
echo "::set-output name=matrix::$tf_config"

terraform:
name: "Terraform"
needs: [generate_matrix]
strategy:
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
# terraform_version: 0.13.0:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN_DEV }}

# - name: debug1
# id: debug1
# working-directory: ${{matrix.tf_config}}
# run: |
# pwd
# ls -l

- name: Terraform Format
id: fmt
working-directory: ${{matrix.tf_config}}
run: terraform fmt -check

- name: Terraform Init
id: init
working-directory: ${{matrix.tf_config}}
run: terraform init

- name: Terraform Plan
id: plan
working-directory: ${{matrix.tf_config}}
if: github.event_name == 'pull_request'
run: terraform plan -no-color
continue-on-error: true

- uses: actions/github-script@0.9.0
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`

<details><summary>Show Plan</summary>

\`\`\`\n
${process.env.PLAN}
\`\`\`\n

</details>

*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;

github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1

- name: Terraform Apply
working-directory: ${{matrix.tf_config}}
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: terraform apply -auto-approve
Loading