Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure #76

Closed
wants to merge 92 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
997580b
adds the trust policy, the role, a readme to include some comments ab…
carlosvalarezo Aug 17, 2023
706fbd6
removes github directory from the gitignore file in order to use gith…
carlosvalarezo Aug 17, 2023
4869c36
creates the cv-eks-cluster-role role using githubactions to avoid doi…
carlosvalarezo Aug 17, 2023
1c19650
removes action not found
carlosvalarezo Aug 17, 2023
73a5482
removes action not found
carlosvalarezo Aug 17, 2023
8ddc0d1
adds aws-default-region since This is a problem with awscli trying to…
carlosvalarezo Aug 17, 2023
96b2c13
adds aws configure command rather than aws iam create-role directly
carlosvalarezo Aug 17, 2023
f7a4308
uses env to get the secrets and use them in aws configure
carlosvalarezo Aug 18, 2023
aae39af
uses echo to check values
carlosvalarezo Aug 18, 2023
bbc0f8c
uses DEVELOP as part of the env variable in order to retrieve the sec…
carlosvalarezo Aug 18, 2023
20ef118
removes unnecesary echo
carlosvalarezo Aug 18, 2023
38887d5
uses env to validate the secrets available
carlosvalarezo Aug 18, 2023
5cdc4b3
uses env to validate the secrets available
carlosvalarezo Aug 18, 2023
8088326
adds enviroment o define the environment
carlosvalarezo Aug 18, 2023
faed0ad
uses env variables to pass secrets to ther aws configure command
carlosvalarezo Aug 18, 2023
b0f29b4
checks if the credentials file was created
carlosvalarezo Aug 18, 2023
9e1e8b5
checks if the credentials file was created
carlosvalarezo Aug 18, 2023
18202a8
checks if the credentials file was created
carlosvalarezo Aug 18, 2023
a09fa5b
adds region to the command and validates the creds to execute commands
carlosvalarezo Aug 18, 2023
86cc2a0
adds region to the command and validates the creds to execute commands
carlosvalarezo Aug 18, 2023
22535ee
adds region to the command and validates the creds to execute commands
carlosvalarezo Aug 18, 2023
ffab863
adds region to the command and validates the creds to execute commands
carlosvalarezo Aug 18, 2023
f9a9d0f
adds region to the command and validates the creds to execute commands
carlosvalarezo Aug 18, 2023
b50e1ec
sets the env vars for all the steps
carlosvalarezo Aug 18, 2023
d3f9e9d
updates the name of the job and adds the step to attach the policy to…
carlosvalarezo Aug 21, 2023
cc419cd
updates the ubuntu runner and installs jq to extract values later
carlosvalarezo Aug 21, 2023
8b00ebb
moves to env vars cluster role and policy name and use them in the re…
carlosvalarezo Aug 21, 2023
06408da
removes unnecesary install of jq and updates the name of the env vars
carlosvalarezo Aug 21, 2023
2ea1787
adds the steps to create the role and to attach the policy for the no…
carlosvalarezo Aug 21, 2023
5faa55f
configures the yaml file to create the k8s eks cluster via eksctl
carlosvalarezo Aug 21, 2023
3a0feba
setup the runner installing eksctl
carlosvalarezo Aug 21, 2023
ad3f00f
setup the runner installing eksctl
carlosvalarezo Aug 21, 2023
2fe543c
setup the runner installing eksctl
carlosvalarezo Aug 21, 2023
98946d6
updates the path of the script file
carlosvalarezo Aug 21, 2023
f899779
updates the path of the script file
carlosvalarezo Aug 21, 2023
9ea53fc
updates the path of the script file
carlosvalarezo Aug 21, 2023
c30549e
creates the cluster
carlosvalarezo Aug 21, 2023
45414eb
uses the correct file to create the cluster using eksctl
carlosvalarezo Aug 21, 2023
ac8f9fe
create the ssh key files getting the values from the secrets repo
carlosvalarezo Aug 21, 2023
72490f4
creates the .ssh directory
carlosvalarezo Aug 21, 2023
d51df7f
adds new comments and separates the setup of the roles and policies f…
carlosvalarezo Aug 21, 2023
e7f5dff
moves to infrastructure branch and updates the workflow
carlosvalarezo Aug 21, 2023
2ed9284
removes unnecesary code from original repo and updates the deployemnt…
carlosvalarezo Aug 22, 2023
ec9d679
adds eksctl-install.sh file
carlosvalarezo Aug 22, 2023
6d43045
adds missing step to checkout code in the infra pipeline
carlosvalarezo Aug 22, 2023
ce56861
encrypts kubeconfig file to use in the develop workflow and have acce…
carlosvalarezo Aug 23, 2023
7b602ea
encrypts kubeconfig file to use in the develop workflow and have acce…
carlosvalarezo Aug 23, 2023
ad53ed0
uses curly brackets for all the env vars and shows the current env vars
carlosvalarezo Aug 23, 2023
af53e47
encodes the encrypted value to sort out the problem of gpg is multili…
carlosvalarezo Aug 23, 2023
f2c7da8
updates the command to include GPG_PRIVATE_KEY as value to import the…
carlosvalarezo Aug 23, 2023
cb440a2
updates the command to include GPG_PRIVATE_KEY as value to import the…
carlosvalarezo Aug 23, 2023
5a4dc5d
updates the command to decode the GPG_PRIVATE_KEY
carlosvalarezo Aug 23, 2023
6528e01
uses the GPG_PUBLIC KEY and encrypts the file to be decrypted by the …
carlosvalarezo Aug 23, 2023
e7d9f1e
removes the skip one step
carlosvalarezo Aug 23, 2023
46ca5da
removes the skip one step
carlosvalarezo Aug 23, 2023
8e3d791
removes the skip one step
carlosvalarezo Aug 23, 2023
2e45b08
skips a couple of steps
carlosvalarezo Aug 23, 2023
6ebff87
skips a couple of steps
carlosvalarezo Aug 23, 2023
4a3e7a5
skips a couple of steps
carlosvalarezo Aug 23, 2023
a50bfd8
disables interactive tty
carlosvalarezo Aug 23, 2023
51bc5b7
disables interactive tty
carlosvalarezo Aug 23, 2023
de58aa2
disables interactive tty
carlosvalarezo Aug 23, 2023
89fa539
disables interactive tty
carlosvalarezo Aug 23, 2023
85a4274
disables interactive tty
carlosvalarezo Aug 23, 2023
53cbc78
disables interactive tty
carlosvalarezo Aug 23, 2023
dba4277
disables interactive tty
carlosvalarezo Aug 23, 2023
ecd2963
disables interactive tty
carlosvalarezo Aug 23, 2023
e13eaba
tries another gpg command to encrypt with symmetric option
carlosvalarezo Aug 23, 2023
f6d6e91
tries openssl alternative rather than gpg
carlosvalarezo Aug 23, 2023
c4306fe
uses passphrase for openssl
carlosvalarezo Aug 23, 2023
5b9f7c7
uses passphrase for openssl
carlosvalarezo Aug 23, 2023
9d89950
uses passphrase for openssl
carlosvalarezo Aug 23, 2023
0d13e10
uses passphrase to encrypt the file using openssl
carlosvalarezo Aug 23, 2023
3724de9
updates the workflow and enables the skipped steps
carlosvalarezo Aug 23, 2023
860a6cd
updates the workflow and enables the skipped steps
carlosvalarezo Aug 23, 2023
6b8a59f
creates the role, policy and trust-policy for codepipeline and codebu…
carlosvalarezo Aug 25, 2023
2e5b162
corrects some typos in the name of the files
carlosvalarezo Aug 25, 2023
4d02585
tries gpg to encrypt the files using these strategies: import the tru…
carlosvalarezo Aug 28, 2023
f7c493b
tries gpg to encrypt the files using these strategies: import the tru…
carlosvalarezo Aug 28, 2023
e3a2763
splits the trust-owners import command in two steps
carlosvalarezo Aug 28, 2023
b4fa74e
uses base64 in order to avoid errors like: missing semicolon and othe…
carlosvalarezo Aug 28, 2023
caacce3
uses file rather than env variable for gpg trust owners
carlosvalarezo Aug 28, 2023
f9a954c
show the content of trust-file
carlosvalarezo Aug 28, 2023
2f31b04
includes the missing env var
carlosvalarezo Aug 28, 2023
8450391
alters the order to formerly import the keys and lately import the tr…
carlosvalarezo Aug 28, 2023
5446c30
alters the order to formerly import the trust owners and lately the keys
carlosvalarezo Aug 28, 2023
3b4cb21
removes the armos and sign flags from gpg command
carlosvalarezo Aug 28, 2023
427d085
lists the files to check if the file got encrypted
carlosvalarezo Aug 28, 2023
632cefc
updates the path of the encrypted file and show the directory where i…
carlosvalarezo Aug 28, 2023
d99f10e
removes the openssl command and uses gpg to encrypt the file
carlosvalarezo Aug 28, 2023
2aa81e6
removes unnecesary code
carlosvalarezo Aug 28, 2023
1c4ea99
creates fake kubeconfig file to test the encryption without creation …
carlosvalarezo Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/scripts/eksctl-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

