Skip to content

Instantly share code, notes, and snippets.

@noamsdahan
noamsdahan / passrole_actions_and_parameters.csv
Last active April 19, 2024 05:54
A list of IAM actions which require iam:PassRole as of December 2020. Nested parameters are written with dot ('.') notation. Where there are multiple relevant parameters, they are separated by the pipe character ('|'). consult the AWS documentation on special cases - noted with an asterisk (most of them are "array of documents" type parameters).…
IAM Permission Params
amplify:CreateApp iamServiceRoleArn
amplify:UpdateApp iamServiceRoleArn
appconfig:CreateConfigurationProfile RetrievalRoleArn
appconfig:UpdateConfigurationProfile RetrievalRoleArn
appflow:CreateConnectorProfile connectorProfileConfig.connectorProfileProperties.Redshift.roleArn
appflow:UpdateConnectorProfile connectorProfileConfig.connectorProfileProperties.Redshift.roleArn
application-autoscaling:RegisterScalableTarget RoleARN
apprunner:CreateService SourceConfiguration.AuthenticationConfiguration.AccessRoleArn|InstanceConfiguration.InstanceRoleArn
apprunner:UpdateService SourceConfiguration.AuthenticationConfiguration.AccessRoleArn|InstanceConfiguration.InstanceRoleArn
@siavashs
siavashs / fix-helm-status.md
Last active October 19, 2022 17:01
Fix Helm release stuck in a pending status
  1. Get the release from Kubernetes
    $ kubectl get secret sh.helm.release.v1.<release>.v<version> -o yaml > release.yaml
  2. Open the release.yaml file in an editor and copy data.release value (or use Bash skills)
  3. Extract the release payload
    $ echo <release value> | base64 -D | base64 -D | gunzip > release
  4. Open release file and change status from pending-rollback to deployed
@alsmola
alsmola / cloudtrail_partitions.js
Last active November 23, 2021 08:51
cloudtrail_partitions
'use strict';
console.log('Loading function');
const aws = require('aws-sdk');
aws.config.update({region: 'us-east-1'});
const s3 = new aws.S3({ apiVersion: '2006-03-01' });
const ddb = new aws.DynamoDB({apiVersion: '2012-10-08'});
const athena = new aws.Athena();
@antishok
antishok / NODE_ENV production.md
Last active September 25, 2020 07:09
What does `NODE_ENV=production` do?
@gene1wood
gene1wood / role_arn_to_session.py
Created December 29, 2016 17:38
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
"""
Usage :
session = role_arn_to_session(
RoleArn='arn:aws:iam::012345678901:role/example-role',
RoleSessionName='ExampleSessionName')
client = session.client('sqs')
"""
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active April 22, 2024 14:33
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@craigvantonder
craigvantonder / setup-awscli-codedeploy-agent.sh
Last active February 11, 2021 12:15
How to install AWS Code Deploy agent in Ubuntu 14.04 / 16.04 / 18.04 / 20.04
#!/bin/bash
# AWS CLI
apt-get install zip -y;
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip";
unzip awscli-bundle.zip;
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws;
aws configure;
#AWS Access Key ID [None]: Obtained when creating user in AWS IAM
@ake-persson
ake-persson / pull.sh
Last active June 2, 2021 18:19
Pull multiple docker image layers in parallel using curl
#!/bin/bash
set -eu
reg="registry.hub.docker.com"
repo="gliderlabs"
image="alpine"
name="${repo}/${image}"
tag="latest"
parallel=4
@clstokes
clstokes / assume-role-policy.json
Last active September 1, 2022 20:15
Example: Terraform IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""