stacker icon indicating copy to clipboard operation
stacker copied to clipboard

Bug: stack names should not be lowercased

Open brettswift opened this issue 6 years ago • 0 comments

This sounds a bit nit picky but we ran into this today when trying to deploy a stack. The problem is that we are deploying to an account where we're forced to use a cloudformation service role.

https://stacker.readthedocs.io/en/latest/config.html?highlight=service_role#service-role

The service role forces us to use certain resource prefixes, and unfortunately we currently have a policy that restricts stack names using camel case of StcEcs for our project team.

This is our setup (snippets of..)

conf.env

namespace: StcEcs

stacker.yaml

stacks:
  - name: teamcityAgentWindows

Actual Log Output

[2018-07-10T14:04:38] Using interactive AWS provider mode.
[2018-07-10T14:04:38] Tailing stack: stcecs-teamcityAgentWindows
~
[2018-07-10T14:04:39] An error occurred (AccessDenied) when calling the CreateStack operation: User: arn:aws:sts::<obfuscated_account>:assumed-role/ADFS-OpsSupport-StcEcs/<obfuscated.email> is not authorized to perform: cloudformation:CreateStack on resource: arn:aws:cloudformation:us-west-2:<obfuscated_account>:stack/stcecs-teamcityAgentWindows/*

Expected log Output

Tailing stack: StcEcs-teamcityAgentWindows

MikeB on slack helped me locate where this was happening. This is where it's being lowercased.

https://github.com/cloudtools/stacker/blob/1cb24aa1a596261d533a5dfc4536757a3743b6ab/stacker/context.py#L116

Suggested fix: Lowercase the bucket, but don't lowercase anything that isn't bucket related.. and keep the upper casing.

Considerations would be existing stacks that are deployed and named with lower casing. We should probably not change the case in an existing stack, but new stacks could use the upper case.

brettswift avatar Jul 10 '18 20:07 brettswift