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
##from aws_cdk import core | |
#import modlue you needed | |
import os.path as path | |
import sys | |
from aws_cdk import ( | |
core, | |
aws_ec2 as ec2, |
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
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "CrossAccountPull", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::1333333333:root" | |
}, |
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
# need awscli >= 1.16.x , docker | |
# aws ecr get-login --registry-ids < ecr-account-id > --region < region-you-want > --no-include-email | |
#way 1. | |
# Get docker registry token from A account ECR | |
[ec2-user@192-168-0-99 ~ ] aws ecr get-login --registry-ids 1333333333 --region ap-northeast-1 --no-include-email | |
#--output | |
docker login -u AWS -p eyJwYXlsb2FkIjoi....NUZCeTkydVU2b2R9 https://1333333333.dkr.ecr.us-east-1.amazonaws.com | |
# Copy output for Login A account ECR |
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
$ curl -LO https://eksworkshop.com/beginner/110_irsa/deploy.files/iam-pod.yaml | |
--- inside | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: eks-iam-test | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
exports.handler = (event, context, callback) => { | |
// Extract the request from the CloudFront event that is sent to Lambda@Edge | |
var request = event.Records[0].cf.request; | |
var newuri = '' | |
// Extract the URI from the request | |
var olduri = request.uri; | |
if (olduri == '/'){ | |
newuri = olduri+ 'index.html'; | |
}else{ |
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
version: "3.7" | |
services: | |
nexus: | |
image: "sonatype/nexus3:3.19.1" | |
container_name: "nexus" | |
restart: always | |
ports: | |
- "8081:8081" | |
- "5000:5000" | |
volumes: |
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
#!/bin/bash | |
TMPFILE=/tmp/u53tempfile | |
TMPFILE_URI="file://$TMPFILE" | |
AWS=/usr/local/bin/aws | |
function try { | |
eval $* | |
if [ $? -ne 0 ]; then | |
echo "Error while evaluating \"$*\", exiting..." |
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
#!/bin/bash | |
set pipefail | |
if [ $# != 2 ] | |
then | |
echo "Please give username and password \n ./init-super-user.sh tempuser 2wsx#EDCv ..." | |
exit 1 | |
fi | |
USER_NAME=$1 |
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
#!/bin/bash | |
instanceId=$1 | |
pubkey="$HOME/.ssh/id_rsa.pub" | |
sshUser='ec2-user' | |
az=$(aws ec2 describe-instances --instance-id ${instanceId} --query 'Reservations[0].Instances[0].Placement.AvailabilityZone' --output text) | |
echo "sending public key to ${instanceId}" | |
aws ec2-instance-connect send-ssh-public-key --instance-id ${instanceId} --instance-os-user ${sshUser} \ |
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
#!/bin/bash | |
RUNNER_TOKEN=$1 | |
# Register | |
docker run -it --rm -v /root/gitlab-runner-sit:/etc/gitlab-runner gitlab/gitlab-runner:alpine \ | |
register --non-interactive --url https://gitlab.com \ | |
--registration-token ${RUNNER_TOKEN} --docker-pull-policy if-not-present \ | |
--docker-volumes /var/run/docker.sock:/var/run/docker.sock --executor docker \ | |
--docker-volumes /root/.m2:/root/.m2 \ | |
--docker-image alpine:latest --description "Docker Runner" --docker-privileged \ |
OlderNewer