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 | |
REGIONS=$( aws ec2 describe-regions --region us-east-1 | jq -r '.Regions[] | select(.OptInStatus=="opt-in-not-required").RegionName' ) | |
for region in ${REGIONS[*]} | |
do | |
echo $region | |
BUCKET_NAME="test-bucket-acl-$RANDOM" | |
echo "Bucket name: $BUCKET_NAME region: $region" | |
aws s3api create-bucket --bucket "test-acl-bucket-$RANDOM" --region "$region" --acl private --create-bucket-configuration LocationConstraint="$region" |
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
apiVersion: cloudcredential.openshift.io/v1 | |
kind: CredentialsRequest | |
metadata: | |
name: managed-velero-operator-iam-credentials-aws | |
namespace: openshift-velero | |
spec: | |
secretRef: | |
name: managed-velero-operator-iam-credentials | |
namespace: openshift-velero | |
providerSpec: |
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 | |
usage() { | |
cat <<EOF | |
usage: $0 [ OPTION ] | |
Options | |
-a AWS Account ID | |
-c Cluster name | |
-o OCP Version | |
-r AWS Region |
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 | |
if [ -z "$1" ]; then | |
echo "$0 requires a prefix arg" | |
exit 1 | |
fi | |
prefix=$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 | |
for id in $(cat reset-list-03-25-20); do | |
echo "Checking account $id" | |
AWS_ASSUME_ROLE=$(aws sts assume-role --role-arn arn:aws:iam::${id}:role/OrganizationAccountAccessRole --role-session-name SREAdminCreateUserJames --profile=osd-staging-1) | |
export AWS_ACCESS_KEY_ID=$(echo $AWS_ASSUME_ROLE | jq -r '.Credentials.AccessKeyId') |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/awserr" | |
"github.com/aws/aws-sdk-go/aws/credentials" | |
"github.com/aws/aws-sdk-go/aws/session" |
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 | |
for cluster in $(ocm cluster list --managed | awk '{print $2}' | grep -v NAME) | |
do | |
ocm cluster login "$cluster%" 2> /dev/null | |
if [ $? != 0 ]; then | |
echo -e "\n\nCouldn't log into $cluster\n\n" | |
continue | |
fi | |
oc delete ns openshift-dedicated-admin |
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 | |
STS_SECRET_EXISTS=true | |
usage() { | |
cat <<EOF | |
usage: $0 [ OPTION ] | |
Options | |
-c AWS AccountClaim CR Name (AccountClaim Custom Resource Name) | |
-o Hive hostname |
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 | |
# https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/ | |
# Update status | |
# List cluster context names `kubectl config view -o jsonpath='{"Cluster name\tServer\n"}{range .clusters[*]}{.name}{"\t"}{.cluster.server}{"\n"}{end}'` | |
CLUSTER_NAME="192-168-99-100:8443" | |
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}") |