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

stacker bucket will always be created with default aws profile regardless of -p option #673

Open
ronend opened this issue Oct 24, 2018 · 1 comment

Comments

@ronend
Copy link

ronend commented Oct 24, 2018

stacker.log
Running stacker build -p dronen1 ./config/environments/prod/us-east-1.env ./config/capabilities/zone/avm/custom_resources.yaml
Stacker errored out:
[2018-10-23T23:44:08] Using default AWS provider mode [2018-10-23T23:44:09] Access denied for bucket stacker-templates-us-east-1-1540336332. Did you remember to use a globally unique name? Traceback (most recent call last): File "/Users/dronen/workspace/stacker/stacker/util.py", line 495, in ensure_s3_bucket s3_client.head_bucket(Bucket=bucket_name) File "/Users/dronen/workspace/mufg-infrastructure/venv3/lib/python3.6/site-packages/botocore/client.py", line 314, in _api_call return self._make_api_call(operation_name, kwargs) File "/Users/dronen/workspace/mufg-infrastructure/venv3/lib/python3.6/site-packages/botocore/client.py", line 612, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden Traceback (most recent call last): File "/Users/dronen/workspace/mufg-infrastructure/venv3/bin/stacker", line 7, in <module> exec(compile(f.read(), __file__, 'exec')) File "/Users/dronen/workspace/stacker/scripts/stacker", line 10, in <module> args.run(args) File "/Users/dronen/workspace/stacker/stacker/commands/stacker/build.py", line 58, in run dump=options.dump) File "/Users/dronen/workspace/stacker/stacker/actions/base.py", line 199, in execute self.pre_run(*args, **kwargs) File "/Users/dronen/workspace/stacker/stacker/actions/build.py", line 396, in pre_run self.ensure_cfn_bucket() File "/Users/dronen/workspace/stacker/stacker/actions/base.py", line 159, in ensure_cfn_bucket self.bucket_region) File "/Users/dronen/workspace/stacker/stacker/util.py", line 495, in ensure_s3_bucket s3_client.head_bucket(Bucket=bucket_name) File "/Users/dronen/workspace/mufg-infrastructure/venv3/lib/python3.6/site-packages/botocore/client.py", line 314, in _api_call return self._make_api_call(operation_name, kwargs) File "/Users/dronen/workspace/mufg-infrastructure/venv3/lib/python3.6/site-packages/botocore/client.py", line 612, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden
The problem is in the constructor of actions.base.BaseAction.__init__(), the session is built without the profile:
self.s3_conn = get_session(self.bucket_region).client('s3')
The profile is not passed to this constructor, so I have no idea how this might be solved other than adding karg to the constructor.

@ejholmes
Copy link
Contributor

ejholmes commented Oct 24, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants