Last active
April 29, 2020 13:43
-
-
Save enderandpeter/2d7b241e3a0c6b5fbce1b880fd6b73b6 to your computer and use it in GitHub Desktop.
Udacity FSND EKS Cluster and IAM Role Creation with Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eksctl create cluster --name simple-jwt-api | |
$env:ACCOUNT_ID = aws sts get-caller-identity --query Account --output text | |
$env:TRUST = "{ \`"Version\`": \`"2012-10-17\`", \`"Statement\`": [ { \`"Effect\`": \`"Allow\`", \`"Principal\`": { \`"AWS\`": \`"arn:aws:iam::${env:ACCOUNT_ID}:root\`" }, \`"Action\`": \`"sts:AssumeRole\`" } ] }" | |
aws iam create-role --role-name UdacityFlaskDeployCBKubectlRole --assume-role-policy-document "$env:TRUST" --output text --query 'Role.Arn' | |
echo '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "eks:Describe*", "ssm:GetParameters" ], "Resource": "*" } ] }' > $env:temp\iam-role-policy | |
aws iam put-role-policy --role-name UdacityFlaskDeployCBKubectlRole --policy-name eks-describe --policy-document file://$env:temp\iam-role-policy | |
kubectl get -n kube-system configmap/aws-auth -o yaml > $env:temp\aws-auth-patch.yml | |
kubectl patch configmap/aws-auth -n kube-system --patch $(Get-Content $env:temp\aws-auth-patch.yml -Raw) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment