$ aws ec2 describe-volumes \
--query 'Volumes[*].{ID:VolumeId,InstanceId:Attachments[0].InstanceId,AZ:AvailabilityZone,Size:Size}'
[
{
"InstanceId": "i-a071c394",
This file contains hidden or 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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: My API Gateway and Lambda function | |
Parameters: | |
apiGatewayName: | |
Type: String | |
Default: my-api | |
apiGatewayStageName: | |
Type: String | |
AllowedPattern: "[a-z0-9]+" |
This file contains hidden or 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
aws_networkfirewall_rule_group.deny-http: Creating... | |
2020/11/27 21:19:37 [DEBUG] EvalApply: ProviderMeta config value set | |
2020/11/27 21:19:37 [DEBUG] aws_networkfirewall_rule_group.deny-http: applying the planned Create change | |
2020-11-27T21:19:37.025+0100 [DEBUG] plugin.terraform-provider-aws_v3.18.0_x5: 2020/11/27 21:19:37 [DEBUG] Creating NetworkFirewall Rule Group deny-http | |
2020-11-27T21:19:37.025+0100 [DEBUG] plugin.terraform-provider-aws_v3.18.0_x5: 2020/11/27 21:19:37 [DEBUG] [aws-sdk-go] DEBUG: Validate Request Network Firewall/CreateRuleGroup failed, not retrying, error InvalidParameter: 5 validation error(s) found. | |
2020-11-27T21:19:37.025+0100 [DEBUG] plugin.terraform-provider-aws_v3.18.0_x5: - missing required field, CreateRuleGroupInput.RuleGroup.RulesSource.StatefulRules[0].Header.Destination. | |
2020-11-27T21:19:37.025+0100 [DEBUG] plugin.terraform-provider-aws_v3.18.0_x5: - missing required field, CreateRuleGroupInput.RuleGroup.RulesSource.StatefulRules[0].Header.DestinationPort. | |
2020-11-27T21:19: |
This file contains hidden or 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
.ONESHELL: | |
.SILENT: | |
main: \ | |
python \ | |
ruby \ | |
R \ | |
bash \ | |
docker |
This file contains hidden or 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
function protect_nested_stacks() { | |
local parent_stack=$1 stack_policy_file=$2 | |
local nested_stacks=$(aws cloudformation list-stack-resources \ | |
--stack-name ${parent_stack} \ | |
--query "StackResourceSummaries[?ResourceType=='AWS::CloudFormation::Stack'].[PhysicalResourceId]" \ | |
--output text | |
) | |
for stack in ${nested_stacks}; do | |
aws cloudformation set-stack-policy --stack-name ${stack} --stack-policy-body file://${stack_policy_file} |
This file contains hidden or 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" | |
type Boss struct{} | |
func (b *Boss) AssignWork() { | |
fmt.Println("Boss assigned work") | |
} |
This file contains hidden or 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
mkdir helloworld | |
cd !$ | |
go get github.com/aws/aws-lambda-go/lambda | |
GOOS=linux go build -o helloworld | |
aws iam create-role --role-name lambda-basic-execution | |
--assume-role-policy-document file://lambda-trust-policy.json | |
This file contains hidden or 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 ( | |
"flag" | |
"github.com/spf13/cobra" | |
"github.com/spf13/pflag" | |
"k8s.io/klog" | |
) |
This file contains hidden or 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
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
This file contains hidden or 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
# The server clause sets the main parameters. | |
server: | |
# Allow network connections outside of localhost | |
interface: 0.0.0.0 | |
# Don't automatically run in the background because I want to be able to kill it without hunting a pid | |
do-daemonize: no | |
# TODO: Change this to your network range, like `192.168.0.0/16 allow` | |
access-control: 10.0.0.0/16 allow | |
# TODO: Change this to your username, or whatever user you want to run/own the `unbound` process | |
username: "bryanjswift" |