ARCH=amd64
PLATFORM=$(uname -s)_$ARCH

curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"

# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check

tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz

sudo mv /tmp/eksctl /usr/local/bin
3 changes: 3 additions & 0 deletions .github/scripts/gpg-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

sudo apt-get install gnupg
128 changes: 128 additions & 0 deletions .github/workflows/cv-infrastructure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Create AWS infrastructure
on:
push:
branches:
- infrastructure
jobs:
setup_roles_and_policies:
if: false
runs-on: ubuntu-latest
environment:
name: develop
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLUSTER_ROLE_NAME: cv-eks-cluster-role
CLUSTER_POLICY_NAME: cv-eks-cluster-policy
NODEGROUP_ROLE_NAME: cv-eks-nodegroup-role
NODEGROUP_POLICY_NAME: cv-eks-nodegroup-policy
CODEPIPELINE_ROLE_NAME: cv-codepipeline-role
CODEPIPELINE_POLICY_NAME: cv-codepipeline-policy
CODEBUILD_ROLE_NAME: cv-codebuild-role
CODEBUILD_POLICY_NAME: cv-codebuild-policy
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Setup AWS credentials
run: |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID}
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY}
aws configure set default.region us-west-1

- name: Creates the role that will assume the trust policy to deal with the cluster
run: aws iam create-role --role-name ${CLUSTER_ROLE_NAME} --assume-role-policy-document file://${GITHUB_WORKSPACE}/eksk8s/eks-cluster-trust-policy.json

