Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region_alias support for multiple aliases in a single region #115

Closed
wants to merge 1 commit into from
Closed

Add region_alias support for multiple aliases in a single region #115

wants to merge 1 commit into from

Conversation

flyinbutrs
Copy link
Contributor

Multiple region_aliases can now be in the same region, and with
the prepend_region_alias_to_stack_names flag set to true, the region_alias
will be part of the stack name for easier readability.

prepend_region_alias_to_stack_names: true
region_alias:
  - production: us-east-1
stacks:
  production:
    vpc:
      template: vpc.json

The config above would create a stack named "production-vpc"

It would also resolve parameters from:

parameters/vpc.json
parameters/us-east-1/vpc.json
parameters/production/vpc.json

Multiple region_aliases can now be in the same region, and with
the prepend_region_alias_to_stack_names flag set to true, the region_alias
will be part of the stack name for easier readability.

````
prepend_region_alias_to_stack_names: true
region_alias:
  - production: us-east-1
stacks:
  production:
    vpc:
      template: vpc.json
````

The config above would create a stack named "production-vpc"

It would also resolve parameters from:

parameters/vpc.json
parameters/us-east-1/vpc.json
parameters/production/vpc.json
@@ -19,7 +21,12 @@ def template_file_path
end

def parameter_files
[ default_parameter_file_path, region_parameter_file_path ] + additional_parameter_lookup_file_paths
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I'm not entirely clear on the purpose of "additional_parameter_lookup_file_paths" vs as I did it below, explicitly resolving explicitly to the region_alias as I did below. I've preserved both, but I'm interested in the rationale behind additional_parameter_lookup_file_paths.

@stevehodgkiss
Copy link
Contributor

Will this break how we currently define region aliases (as a hash)? It would be great if we could handle both to avoid having to upgrade previously written stack_master.yml files..

@flyinbutrs
Copy link
Contributor Author

I think that was a typo in my example, but let me check. I can also rebase this now that s3 is merged in. And in the next week or so I should be able to work out the test failures.

@l-arjun-rao
Copy link

Hi @flyinbutrs and @stevehodgkiss
I chanced upon this pull-request, and this feature would really be useful to me too, as I need the ability to prefix the stack-names with prod/dev/test etc.
Just thought I'd touch base to ask if you were able to work out the test failures etc.

A big +1 from my side for this feature :-)

@et304383
Copy link

et304383 commented Feb 7, 2018

I'd honestly rather see a breaking change to just get rid of stack master using regions as keys or aliases.

I have never seen any project deal in terms of "regions" for separate stacks and I've always seen stacks separated in terms of environment (dev, staging, prod).

I highly suggest that stack master be overhauled to kill the region alias key in a major breaking release and move to using environments. Make region just an attribute of the stack so that an environment can be multi region if needed.

@patrobinson
Copy link
Contributor

I highly suggest that stack master be overhauled to kill the region alias key in a major breaking release and move to using environments. Make region just an attribute of the stack so that an environment can be multi region if needed.

I agree, but I think we need to come up with a better way of handling "environments" before that can happy. Open to opinions!

@patrobinson
Copy link
Contributor

This seems to have been super-seeded by #221

@patrobinson
Copy link
Contributor

This PR is quite stale and has been superseeded. Closing for now but re-open when/if you're ready.

@patrobinson patrobinson closed this Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants