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

Conversation

baronswindle
Copy link

Most other S3 commands accept an --endpoint-url argument. cloudformation package uses S3 under the hood, so it made sense to me that we could allow users to configure the S3 endpoint.

Additionally, it makes it somewhat easier to use to launch CF stacks for local development/testing. See localstack/localstack#632.

@baronswindle baronswindle force-pushed the feature/cf-package-s3-endpoint branch from 434a276 to 7c532ba Compare May 5, 2018 05:40
@codecov-io
Copy link

codecov-io commented May 5, 2018

Codecov Report

Merging #3309 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3309   +/-   ##
========================================
  Coverage    93.96%   93.96%           
========================================
  Files          188      188           
  Lines        14525    14525           
========================================
  Hits         13649    13649           
  Misses         876      876
Impacted Files Coverage Δ
awscli/paramfile.py 100% <ø> (ø) ⬆️
awscli/customizations/cloudformation/package.py 80.85% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da79486...4085282. Read the comment docs.

@rafenden
Copy link

rafenden commented Jan 11, 2019

@baronswindle great work! However, there is some work required to support deploy.py.

@miron4dev
Copy link

Any news regarding this issue?

@codygman
Copy link

codygman commented Jan 9, 2020

@miron4dev With renewed interest are there still plans to work on this or is localstack going to be deprecating aws cli v1 anytime soon?

@whummer
Copy link

whummer commented Feb 29, 2020

Would love to see this feature added to aws cli v1. Can you please elaborate which changes are still required @rafenden @codygman ? (Apart from fixing the merge conflicts). I'd be happy to contribute, if needed, unless @baronswindle can update the PR to push this over the line..? Thanks

@baronswindle baronswindle force-pushed the feature/cf-package-s3-endpoint branch from 7c532ba to 4085282 Compare March 6, 2020 21:51
@wh1tecat-nya
Copy link

I just has this problem. is there any update?

@baronswindle baronswindle force-pushed the feature/cf-package-s3-endpoint branch from 4085282 to e8693eb Compare June 3, 2020 22:41
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2020

Codecov Report

Merging #3309 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3309   +/-   ##
========================================
  Coverage    93.98%   93.98%           
========================================
  Files          188      188           
  Lines        14560    14560           
========================================
  Hits         13684    13684           
  Misses         876      876           
Impacted Files Coverage Δ
awscli/customizations/cloudformation/deploy.py 100.00% <ø> (ø)
awscli/customizations/cloudformation/package.py 80.85% <ø> (ø)
awscli/paramfile.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6441511...d0bf26a. Read the comment docs.

@@ -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
Copy link

@whummer whummer Jun 4, 2020

Choose a reason for hiding this comment

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

@baronswindle Looks like we're missing a comma at the end of this line. Seems to be breaking the builds currently:

ERROR: Failure: SyntaxError (invalid syntax (deploy.py, line 290))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/build/aws/aws-cli/tests/unit/customizations/cloudformation/test_deploy.py", line 20, in <module>
    from awscli.customizations.cloudformation.deploy import DeployCommand
  File "/home/travis/build/aws/aws-cli/awscli/customizations/cloudformation/__init__.py", line 14, in <module>
    from awscli.customizations.cloudformation.deploy import DeployCommand
  File "/home/travis/build/aws/aws-cli/awscli/customizations/cloudformation/deploy.py", line 290
    endpoint_url=parsed_args.s3_endpoint_url)
               ^
SyntaxError: invalid syntax

Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

@whummer My apologies - that was careless. Just pushed up the fix.

@baronswindle baronswindle force-pushed the feature/cf-package-s3-endpoint branch from e8693eb to d0bf26a Compare June 4, 2020 00:51
@whummer
Copy link

whummer commented Jun 4, 2020

Builds are green now, thanks @baronswindle . Are we good to get this merged from your side @rafenden @kyleknap @jamesls ? Please let us know if anything is missing - would be great to get this feature in. Thanks!

@whummer
Copy link

whummer commented Jun 12, 2020

Awesome, thanks for approving the PR @eitens-mak ! Do you know what is the further process for getting this merged? Could one of the project maintainers please help us out here? Many thanks, really appreciated!!

@whummer
Copy link

whummer commented Jun 19, 2020

Trying to bump this PR one more time - apologies for being persistent, but it would be great to get an official statement from the maintainers what is still required to get this merged and released.

@eitens-mak @stealthycoin @kyleknap @nateprewitt Can you please help out here? Many thanks in advance.

