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

download-db-log-file-portion with starting token of 0 not working as documented #3079

Closed
sstarcher opened this issue Jan 10, 2018 · 11 comments
Closed
Assignees
Labels
guidance Question that needs advice or information.

Comments

@sstarcher
Copy link

From the documentation for aws rds download-db-log-file-portion

In  order  to  download  the  entire  file, you need --starting-token 0
       parameter:

          aws rds download-db-log-file-portion --db-instance-identifier myinstance \
          --log-file-name log.txt --starting-token 0 --output text > full.txt```

command: `aws rds download-db-log-file-portion --db-instance-identifier instance --log-file-name error/log_file --starting-token 0`  This file is over 700mb in size.  According to the documentation I should get the entire file, but instead the file is truncated.

Actual results show the data is being truncated.

{
    "LogFileData": "2018-01-09 15:00:00...
...\n [Your log message was truncated]\n"
}

CLI Version

aws --version                                                                                                      
aws-cli/1.14.20 Python/3.6.4 Darwin/17.3.0 botocore/1.8.24

Related issues:
#2745
#2268

Debug output with log information stripped

aws rds download-db-log-file-portion --db-instance-identifier xxxx --log-file-name error/xxxx --starting-token 0 --debug 2> out

2018-01-10 09:34:10,630 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.14.20 Python/3.6.4 Darwin/17.3.0 botocore/1.8.24
2018-01-10 09:34:10,630 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['rds', 'download-db-log-file-portion', '--db-instance-identifier', 'db-instance', '--log-file-name', 'error/logfile', '--starting-token', '0', '--debug']
2018-01-10 09:34:10,631 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x109c11840>
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x10970ba60>
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable credentials_file from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable config_file from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable metadata_service_timeout from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,631 - MainThread - botocore.session - DEBUG - Loading variable metadata_service_num_attempts from defaults.
2018-01-10 09:34:10,632 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,632 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x1099bae18>
2018-01-10 09:34:10,632 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,632 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,632 - MainThread - botocore.session - DEBUG - Loading variable api_versions from defaults.
2018-01-10 09:34:10,633 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.14.20/libexec/lib/python3.6/site-packages/botocore/data/rds/2014-10-31/service-2.json
2018-01-10 09:34:10,641 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.14.20/libexec/lib/python3.6/site-packages/botocore/data/rds/2014-10-31/service-2.sdk-extras.json
2018-01-10 09:34:10,641 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.rds: calling handler <function register_retries_for_service at 0x1092ae268>
2018-01-10 09:34:10,642 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: rds
2018-01-10 09:34:10,644 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function _building_command_table at 0x109b98f28>
2018-01-10 09:34:10,644 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.rds: calling handler <function register_retries_for_service at 0x1092ae268>
2018-01-10 09:34:10,644 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: rds
2018-01-10 09:34:10,644 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function _add_generate_db_auth_token at 0x109b98d90>
2018-01-10 09:34:10,645 - MainThread - botocore.hooks - DEBUG - Event building-command-table.rds: calling handler <function add_waiters at 0x109c16a60>
2018-01-10 09:34:10,650 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.14.20/libexec/lib/python3.6/site-packages/botocore/data/rds/2014-10-31/waiters-2.json
2018-01-10 09:34:10,651 - MainThread - awscli.clidriver - DEBUG - OrderedDict([('db-instance-identifier', <awscli.arguments.CLIArgument object at 0x109f1dd30>), ('log-file-name', <awscli.arguments.CLIArgument object at 0x109f1dd68>), ('marker', <awscli.arguments.CLIArgument object at 0x109f1ddd8>), ('number-of-lines', <awscli.arguments.CLIArgument object at 0x109f1de10>)])
2018-01-10 09:34:10,651 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.download-db-log-file-portion: calling handler <function add_streaming_output_arg at 0x109c11ae8>
2018-01-10 09:34:10,651 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.download-db-log-file-portion: calling handler <function add_cli_input_json at 0x10970bea0>
2018-01-10 09:34:10,652 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.download-db-log-file-portion: calling handler <function unify_paging_params at 0x109b8f510>
2018-01-10 09:34:10,658 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.14.20/libexec/lib/python3.6/site-packages/botocore/data/rds/2014-10-31/paginators-1.json
2018-01-10 09:34:10,658 - MainThread - awscli.customizations.paginate - DEBUG - Modifying paging parameters for operation: DownloadDBLogFilePortion
2018-01-10 09:34:10,658 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.rds.download-db-log-file-portion: calling handler <function add_generate_skeleton at 0x109b73d90>
2018-01-10 09:34:10,658 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.rds.download-db-log-file-portion: calling handler <bound method OverrideRequiredArgsArgument.override_required_args of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x109f1de80>>
2018-01-10 09:34:10,658 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.rds.download-db-log-file-portion: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x109f2e4e0>>
2018-01-10 09:34:10,659 - MainThread - botocore.hooks - DEBUG - Event operation-args-parsed.rds.download-db-log-file-portion: calling handler functools.partial(<function check_should_enable_pagination at 0x109b8f620>, ['marker', 'number-of-lines'], {}, OrderedDict([('db-instance-identifier', <awscli.arguments.CLIArgument object at 0x109f1dd30>), ('log-file-name', <awscli.arguments.CLIArgument object at 0x109f1dd68>), ('marker', <awscli.arguments.CLIArgument object at 0x109f1ddd8>), ('number-of-lines', <awscli.arguments.CLIArgument object at 0x109f1de10>), ('cli-input-json', <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x109f1de80>), ('starting-token', <awscli.customizations.paginate.PageArgument object at 0x109f1deb8>), ('page-size', <awscli.customizations.paginate.PageArgument object at 0x109f2e390>), ('max-items', <awscli.customizations.paginate.PageArgument object at 0x109f2e438>), ('generate-cli-skeleton', <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x109f2e4e0>)]))
2018-01-10 09:34:10,659 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.db-instance-identifier: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.rds.download-db-log-file-portion: calling handler <awscli.argprocess.ParamShorthandParser object at 0x1096b3fd0>
2018-01-10 09:34:10,660 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'db-instance' for parameter "db_instance_identifier": 'db-instance'
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.log-file-name: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.rds.download-db-log-file-portion: calling handler <awscli.argprocess.ParamShorthandParser object at 0x1096b3fd0>
2018-01-10 09:34:10,660 - MainThread - awscli.arguments - DEBUG - Unpacked value of 'error/logfile' for parameter "log_file_name": 'error/logfile'
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.marker: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.number-of-lines: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.cli-input-json: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.starting-token: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.page-size: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.max-items: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.rds.download-db-log-file-portion.generate-cli-skeleton: calling handler <function uri_param at 0x10969b9d8>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event calling-command.rds.download-db-log-file-portion: calling handler <bound method CliInputJSONArgument.add_to_call_parameters of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x109f1de80>>
2018-01-10 09:34:10,660 - MainThread - botocore.hooks - DEBUG - Event calling-command.rds.download-db-log-file-portion: calling handler <bound method GenerateCliSkeletonArgument.generate_json_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x109f2e4e0>>
2018-01-10 09:34:10,660 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable region from config file with value 'aws-region'.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable ca_bundle from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.session - DEBUG - Loading variable api_versions from defaults.
2018-01-10 09:34:10,661 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2018-01-10 09:34:10,661 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2018-01-10 09:34:10,661 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2018-01-10 09:34:10,662 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2018-01-10 09:34:10,663 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.14.20/libexec/lib/python3.6/site-packages/botocore/data/endpoints.json
2018-01-10 09:34:10,665 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,665 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x109298840>
2018-01-10 09:34:10,668 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.rds: calling handler <function add_generate_db_auth_token at 0x109232bf8>
2018-01-10 09:34:10,668 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.rds: calling handler <function add_generate_presigned_url at 0x109239510>
2018-01-10 09:34:10,668 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2018-01-10 09:34:10,677 - MainThread - botocore.endpoint - DEBUG - Setting rds timeout as (60, 60)
2018-01-10 09:34:10,678 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: rds
2018-01-10 09:34:10,678 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,678 - MainThread - botocore.session - DEBUG - Loading variable profile from defaults.
2018-01-10 09:34:10,678 - MainThread - botocore.session - DEBUG - Loading variable output from config file with value 'json'.
2018-01-10 09:34:10,678 - MainThread - botocore.paginate - DEBUG - Attempting to fall back to old starting token parser. For token: 0
2018-01-10 09:34:10,678 - MainThread - botocore.paginate - DEBUG - Attempting to fall back to old starting token parser. For token: 0
2018-01-10 09:34:10,679 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.rds.DownloadDBLogFilePortion: calling handler <function generate_idempotent_uuid at 0x1092acb70>
2018-01-10 09:34:10,679 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=DownloadDBLogFilePortion) (verify_ssl=True) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'aws-cli/1.14.20 Python/3.6.4 Darwin/17.3.0 botocore/1.8.24'}, 'body': {'Action': 'DownloadDBLogFilePortion', 'Version': '2014-10-31', 'DBInstanceIdentifier': 'db-instance', 'LogFileName': 'error/logfile', 'Marker': '0'}, 'url': 'https://rds.aws-region.amazonaws.com/', 'context': {'client_region': 'aws-region', 'client_config': <botocore.config.Config object at 0x10a000668>, 'has_streaming_input': False, 'auth_type': None}}
2018-01-10 09:34:10,679 - MainThread - botocore.hooks - DEBUG - Event request-created.rds.DownloadDBLogFilePortion: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x10a000588>>
2018-01-10 09:34:10,679 - MainThread - botocore.hooks - DEBUG - Event choose-signer.rds.DownloadDBLogFilePortion: calling handler <function set_operation_specific_signer at 0x1092aca60>
2018-01-10 09:34:10,680 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2018-01-10 09:34:10,680 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-www-form-urlencoded; charset=utf-8
host:rds.aws-region.amazonaws.com
x-amz-date:20180110T143410Z

content-type;host;x-amz-date
24e7f0dc1243da7337fe4b71cd1b33ba341789e2e37bd44654fd29269d4ef8ce
2018-01-10 09:34:10,680 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20180110T143410Z
20180110/aws-region/rds/aws4_request
c778a189e211e2e7d0f114ca6ff5bfc0470fe944d0c3bdfc916bc2e840da4bbc
2018-01-10 09:34:10,680 - MainThread - botocore.auth - DEBUG - Signature:
13ab07cfdb95d82d66c3aa650e44840be243229b692ba3c52bce4a748bd62d1b
2018-01-10 09:34:10,682 - MainThread - botocore.endpoint - DEBUG - Sending http request: <PreparedRequest [POST]>
2018-01-10 09:34:10,683 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (1): rds.aws-region.amazonaws.com
2018-01-10 09:34:11,339 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "POST / HTTP/1.1" 200 1069820
2018-01-10 09:34:13,178 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amzn-requestid': '968aebba-1ba8-4adf-bb78-c9c7b136cca1', 'content-type': 'text/xml', 'content-length': '1069820', 'vary': 'Accept-Encoding', 'date': 'Wed, 10 Jan 2018 14:34:10 GMT'}
2018-01-10 09:34:13,178 - MainThread - botocore.parsers - DEBUG - Response body:
b'<DownloadDBLogFilePortionResponse xmlns="http://rds.amazonaws.com/doc/2014-10-31/">\n  <DownloadDBLogFilePortionResult>\n    <AdditionalDataPending>false</AdditionalDataPending>\n    <Marker>15:1048577</Marker>\n    <LogFileData>....\n [Your log message was truncated]\n</LogFileData>\n  </DownloadDBLogFilePortionResult>\n  <ResponseMetadata>\n    <RequestId>968aebba-1ba8-4adf-bb78-c9c7b136cca1</RequestId>\n  </ResponseMetadata>\n</DownloadDBLogFilePortionResponse>\n'
2018-01-10 09:34:13,198 - MainThread - botocore.hooks - DEBUG - Event needs-retry.rds.DownloadDBLogFilePortion: calling handler <botocore.retryhandler.RetryHandler object at 0x109cd4f98>
2018-01-10 09:34:13,198 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2018-01-10 09:34:13,198 - MainThread - botocore.paginate - DEBUG - Attempting to fall back to old starting token parser. For token: 0
@kyleknap
Copy link
Contributor

Interesting. Thanks for the debug logs that is really helpful. So it looks like the value that the service is returning is literally returning [Your log message was truncated] meaning the value in your db logs is also [Your log message was truncated]. I'm not too sure why your logs file itself would be truncating the message as this happening server side as opposed to client side. I would recommend reaching out to AWS Support or the AWS Developer Forums. Someone there should have more knowledge of the server side logic of why that is happening.

@sstarcher
Copy link
Author

@kyleknap I wonder if the API has some changes where you can only request a response of a certain size. If that's the case the documentation for the aws cli should change to reflect that. If that's the case the current documentation is wrong.

@kyleknap
Copy link
Contributor

Looking at the API, you may have some luck with the --page-size parameter. This corresponds to NumberOfLines parameter which will control the maximum number of lines per page returned from the CLI. Otherwise looking at the API documentation, I did not see anything related to the value: [Your log message was truncated].

@sstarcher
Copy link
Author

Nope, setting the page size to a high value results in the exact same file output. The documentation you linked specifies
Downloads all or a portion of the specified log file, up to 1 MB in size.

It looks like if a user has a 500mb log file are are using the api they must make 500 aws cli calls.
If this is the case the documentation for aws cli's command needs updated to reflect this.

@sstarcher
Copy link
Author

I also just assumed I could update the --starting-token and get the next segment. If I change --starting-token to 1 I get no output. Same thing with several larger values no output. I'm not seeing how to use this command and actually get more than the first 1mb of logs in it's current state.

@jonstacks
Copy link

jonstacks commented Apr 8, 2018

I had the same issue with both the CLI and the SDK. I ended up making a CLI program, rds-logs-download-url, to give me the URL for the full log file so I could just download it. I hope someone else find it useful as well until this issue gets revolved.

@diehlaws diehlaws added guidance Question that needs advice or information. and removed move-to-forums labels Jan 4, 2019
@justnance
Copy link

Following up here, I don't think there's anything actionable on the CLI side. Kyle provided an explanation about what's happening, and also recommended to reach out to the forums.

Closing issue due to inactivity.

@justnance justnance self-assigned this Jun 25, 2019
@vosmax
Copy link

vosmax commented May 11, 2020

I've faced with the same issue.
aws rds download-db-log-file-portion --db-instance-identifier myinstance \ --log-file-name log.txt --starting-token 0 --output text > doesn't return the whole log file.
It's returned only 99326 log lines from file (2 minutes of hour).
I've tried to use pagination with --max-items as well, but aws cli doesn't generate token for the last part of log file. For example, file can be divided by three part with 1000 items. On the second portion of data I will get NextToken=null, so I wouldn't get the third part.

@jakubkalicki
Copy link

The problem still occurs.

@jonstacks
Copy link

@jakubkalicki, I posted this up above, but as a workaround I wrote a cli in golang to programmatically get the download url if you are in need of something right away. rds-logs-download-url. You just need the RDS instance identifier and the name of the log to generate the signed URL. (I used the other aws commands to get these in a bash script and programmatically download the files to feed into something for analytics).

I also hope they add this functionality into the CLI.

@ccampo133
Copy link

If anybody is still running into this problem, I have a small Python script that you can use to download RDS log files and save them in S3: https://github.com/ccampo133/rds-logs-to-s3

thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
* sam pipeline bootstrap (aws#2811)

* two-stages-pipeline plugin

* typos

* add docstring

* make mypy happy

* removing swap file

* delete the two_stages_pipeline plugin as the pipeline-bootstrap command took over its responsibility

* remove 'get_template_function_runtimes' function as the decision is made to not process the SAM template during pipeline init which was the only place we use the function

* sam pipeline bootstrap command

* move the pipelineconfig.toml file to .aws-sam

* UX - rewriting

Co-authored-by: Chris Rehn <crehn@outlook.com>

* UX improvements

* make black happy

* apply review comments

* UX - rewriting

Co-authored-by: Chris Rehn <crehn@outlook.com>

* refactor

* Apply review comments

* use python way of array elements assignments

* Update samcli/lib/pipeline/bootstrap/stage.py

Co-authored-by: _sam <3804518+aahung@users.noreply.github.com>

* apply review comments

* typo

* read using utf-8

* create and user a safe version of the save_config method

* apply review comments

* rename _get_command_name to _get_command_names

* don't save generated ARNs for now, will save during init

* Revert "don't save generated ARNs for now, will save during init"

This reverts commit d184e164022d9560131c62a826436edbc93da189.

* Notify the user to rotate periodically rotate the IAM credentials

* typo

* Use AES instead of KMS for S3 SSE

* rename Ecr to ECR and Iam to IAM

* Grant lambda service explicit permissions to thhe ECR instead of relying on giving this permissions on ad-hoc while creating the container images

Co-authored-by: Chris Rehn <crehn@outlook.com>
Co-authored-by: _sam <3804518+aahung@users.noreply.github.com>

* sam pipeline init command (aws#2831)

* sam pipeline init command

* apply review comments

* apply review comments

* display a message that we have successfully created the pipeline configuration file(s).

* doc typo

* Let 'sam pipeline init'  prefills pipeline's infrastructure resources… (aws#2894)

* Let 'sam pipeline init'  prefills pipeline's infrastructure resources' values from 'sam pipeline bootstrap'  results.

* save bootstrapped sateg region

* make black happy

* exclude non-dict keys from samconfig.get_env_names method.

* Rename the pipeline 'Stage' concept to 'Environment' (aws#2908)

* Rename the pipeline 'Stage' concept to 'Environment'

* typo

* Rename --environment-name argument to --environment

* Sam pipelines ux rename ecr repo to image repository (aws#2910)

* Rename ecr-repo to image-repository

* UT Fixes

* typo

* typo

* feat: Support creating pipeline files directly into . without hooks (aws#2911)

* feat: Support creating pipeline files directly into . without hooks

* Integration test for pipeline init and pipeline bootstrap (aws#2841)

* Expose Environment._get_stack_name for integ test to predict stack name

* Add integ test for pipeline bootstrap

* Add init integ test

* small UX improvements: (aws#2914)

* small UX improvements:
1. show a message when the user cancels a bootstrapping command.
2. Don't prompt for CI/CD provider or provider templates if there is only one choice.
3. Make PipelineFileAlreadyExistsError a UserError.
4. use the Colored class instead of fg='color' when prompting a colored message.
5. Fix a bug where we were not allowing empty response for not required questions.

* Fix Integration Test: We now don't ask the user to select a provider's pipeline template if there is only one

* Add docs for PipelineFileAlreadyExistsError

* make black happy

* Sam pipelines s3 security (aws#2975)

* Deny non https requests for the artifacts S3 bucket

* enable bucket serverside logging

* add integration tests for artifacts bucket SSL-only requests and access logging

* typo

* Ensure the ArtifactsLoggingBucket denies non ssl requests (aws#2976)

* Sam pipelines ux round 3 (aws#2979)

* rename customer facing message 'CI/CD provider' to 'CI/CD system'

* add a note about what 'Environment Name' is during the pipeline bootstrap guided context

* Apply suggestions from code review

typo

Co-authored-by: Chris Rehn <crehn@outlook.com>

Co-authored-by: Chris Rehn <crehn@outlook.com>

* let pipeline IAM user assume only IAM roles tagged with Role=pipeline-execution-role (aws#2982)

* Adding AWS_ prefix to displayed out. (aws#2993)

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Add region to pipeline bootstrap interactive flow (aws#2997)

* Ask AWS region in bootstrap interactive flow

* Read default region from boto session first

* Fix a unit test

* Inform write to pipelineconfig.toml at the end of bootstrap (aws#3002)

* Print info about pipelineconfig.toml after resources are bootstrapped

* Update samcli/commands/pipeline/bootstrap/cli.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

Co-authored-by: Chris Rehn <crehn@outlook.com>

* List detected env names in pipeline init when prompt to input the env name (aws#3000)

* Allow question.question can be resolved using key path

* Pass the list of env names message (environment_names_message) into pipeline init interactive flow context

* Update samcli/commands/pipeline/init/interactive_init_flow.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Fix unit test (trigger pr builds)

* Fix integ test

* Fix integ test

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Adding account id to bootstrap message. (aws#2998)

* Adding account id to bootstrap message.

* adding docstring

* Addressing PR comments.

* Adding unit tests.

* Fixing unit tests.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Cfn creds fix (aws#3014)

* Removing pipeline user creds from cfn output. This maintains same user exp.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Ux bootstrap revamp 20210706 (aws#3021)

* Add intro paragraph to bootstrap

* Add switch account prompt

* Revamp stage definition prompt

* Revamp existing resources prompt

* Revamp security prompt

* Allow answers to be changed later

* Add exit message for bootstrap

* Add exit message for bootstrap (1)

* Add indentation to review values

* Add "Below is the summary of the answers:"

* Sweep pylint errors

* Update unit tests

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/guided_context.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update samcli/commands/pipeline/bootstrap/cli.py

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Update unit tests

* Add bold to other literals

Co-authored-by: Chris Rehn <crehn@outlook.com>

* Adding account condition for CFN execution role. (aws#3027)

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* pipeline UX revamp 20210707 (aws#3031)

* Allow running bootstrap inside pipeline init

* Select account credential source within bootstrap

* Add bootstrap decorations within pipeline init

* Removing ip range option from bootstrap. (aws#3036)

* Removing ip range option from bootstrap.

* Fixing unit test from UX PR.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Fix toml file incorrect read/write in init --bootstrap (aws#3037)

* Temporarily removing account fix. (aws#3038)

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Rename environment to stage (aws#3040)

* Improve account source selection (aws#3042)

* Fixing various cosmetics UX issues with pipeline workflow. (aws#3046)

* Fixing credential to credentials

* Forcing text color to yellow.

* Adding new line after stage diagram.

* Adding extra line after checking bootstrap message.

* Renaming config -> configuration

* account source -> credential source

* Removing old message.

* Fixing indentation in list.

* Fixing bunch of indentation.

* fixing f string

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Auto skip questions if stage detected (aws#3045)

* Autofill question if default value is presented

* Allow to use index to select stage names (aws#3051)

* Updating message when bootstrap stages are missing. (aws#3058)

* Updating message when bootstrap stages are missing.

* Fixing indendation

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Fixing bootstrap integ tests. (aws#3061)

* Fixing bootstrap integ tests.

* Cleaning up some integ tests.

* Using environment variables when running integ test on CI.

* Using expression instead of full loop.

* Adding instruction to use default profile on local.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Fix bootstrap test region (#3064)

* Fix bootstrap region in integ test

* Fix regions in non-interactive mode as well

* Add more pipeline init integ test (aws#3065)

* Fix existing pipeline init integ test

* Add more pipeline init integ tests

* Config file bug (aws#3066)

* Validating config file after bootstrap stack creation.

* Validating config file after bootstrap.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* Fix pipeline init integ test because of pipelineconfig file exists (aws#3067)

* Make stage name randomized to avoid race condition among multi canary runs (aws#3078)

* Load number of stages from pipeline template (aws#3059)

* Load number of stages from templates

* Rename variable and add debug log

* Add encoding to open()

* Allow roles with Tag aws-sam-pipeline-codebuild-service-role to assume PipelineExecutionRole (aws#2950)

* pipeline init UX: Ask to confirm when file exists (aws#3079)

* Ask to confirm overriding if files already exist, or save to another directory

* Add doc links (aws#3087)

* Adding accidentally removed tests back. (aws#3088)

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

Co-authored-by: elbayaaa <72949274+elbayaaa@users.noreply.github.com>
Co-authored-by: Chris Rehn <crehn@outlook.com>
Co-authored-by: Ahmed Elbayaa <elbayaaa@amazon.com>
Co-authored-by: Tarun <c2tarun@users.noreply.github.com>
Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

8 participants