profile and access key/secret key passed in on the commandline not honored
Describe the bug
When specifying a profile with -P taskcat fails at validation. Successfully uploads to existing, private bucket in the profile's specified account, but seems to be attempting validation using the default boto profile
[DEBUG ] :Tags:[]
[ERROR ] :An error occurred (ValidationError) when calling the CreateStack operation: S3 error: Access Denied
For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
[ERROR ] :Cannot launch suse-cap-master.template.yaml
[ERROR ] :Cannot launch suse-cap-master.template.yaml
To Reproduce Steps to reproduce the behavior:
- create a aws cli profile
- create a private bucket in the profile's account
- launch taskcat with a config that includes
s3bucket: mybucket
Expected behavior all operations should use the profile specified
**Version (Please make sure you are running the latest version of taskcat)
- Taskcat Version 0.8.19
This is fixed in release 0.8.27. Can you confirm and close after verification? @jaymccon
I can confirm that the issue is still present in the current master branch
botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the CreateStack operation: S3 error: Access Denied
For more information check http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
I have also checked passing in creds using -A and -S this is also broken in an environment where there are not credentials available in ~/.aws/credentials the describe_availability_zones call made for generate_azs does not use the provided credentials, resulting in:
[DEBUG ] :Requested 3 az's
Traceback (most recent call last):
File "/Users/jmmccon/.pyenv/versions/3.6.4/bin/taskcat", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/Users/jmmccon/taskcat/bin/taskcat", line 101, in <module>
main()
File "/Users/jmmccon/taskcat/bin/taskcat", line 88, in main
testdata = tcat_instance.stackcreate(taskcat_cfg, test_list, args.stack_prefix)
File "/Users/jmmccon/taskcat/taskcat/stacker.py", line 714, in stackcreate
j_params = self.generate_input_param_values(s_parms, region)
File "/Users/jmmccon/taskcat/taskcat/stacker.py", line 679, in generate_input_param_values
return ParamGen(param_list=s_parms, bucket_name=self.get_s3bucket(), boto_client=self._boto_client, region=region, verbose=True).results
File "/Users/jmmccon/taskcat/taskcat/template_params.py", line 45, in __init__
self.transform_parameter()
File "/Users/jmmccon/taskcat/taskcat/template_params.py", line 72, in transform_parameter
self._gen_az_wrapper(self.RE_GENAZ, self.RE_COUNT)
File "/Users/jmmccon/taskcat/taskcat/template_params.py", line 303, in _gen_az_wrapper
self._regex_replace_param_value(genaz_regex, self.get_available_azs(numazs))
File "/Users/jmmccon/taskcat/taskcat/template_params.py", line 130, in get_available_azs
Filters=[{'Name': 'state', 'Values': ['available']}])
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/client.py", line 320, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/client.py", line 610, in _make_api_call
operation_model, request_dict)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/endpoint.py", line 102, in make_request
return self._send_request(request_dict, operation_model)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/endpoint.py", line 132, in _send_request
request = self.create_request(request_dict, operation_model)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/endpoint.py", line 116, in create_request
operation_name=operation_model.name)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/signers.py", line 90, in handler
return self.sign(operation_name, request)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/signers.py", line 157, in sign
auth.add_auth(request)
File "/Users/jmmccon/.pyenv/versions/3.6.4/lib/python3.6/site-packages/botocore/auth.py", line 356, in add_auth
raise NoCredentialsError
botocore.exceptions.NoCredentialsError: Unable to locate credentials
Just verified this is still present. Will be addressed organically in V0.9
https://github.com/taskcat/taskcat-v9/issues/3
v0.9.0 released; This issue is no longer present.