- name: Attaches the policy to the cluster role
run: aws iam put-role-policy --role-name ${CLUSTER_ROLE_NAME} --policy-name ${CLUSTER_POLICY_NAME} --policy-document file://${GITHUB_WORKSPACE}/eksk8s/eks-cluster-policy.json

- name: Creates the role that will assume the trust policy to deal with the node-group
run: aws iam create-role --role-name ${NODEGROUP_ROLE_NAME} --assume-role-policy-document file://${GITHUB_WORKSPACE}/eksk8s/eks-nodegroup-trust-policy.json

- name: Attaches the policy for the node-group role
run: aws iam put-role-policy --role-name ${NODEGROUP_ROLE_NAME} --policy-name ${NODEGROUP_POLICY_NAME} --policy-document file://${GITHUB_WORKSPACE}/eksk8s/eks-nodegroup-policy.json

- name: Create the role that will assume the trust policy to deal with the codepipeline service
run: aws iam create-role --role-name ${CODEPIPELINE_ROLE_NAME} --assume-role-policy-document file://${GITHUB_WORKSPACE}/eksk8s/codepipeline-trust-policy.json

- name: Attaches the policy for the codepipeline role
run: aws iam put-role-policy --role-name ${CODEPIPELINE_ROLE_NAME} --policy-name ${CODEPIPELINE_POLICY_NAME} --policy-document file://${GITHUB_WORKSPACE}/eksk8s/codepipeline-policy.json

- name: Create the role that will assume the trust policy to deal with the codebuild service
run: aws iam create-role --role-name ${CODEBUILD_ROLE_NAME} --assume-role-policy-document file://${GITHUB_WORKSPACE}/eksk8s/codebuild-trust-policy.json

