Skip to content

Instantly share code, notes, and snippets.

import random
def draw(deck):
take_idx = random.randint(0, len(deck)-1)
card = deck.pop(take_idx)
return card, deck
def fresh_deck():
Nov 17 18:09:56 ip-172-31-118-208 e9c708126bf6/40316ef/prod/mcp_v2/render-prepare.worker: 2018-11-18 02:09:56,179 - kailan.rendering.vrcomps - INFO - 8 - Baking Prop 64000
Nov 17 18:09:59 ip-172-31-118-208 e9c708126bf6/40316ef/prod/mcp_v2/render-prepare.worker: 2018-11-18 02:09:59,912 - kailan.rendering.vrcomps - INFO - 8 - Baking Prop 12865
Nov 17 18:10:03 ip-172-31-118-208 e9c708126bf6/40316ef/prod/mcp_v2/render-prepare.worker: 2018-11-18 02:10:03,662 - kailan.rendering.vrcomps - INFO - 8 - Baking Prop 49034
Nov 17 18:10:14 ip-172-31-118-208 e9c708126bf6/40316ef/prod/mcp_v2/render-prepare.worker: 2018-11-18 02:10:14,039 - kailan.rendering.vrcomps - INFO - 8 - Baking Prop 49038
from troposphere import NoValue, Tags, Sub
from troposphere import (
ec2,
elasticsearch,
iam,
)
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import TroposphereType
from awacs.helpers.trust import get_ecs_task_assumerole_policy
from troposphere import (
ecs,
iam,
)
from troposphere import (
NoValue,
Output,
from awacs.helpers.trust import get_ecs_task_assumerole_policy
from troposphere import (
ecs,
iam,
)
from troposphere import (
NoValue,
Output,
from awacs.aws import Policy
from awacs.helpers.trust import (
make_service_domain_name,
make_simple_assume_policy,
)
from troposphere import (
codebuild,
ecr,
iam,
@phobologic
phobologic / bucket.py
Created June 26, 2018 16:49
s3 encryption with troposphere
import os
from troposphere import Template, NoValue
from troposphere import s3
key_id = os.getenv("BUCKET_ENCRYPTION_KEY_ID")
bucket_encryption = NoValue
{
"Type" : "AWS::ApplicationAutoScaling::ScalingPolicy",
"Properties" : {
"PolicyName" : "MyScalingPolicy",
"PolicyType" : "TargetTrackingScaling",
"ResourceId" : "arn:aws:dynamodb:us-east-1:123456789012:table/books_table",
"ScalableDimension" : "dynamodb:table:WriteCapacityUnits",
"ServiceNamespace" : "dynamodb",
"TargetTrackingScalingPolicyConfiguration" : {
"PredefinedMetricSpecification": {
{
"Resources": {
"AllowSSHFromGroup1ToGroup2": {
"Properties": {
"FromPort": 22,
"GroupId": {
"Ref": "SecurityGroup2"
},
"IpProtocol": "tcp",
"SourceSecurityGroupId": {
from troposphere import Template
from troposphere.ec2 import (
SecurityGroup,
SecurityGroupIngress,
)
t = Template()
sg1 = t.add_resource(