Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Pass decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str attr attr Assert NameLoad Assert CompareNotIn Str SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str BinOpAdd Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Str Call AttributeLoad NameLoad attr Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str Call AttributeLoad NameLoad attr Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str SubscriptLoad NameLoad Index Str Str Str NameLoad Str Str Call AttributeLoad Call NameLoad Str attr Call AttributeLoad Call NameLoad Str attr Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Str SubscriptLoad NameLoad Index Str Str Str Call AttributeLoad NameLoad attr NameLoad Str Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Dict Str Str Str ListLoad Call AttributeLoad NameLoad attr Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Dict Str Str Str Str Dict Str Str Str ListLoad Dict Str Str Str Str Dict Str ListLoad Str ListLoad Str ListLoad Str Str Str Str ListLoad Dict Str Str Str Dict Str Str Str ListLoad Dict Str Str Str Str ListLoad Str ListLoad Str Dict Str Str Str Dict Str Str Str ListLoad Dict Str Str Str Str ListLoad Str Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Dict Str ListLoad Dict Str Str Str Dict Str Str Str ListLoad Dict Str Str Str Str Str Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Dict Str Str Str Str Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Print Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Dict For NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad body With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad Str Str Str Str Assign NameStore ListLoad For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad NameLoad Raise Call NameLoad Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str If CompareNotIn Str NameLoad body Assign NameStore BinOpAdd Str Call NameLoad Num Expr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad With Call NameLoad Str Str NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BinOpAdd Str NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad keyword Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Import alias Import alias Return Call AttributeLoad Str attr GeneratorExp Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore AttributeLoad NameLoad attr If CompareIn Str NameLoad body Assert CompareEq SubscriptLoad NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call NameLoad
N/A N/A 
Script to generate CloudFormation JSON files via cfn-pyplates.

Usage:
python stack.py > web.json

