builders.py

The builders.py file uses YAML config to build the environment.

class botoform.builders.EnvironmentBuilder(vpc_name, config=None, region_name=None, profile_name=None, log=None)
add_eip_to_instance(instance)
apply_all()

Build the environment specified in the config.

associate_route_tables_with_subnets(subnet_cfg)
attach_vpn_gateway(vpn_gateway_cfg)

Attach defined VPN gateway to VPC

autoscaling_instance_role(role_name, role_data, desired_count)
autoscaling_instance_roles(instance_role_cfg)

Create Autoscaling Groups and Launch Configurations.

build_internet_gateway()

Build and attach Internet Gateway to VPC.

build_vpc(cidrblock='172.31.0.0/16', tenancy='default')

Build VPC

create_dhcp_options(dhcp_configurations)

Creates and return a new dhcp_options set.

create_instance_profile(instance_profile_name)

Create instance_profile and role, return instance_profile.

db_instances(db_instance_cfg)

Build RDS DB Instances.

dhcp_options(dhcp_options_cfg)

Creates DHCP Options Set and associates with VPC

endpoints(route_tables)

Build VPC endpoints for given route_tables

finish_instance_roles(instance_role_cfg, instances=None)
get_instance_profile(instance_profile_name)

Return instance_profile or None.

instance_profiles(instance_role_cfg)
instance_role(role_name, role_data, desired_count)
instance_roles(instance_role_cfg)

Create instance roles defined in config.

key_pairs(key_pair_cfg)
load_balancers(load_balancer_cfg)

Build ELB load balancers.

route_table_rules(route_cfg)

Build route table rules defined in config

route_tables(route_cfg)

Build route_tables defined in config

security_group_inbound_rules(security_group_cfg)

Build inbound rule for Security Group defined in config.

security_group_outbound_revoke_default_rule(sg)
security_group_outbound_rules(security_group_cfg)

Build outbound rule for Security Group defined in config.

security_group_rule_to_permission(rule)

Return a permission dictionary from a rule tuple.

security_group_rules(security_group_cfg)

Build Security Group Rules defined in config.

security_group_rules_to_permissions(sg_name, rules, direction='inbound')
security_groups(security_group_cfg)

Build Security Groups defined in config.

subnets(subnet_cfg)

Build subnets defined in config.

tag_instance_name(*args, **kw)

Accept a EnrichedInstance, objects create tags.

tag_instance_volumes(instance)

Accept an EnrichedInstance, tag all attached volumes.

tags(tag_cfg)
wait_for_instance_profile(*args, **kw)
wait_for_instance_roles_to_exist(*args, **kw)