- name: Attaches the policy for the codebuild role
run: aws iam put-role-policy --role-name ${CODEBUILD_ROLE_NAME} --policy-name ${CODEBUILD_POLICY_NAME} --policy-document file://${GITHUB_WORKSPACE}/eksk8s/codebuild-policy.json

create_the_cluster:
runs-on: ubuntu-latest
# needs: setup_roles_and_policies
environment:
name: develop
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_TRUST_OWNERS: ${{ secrets.GPG_TRUST_OWNERS }}
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Setup the runner
run: |
sh ${GITHUB_WORKSPACE}/.github/scripts/eksctl-install.sh
sh ${GITHUB_WORKSPACE}/.github/scripts/gpg-install.sh

- name: Setup the keys used to create the k8s cluster
if: false
run: |
mkdir ${HOME}/.ssh/
echo ${SSH_PRIVATE_KEY} > ${HOME}/.ssh/k8s
echo ${SSH_PUBLIC_KEY} > ${HOME}/.ssh/k8s.pub

- name: Creates the k8s cluster using eksctl
if: false
run: eksctl create cluster -f ${GITHUB_WORKSPACE}/eksk8s/cluster-config.yaml

- name: Import the gpg components
run: |
echo ${GPG_TRUST_OWNERS} | base64 --decode > trust-file
gpg --import-ownertrust < trust-file
echo ${GPG_PUBLIC_KEY} | base64 --decode | gpg --import
echo ${GPG_PRIVATE_KEY} | base64 --decode | gpg --import --batch

- name: Creates fake kubeconfig file
run: |
mkdir ${HOME}/.kube/
cat << EOF > ${HOME}/.kube/config
Line1
EOF

- name: Encrypts the kubeconfig file
run: gpg --encrypt -r [email protected] --output kube_config.gpg ${HOME}/.kube/config

- name: Pushes kubeconfig artifact
uses: actions/[email protected]
with:
name: kube_config.gpg
path: kube_config.gpg

manages_aws_secrets:
runs-on: ubuntu-latest
needs: create_the_cluster
if: false
environment:
name: develop
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CODEPIPELINE_ROLE_NAME: cv-codepipeline-role
CODEPIPELINE_POLICY_NAME: cv-codepipeline-policy
steps:
- name: Stores the GH_TOKEN in AWS Systems Manager Parameter Store
run: aws ssm put-parameter --name "MySecureStringParameter" --value "MySuperSecretValue" --type "SecureString" --key-id "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012"
19 changes: 0 additions & 19 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,3 @@ jobs:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create NEW JIRA ticket
id: create
uses: atlassian/gajira-create@master
with:
project: CONUPDATE
issuetype: Task
summary: |
Github PR - nd0044 - Full Stack Nanodegree C4 | Repo: ${{ github.repository }} | PR# ${{github.event.number}}
description: |
Repo link: https://github.com/${{ github.repository }}
PR no. ${{ github.event.pull_request.number }}
PR title: ${{ github.event.pull_request.title }}
PR description: ${{ github.event.pull_request.description }}
In addition, please resolve other issues, if any.
fields: '{"components": [{"name":"nd0044 - Full Stack Nanodegree"}], "customfield_16449":"https://classroom.udacity.com/nanodegrees/nd0044/dashboard/overview", "customfield_16450":"Resolve the PR", "labels": ["github"], "priority":{"id": "4"}}'

- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
41 changes: 41 additions & 0 deletions .github/workflows/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate KMS (Key Management System) and store the ARN

on:
push:
branches:
- secrets

jobs:
generate_kms_key:
runs-on: ubuntu-latest
environment:
name: develop
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLUSTER_ROLE_NAME: cv-eks-cluster-role
CLUSTER_POLICY_NAME: cv-eks-cluster-policy
NODEGROUP_ROLE_NAME: cv-eks-nodegroup-role
NODEGROUP_POLICY_NAME: cv-eks-nodegroup-policy
CODEPIPELINE_ROLE_NAME: cv-codepipeline-role
CODEPIPELINE_POLICY_NAME: cv-codepipeline-policy
CODEBUILD_ROLE_NAME: cv-codebuild-role
CODEBUILD_POLICY_NAME: cv-codebuild-policy
KVM_KEY_ARN: ""
steps:
- name: Configurar AWS CLI
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Generate KMS key and save the KVM key in GH secrets
run: |
KVM_KEY_ID=$(aws kms create-key --query KeyMetadata.KeyId --output text)
echo ${KVM_KEY_ID}
KVM_KEY_ARN=$(aws kms describe-key --key-id $KVM_KEY_ID --query KeyMetadata.Arn --output text)
echo ${KVM_KEY_ARN} >> secrets.KVM_KEY_ARN