(Usually invoked via the Makefile:
 make web.json
 or
 make web-stack
)
 N/A datetime N/A glob N/A json N/A os N/A sys N/A boto3 N/A yaml N/A tags cfn_pyplates core cfn_pyplates functions ConfigError N/A Exception N/A N/A N/A main N/A N/A N/A N/A N/A config N/A load_config N/A N/A derive_config config N/A unique_suffix N/A N/A N/A N/A N/A datetime datetime utcnow strftime %Y%m%dT%H%M N/A commit N/A N/A N/A N/A N/A N/A os popen git rev-parse HEAD read rstrip N/A commit N/A N/A ' N/A config N/A SITE_NAME N/A instance_tags N/A N/A tags load N/A N/A N/A instance_tags append N/A Key Value Name N/A refinery-web- unique_suffix N/A N/A config N/A tags instance_tags N/A config_uri N/A save_s3_config config unique_suffix N/A N/A N/A N/A sys stderr write N/A N/A Configuration saved to {}
 format config_uri N/A user_data_script N/A N/A functions join #!/bin/sh
 AWS_DEFAULT_REGION= N/A N/A functions ref AWS::Region RDS_NAME= N/A config N/A RDS_NAME RDS_SUPERUSER_PASSWORD= N/A config N/A RDS_SUPERUSER_PASSWORD RDS_ROLE= N/A config N/A RDS_ROLE ADMIN= N/A config N/A ADMIN DEFAULT_FROM_EMAIL= N/A config N/A DEFAULT_FROM_EMAIL SERVER_EMAIL= N/A config N/A SERVER_EMAIL IAM_SMTP_USER= N/A N/A functions ref RefinerySMTPUser S3_CONFIG_URI= N/A config N/A S3_CONFIG_URI SITE_URL= N/A config N/A SITE_URL SITE_NAME=' N/A config N/A SITE_NAME '
 GIT_BRANCH= commit N/A N/A N/A open bootstrap.sh read N/A N/A N/A open aws.sh read N/A cft N/A N/A core CloudFormationTemplate description refinery platform. N/A N/A N/A cft resources ec2_instance N/A N/A core Resource WebInstance AWS::EC2::Instance N/A N/A core Properties N/A AvailabilityZone ImageId InstanceType UserData KeyName IamInstanceProfile Tags N/A config N/A AVAILABILITY_ZONE ami-d05e75b8 m3.medium N/A N/A functions base64 user_data_script id_rsa N/A N/A functions ref WebInstanceProfile instance_tags N/A N/A N/A cft resources instance_profile N/A N/A core Resource WebInstanceProfile AWS::IAM::InstanceProfile N/A N/A core Properties N/A Path Roles / N/A N/A N/A functions ref WebInstanceRole N/A N/A N/A cft resources web_role N/A N/A core Resource WebInstanceRole AWS::IAM::Role N/A N/A core Properties N/A AssumeRolePolicyDocument ManagedPolicyArns Path Policies N/A Version Statement 2012-10-17 N/A N/A Effect Principal Action Allow N/A Service N/A ec2.amazonaws.com N/A sts:AssumeRole N/A arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess arn:aws:iam::aws:policy/AmazonRDSReadOnlyAccess arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess / N/A N/A PolicyName PolicyDocument CreateAccessKey N/A Version Statement 2012-10-17 N/A N/A Effect Action Resource Allow N/A iam:CreateAccessKey N/A * N/A PolicyName PolicyDocument CreateTags N/A Version Statement 2012-10-17 N/A N/A Effect Action Resource Allow N/A ec2:CreateTags * N/A N/A N/A cft resources smtp_user N/A N/A core Resource RefinerySMTPUser AWS::IAM::User N/A N/A core Properties N/A Policies N/A N/A PolicyName PolicyDocument SESSendingAccess N/A Version Statement 2012-10-17 N/A N/A Effect Action Resource Allow ses:SendRawEmail * N/A N/A N/A cft resources mount N/A N/A core Resource RefineryVolume AWS::EC2::VolumeAttachment N/A N/A core Properties N/A Device InstanceId VolumeId /dev/xvdr N/A N/A functions ref WebInstance N/A config N/A VOLUME N/A N/A str cft N/A load_config N/A N/A N/A N/A N/A 
    Configuration is loaded from the aws-config/ directory.
    All the YAML files are loaded in ASCIIbetical order.
     N/A config_dir aws-config N/A pattern N/A N/A N/A os path join config_dir *.yaml N/A config N/A N/A config_filename N/A sorted N/A N/A glob glob pattern N/A N/A N/A open config_filename f N/A N/A y N/A N/A yaml load f N/A y N/A N/A N/A N/A config update y N/A required N/A SITE_NAME SITE_URL VOLUME ADMIN_PASSWORD N/A bad N/A N/A key required N/A N/A N/A key config N/A N/A N/A N/A bad append key N/A bad N/A N/A N/A N/A N/A sys stderr write N/A N/A {:s} must have values for:
{!r}
 format config_dir bad N/A N/A ConfigError N/A N/A N/A config setdefault RDS_SUPERUSER_PASSWORD mypassword N/A N/A N/A config setdefault RDS_NAME rds-refinery N/A config N/A save_s3_config N/A N/A config suffix N/A N/A N/A 
    Save the config as an S3 object in an S3 bucket.
    If the config has an 'S3_CONFIG_BUCKET' key,
    then that is used for the name of the S3 bucket;
    otherwise an S3 bucket is created,
    and its name is written to a config file in `aws-config` ,
    so that it will be re-used next time.

    A URI in the form s3://bucket/key is returned;
    this URI refers to the S3 object that is created.
     N/A s3 N/A N/A boto3 resource s3 N/A N/A S3_CONFIG_BUCKET config N/A N/A bucket_name N/A refinery- N/A random_alnum 13 N/A N/A N/A s3 create_bucket Bucket bucket_name N/A s3_config N/A dict S3_CONFIG_BUCKET bucket_name N/A N/A open aws-config/20generated-s3-config.yaml w o N/A N/A N/A N/A o write # Automatically generated by stack.py
 N/A N/A N/A yaml dump s3_config stream o N/A N/A N/A config update s3_config N/A bucket_name N/A config N/A S3_CONFIG_BUCKET N/A object_name N/A refinery-config- suffix N/A s3_uri N/A N/A s3://{}/{} format bucket_name object_name N/A N/A config N/A S3_CONFIG_URI s3_uri N/A s3_object N/A N/A s3 Object bucket_name object_name N/A N/A N/A s3_object put Body N/A N/A json dumps config indent 2 N/A s3_uri N/A random_alnum N/A N/A n N/A N/A N/A 
    Random alphanumeric (digits and lowercase) string
    of length `n`.
     N/A random N/A string N/A N/A N/A join N/A N/A N/A random choice N/A N/A string ascii_lowercase N/A string digits N/A _ N/A range n N/A derive_config N/A N/A config N/A N/A N/A 
    Modify `config` so that extra, derived, configuration is
    added to it.

    The only case at the moment is that the availability zone of
    the VOLUME is added so that the instance can share the same
    availability zone.
     N/A ec2 N/A N/A boto3 resource ec2 N/A volume N/A N/A ec2 Volume N/A config N/A VOLUME N/A az N/A volume availability_zone N/A N/A AVAILABILITY_ZONE config N/A N/A N/A N/A config N/A AVAILABILITY_ZONE az N/A N/A config N/A AVAILABILITY_ZONE az N/A N/A N/A __name__ __main__ N/A N/A N/A N/A sys exit N/A main