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

Support --s3-endpoint-url argument to cloudformation package #3309

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion awscli/customizations/cloudformation/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ class DeployCommand(BasicCommand):
)
},

{
'name': 's3-endpoint-url',
'help_text': (
'URL of storage service where packaged templates and artifacts'
' will be uploaded. Useful for testing and local development'
' or when uploading to a non-AWS storage service that is'
' nonetheless S3-compatible.'
)
},

{
'name': 'kms-key-id',
'help_text': (
Expand Down Expand Up @@ -276,7 +286,8 @@ def _run_main(self, parsed_args, parsed_globals):
"s3",
config=Config(signature_version='s3v4'),
region_name=parsed_globals.region,
verify=parsed_globals.verify_ssl)
verify=parsed_globals.verify_ssl,
endpoint_url=parsed_args.s3_endpoint_url)

s3_uploader = S3Uploader(s3_client,
bucket,
Expand Down
13 changes: 12 additions & 1 deletion awscli/customizations/cloudformation/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ class PackageCommand(BasicCommand):
)
},

{
'name': 's3-endpoint-url',
'help_text': (
'URL of storage service where packaged templates and artifacts'
' will be uploaded. Useful for testing and local development'
' or when uploading to a non-AWS storage service that is'
' nonetheless S3-compatible.'
)
},

{
'name': 'kms-key-id',
'help_text': (
Expand Down Expand Up @@ -128,7 +138,8 @@ def _run_main(self, parsed_args, parsed_globals):
"s3",
config=Config(signature_version='s3v4'),
region_name=parsed_globals.region,
verify=parsed_globals.verify_ssl)
verify=parsed_globals.verify_ssl,
endpoint_url=parsed_args.s3_endpoint_url)

template_path = parsed_args.template_file
if not os.path.isfile(template_path):
Expand Down
4 changes: 4 additions & 0 deletions awscli/paramfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@
'cloudformation.set-stack-policy.stack-policy-url',
# aws cloudformation package --template-file
'custom.package.template-file',
# aws cloudformation package --s3-endpoint-url
'custom.package.s3-endpoint-url',
# aws cloudformation deploy --template-file
'custom.deploy.template-file',
# aws cloudformation deploy --s3-endpoint-url
'custom.deploy.s3-endpoint-url',

'cloudformation.update-stack.stack-policy-during-update-url',
# We will want to change the event name to ``s3`` as opposed to
Expand Down
1 change: 1 addition & 0 deletions tests/unit/customizations/cloudformation/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def setUp(self):
fail_on_empty_changeset=True,
s3_bucket=None,
s3_prefix="some prefix",
s3_endpoint_url="http://localhost",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to see tests explicit tests for this behavior.

At the least there needs to be :

  1. Test where argument is not supplied showing that the old endpoint behavior used.
  2. If we do supply an override argument, that is correctly passed through and used in the request.

kms_key_id="some kms key id",
force_upload=True,
tags=["tagkey1=tagvalue1"])
Expand Down
1 change: 1 addition & 0 deletions tests/unit/customizations/cloudformation/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def setUp(self):
self.parsed_args = FakeArgs(template_file='./foo',
s3_bucket="s3bucket",
s3_prefix="s3prefix",
s3_endpoint_url="http://localhost",
kms_key_id="kmskeyid",
output_template_file="./oputput",
use_json=False,
Expand Down