- name: Shows the ARN just created
run: echo $KVM_KEY_ARN
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ htmlcov/
.envrc
.direnv

.github/**
29 changes: 29 additions & 0 deletions eksk8s/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
With regard to the file eks-cluster-policy.json:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"eks:CreateCluster",
"eks:DescribeCluster",
"eks:UpdateClusterConfig",
"eks:UpdateClusterVersion",
"ssm:GetParameters"
],
"Resource": "*" // * means that the already defined actions could be applied to any EKS cluster in the account
}
]
}

In the file eksk8s/cluster-config.yaml the key nodeGroups.iam.instanceRoleARN has the value=arn:aws:iam::62132xxxx821:role/cv-eks-nodegroup-role. In a real project this file should be created using jinja/cookicutter in a previous step. This file should never have hard-coded values. However, for educational purposes/save time these values are hardcoded in the file.

This key pair was created in aws console. It is possible to do it using the command to create it. This step involves pushing (uploading) the keys to aws via aws cli or somehow.

The subnets were also created by hand in the aws console.

The command `eksctl create cluster -f <file_name>` creates the file `$HOME/.kube/config` This file is the one that has the context to connect to the remote cluster. Then to store this file securely, the file should be encrypted and published in the artifacts list of the github repo. Then, in a linux terminal generate the gpg key with the command `gpg --full-generate-key`. For educational purposes I have not included a passphrase nor expiration date for this gpg key set. After, get the ID of the just created `gpg` with the command: `gpg --list-keys` Then, using the commands: `gpg --export -a KEY_ID | base64 -w 0 > public.asc` and `gpg --export-secret-keys -a KEY_ID | base64 -w 0 > private.asc` export the gpg keys that will be stored as secrets in GitHub actions. After, in the workflow import the gpg key to encrypt the file and then upload as artifact to GitHub actions repo.

#### Note:
For reference on how to deal with base64 and gpg keys use this link: https://dev.to/epam_india_python/how-we-set-up-gpg-keys-as-environment-variables-2f26
31 changes: 31 additions & 0 deletions eksk8s/cluster-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: cv-eks-cluster
region: us-west-1

vpc:
id: vpc-04e8935eb17607398
subnets:
public:
us-west-1a:
id: subnet-08375f54b10ac81a2
us-west-1b:
id: subnet-0a8eea0bb2b8bd056
clusterEndpoints:
publicAccess: true
securityGroup: sg-074fc7db95c8a8141

nodeGroups:
- name: cv-eks-nodegroup
iam:
instanceRoleARN: arn:aws:iam::621328949821:role/cv-eks-nodegroup-role
instanceType: t2.micro
desiredCapacity: 2
ssh:
allow: true
publicKeyPath: ~/.ssh/k8s.pub
subnets:
- subnet-08375f54b10ac81a2
- subnet-0a8eea0bb2b8bd056
18 changes: 18 additions & 0 deletions eksk8s/codebuild-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codebuild:StartBuild",
"eks:Describe*",
"ssm:GetParameters",
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}

13 changes: 13 additions & 0 deletions eksk8s/codebuild-trust-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "codebuild.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}

15 changes: 15 additions & 0 deletions eksk8s/codepipeline-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codebuild:StartBuild",
"codebuild:BatchGetBuilds",
"cloudformation:CreateStack"
],
"Resource": "*"
}
]
}

13 changes: 13 additions & 0 deletions eksk8s/codepipeline-trust-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "codepipeline.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}

17 changes: 17 additions & 0 deletions eksk8s/eks-cluster-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"eks:CreateCluster",
"eks:DescribeCluster",
"eks:UpdateClusterConfig",
"eks:UpdateClusterVersion",
"ssm:GetParameters"
],
"Resource": "*"
}
]
}

13 changes: 13 additions & 0 deletions eksk8s/eks-cluster-trust-policy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "eks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}

Loading