Coder Social home page Coder Social logo

cloudformation-environmentbase's People

Contributors

adimarco avatar gimballock avatar matthewkmayer avatar odandia avatar pingzhang avatar ptone avatar sesas avatar vladlosev avatar vvak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudformation-environmentbase's Issues

Issues with HaCluster in pre-VPC accounts

It appears that the Fn::GetAZs provided by Amazon returns some invalid output if it's run in an account that was created pre-VPC.

Specifically, it returns a list that includes AZs that can not create new subnets in the VPC era. This is relevant to environmentbase because Fn::GetAZs is used in generated templates when creating HaClusters (and probably other places)

Specifically, when deploying a template with an HaCluster in us-east-1 with an older account, the following snippet of generated template:

 "privateAZ1": {
            "Properties": {
                "AvailabilityZone": {
                    "Fn::Select": [
                        1,
                        {
                            "Fn::GetAZs": ""
                        }
                    ]
                },

causes Cloudformation to explode with: privateAZ1 Value (us-east-1b) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-1e, us-east-1a, us-east-1d, us-east-1c.

Note - this ONLY occurs for pre-VPC accounts, due to the invalid AZ being returned. It appears that Amazon is aware of the issue but doesn't consider it a high priority to fix. http://stackoverflow.com/questions/22744467/vpc-capable-availability-zones-in-amazon/22812138#22812138

I'm not really sure what, if anything, can be done to fix this aside from building tables of VPC-subnet-capable AZs yourself instead of using Fn::GetAZs, but I thought you guys should be aware.

Readme not up to date

I know we are working on it, but I just wanted to note down this issue before I forget and becomes untracked.

The README makes it seem like you can just pull this repo, do a pip install -e . and then run environmentbase -h to see the cmd options and even launch a VPC with 1 public subnet and 1 private, with a bastion instance etc.

But as of this version of the code, that does not happen.
On master I had this error:

IOError: [Errno 2] No such file or directory: u'ami_cache.json'

and on the feature-0.4.0 I got:

 File "/Users/gabrielreyla/dev/cloudformation-environmentbase/src/environmentbase/environmentbase.py", line 4, in <module>
    import Template
ImportError: No module named Template

Should we make `add_output()` idempotent?

just like add_parameter_idempotent I was thinking it might be a good idea to make add_output_idempotent. But maybe we should at least throw a warning when assigning a different value to the same output key.

Rethink the `validation_hash` in template

Putting the has in the template itself does not make it easy to check it with the final template. Maybe we can come up with another way of passing the validation hash into the template (i.e. as a parameter?)

Old NAT AMIs for us-east-1 don't work with t2.micro

The natAmiId for us-east-1 is ami-4f9fee26, which is a PV AMI that doesn't work with the default NAT instance type of t2.micro

I'm guessing the factory_default ami_cache.json just hasn't been rebuit in a while. I'll put in a PR with an updated ami_cache in a bit.

Get Availability Zones with boto3

This piece of code doesn't handle us-east-1 region well:

def add_vpc_az_mapping(self,
boto_config,
az_count=2):
"""
Method gets the AZs within the given account where subnets can be created/deployed
This is necessary due to some accounts having 4 subnets available within ec2 classic and only 3 within vpc
which causes the Select by index method of picking azs unpredictable for all accounts
@param boto_config [dict] collection of boto configuration values as set by the configuration file
@param az_count [int] number of AWS availability zones to include in the VPC mapping
"""
az_dict = {}
region_list = []
aws_auth_info = {}
if 'aws_access_key_id' in boto_config and 'aws_secret_access_key' in boto_config:
aws_auth_info['aws_access_key_id'] = boto_config.get('aws_access_key_id')
aws_auth_info['aws_secret_access_key'] = boto_config.get('aws_secret_access_key')
conn = boto.vpc.connect_to_region(region_name=boto_config.get('region_name', 'us-east-1'), **aws_auth_info)
for region in conn.get_all_regions():
region_list.append(region.name)
az_list = boto.vpc.connect_to_region(region.name, **aws_auth_info).get_all_zones()
if len(az_list) > 1:
temp_dict = {}
x = 0
for availability_zone in az_list:
temp_dict['az' + str(x) + 'Name'] = availability_zone.name
x += 1
if len(temp_dict) >= az_count:
az_dict[region.name] = {}
for item in temp_dict:
self.template.add_region_map_value(region.name, item, temp_dict[item])

This line in particular:
az_list = boto.vpc.connect_to_region(region.name, **aws_auth_info).get_all_zones()

Source: http://boto3.readthedocs.org/en/latest/reference/services/ec2.html#EC2.Client.describe_availability_zones

Move DefaultLogGroup & VPCFlowLogsIAMRole away from root template

DefaultLogGroup & VPCFlowLogsIAMRole are still in the root template. We should probably move both to another template.

Worth remembering that we can't turn on VPCFlowLogs from CloudFormation at this point and that it has to be done through a separate script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.