@eitens-mak
Copy link

@whummer Hey, I'm not a maintainer. Just a random internet person interested in merging this. I'm surprised Github let me approve it, but I was mostly hoping to get some traction because I too want this.

@whummer
Copy link

whummer commented Jul 5, 2020

@jamesls @kyleknap @bisdavid @JordonPhillips @stealthycoin Can we please get some help or official statement for this PR?

(Pinging some of the top contributors, as I wasn't able to figure out the list of official maintainers of this repository - apologies for the broadcast.)

Would be great if we could get an official 👍 / 👎 on this pull request - are there any concerns about this new feature, anything still missing (as per the contribution guidelines)?

Many thanks for your help.

@whummer
Copy link

whummer commented Jul 20, 2020

@baronswindle @eitens-mak @wh1tecat-nya @codygman @miron4dev @rafenden We took the liberty to incorporate this change directly into the awslocal command line (see here). If and when this PR gets merged, we can remove our patch again and use the official version contributed here.

You can try installing the latest version of the awslocal command line:

pip install --upgrade --no-cache 'awscli-local>=0.7'

The --s3-endpoint-url parameter will then become available for the package and deploy commands, for instance:

awslocal cloudformation package --template-file template.yml --s3-endpoint-url http://localhost:4566 --s3-bucket test --force-upload
Uploading to 76cdb2bad9582d23c1f6f4d868218d6c  22 / 22.0  (100.00%)
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs8.10
      CodeUri: s3://test/76cdb2bad9582d23c1f6f4d868218d6c

Hope that helps - any feedback welcome. Thanks for your help.

@paul-uz
Copy link

paul-uz commented Mar 26, 2021

Can this be merged yet? I desperatley need to be able to deploy our cloudformation stack on Localstack and I need to use aws cloudformation package which is broken.

@hammond756
Copy link

I'm also really hoping this can be merged soon.

@kevin-woodward
Copy link

Any progress on this?

@paul-uz
Copy link

paul-uz commented Sep 1, 2021

3 years laters.... Can we get this merged please?

Copy link

@whummer whummer left a comment

Choose a reason for hiding this comment

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

Changes LGTM (FWIW, as I'm not an official maintainer of this repo) - we've been using this approach successfully in a fork of this repo providing the awslocal command line.

Would also love to see this getting merged, so we don't have to depend on maintaining forks for customizing the S3 CloudFormation endpoint URL. Thanks in advance!

@paul-uz
Copy link

paul-uz commented Sep 3, 2021

@kyleknap are you authorized to merge?

@kdaily kdaily added cloudformation package-deploy customization Issues related to CLI customizations (located in /awscli/customizations) labels Nov 17, 2021
@jonasdebeukelaer
Copy link

bump. Any communication from aws team would be appreciated 👌

@kdaily
Copy link
Member

kdaily commented Apr 22, 2022

Hi everyone,

Thank you for your patience, and I apologize that it's taken so long to get this reviewed. We're making some changes to our community contribution process to provide more transparency and make community contributions successful.

This PR linked should be reviewed within the next couple weeks as we work through all open pull requests to see where the fall in our newly proposed contribution process.

You can read more about the changes to the contribution process here.

@kdaily kdaily added the needs-review This issue or pull request needs review from a core team member. label Apr 22, 2022
@@ -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.

@kdaily kdaily added ready-for-review community response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-review This issue or pull request needs review from a core team member. labels May 10, 2022
@tim-finnigan
Copy link
Contributor

Putting this PR in draft status as we haven't heard back since last year regarding the requested changes.

@tim-finnigan tim-finnigan marked this pull request as draft April 24, 2023 21:23
@tim-finnigan
Copy link
Contributor

Hi @baronswindle just wanted to check in on this PR — is adding the tests requested here something that you are able to address? #3309 (comment)

@tim-finnigan
Copy link
Contributor

Closing this PR as we have not heard back regarding the requested changes.

@tim-finnigan
Copy link
Contributor

Just wanted to follow up and share this update on the linked issue:

Hi all - thanks again for your patience. Per this recent announcement you can now specify the endpoint to use for all service requests through the shared configuration file and environment variables, as well as specify the endpoint URL for individual AWS services.

To start using this feature, install the AWS CLI >=1.29.0 or >=2.13.0.

To read more about this feature, see the documentation page "Service-specific Endpoints" in the AWS SDKs and Tools Reference Guide:

https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloudformation package-deploy community customization Issues related to CLI customizations (located in /awscli/customizations) response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

None yet