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 | |
# parameters | |
STACK=$(jq -r .stack parameters.json) | |
REGION=$(jq -r .region parameters.json) | |
TEMPLATE=file://${STACK}.yml | |
echo "Creating $STACK Stack" | |
aws cloudformation create-stack --stack-name $STACK \ |
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 | |
STACK=$(jq -r .stack parameters.json) | |
REGION=$(jq -r .region parameters.json) | |
echo "Deleting $STACK Stack" | |
aws cloudformation delete-stack --stack-name $STACK | |
aws cloudformation wait stack-delete-complete --stack-name $STACK --region $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 | |
# Import parameters | |
STACK=$(jq -r .stack parameters.json) | |
REGION=$(jq -r .region parameters.json) | |
TEMPLATE=file://${STACK}.yml | |
echo "Updating $STACK Stack" | |
aws cloudformation update-stack --stack-name $STACK \ | |
--template-body $TEMPLATE \ |
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
Parameters: | |
BranchName: | |
Description: GitHub branch name | |
Type: String | |
Default: master | |
RepositoryName: | |
Description: GitHub repository name | |
Type: String | |
Default: test | |
GitHubOwner: |
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
[A-Za-z0-9.@\-_]+ |
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
#!/usr/bin/env bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
CFN_FILE=file://$(pwd)/github_service_account.yaml | |
STACK='github-service-account' | |
REGION='us-east-1' | |
if ! (aws cloudformation describe-stacks --region ${REGION} --stack-name ${STACK}) ; then |
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
# Get all IAM actions for Tagging using policy_sentry database. | |
# Not perfect query because it will include actions that contain 'tAg' --> 'artifact:AcceptAgreement' | |
policy_sentry query action-table --service all | for i in $(cat); do policy_sentry query action-table --service $i; done | grep -i tag > all-aws-tag-actions.txt |
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": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"cloudformation:ListExports", | |
"sts:DecodeAuthorizationMessage" | |
], |
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": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "ec2:RunInstances", | |
"Resource": "arn:aws:ec2:*:*:instance/*", | |
"Condition": { | |
"StringEqualsIgnoreCase": { |
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": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": "ec2:RunInstances", | |
"Resource": "arn:aws:ec2:*:*:instance/*", | |
"Condition": { | |
"StringEqualsIgnoreCase": { |
OlderNewer