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

User Data - add_s3_download_command missing --region so it fails to download in the ISOLATED zone through S3 VPC gateway #8287

Closed
DharmSonariya opened this issue May 31, 2020 · 7 comments · Fixed by #16667
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@DharmSonariya
Copy link

DharmSonariya commented May 31, 2020

asset = Asset(self, "Asset", path=path.join(__dirname, "configure.sh"))
instance = ec2.Instance(self, "Instance", {})
local_path = instance.user_data.add_s3_download_command(
    bucket=asset.bucket,
    bucket_key=asset.s3_object_key
)
instance.user_data.add_execute_file_command(
    file_path=local_path,
    arguments="--verbose -y"
)
asset.grant_read(instance.role)

Above Python code generate User Data

#!/bin/bash
mkdir -p $(dirname '/tmp/assets/fa08d934445838dab921670b0d40be6d9d261063663fbc9cd7cfd7e6691d233d.zip')
aws s3 cp 's3://cdktoolkit-stagingbucket-silds9kng0ra/assets/fa08d934445838dab921670b0d40be6d9d261063663fbc9cd7cfd7e6691d233d.zip' '/tmp/assets/fa08d934445838dab921670b0d40be6d9d261063663fbc9cd7cfd7e6691d233d.zip'

Which is perfectly working in the private zone. But when deploy instance in the ISOLATED zone its fail to download through S3 VPC Gateway. Manually adding --region with aws s3 cp command, then it works.

@DharmSonariya DharmSonariya added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 31, 2020
@SomayaB SomayaB added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Jun 1, 2020
@rix0rrr rix0rrr added good first issue Related to contributions. See CONTRIBUTING.md p2 labels Jun 1, 2020
@pachicoo
Copy link

pachicoo commented Aug 7, 2020

Any progress on this? It is a big hurdle to configure instances in an isolated zone.
I trust this matter will identify it as a high priority.

@NetaNir NetaNir added the effort/small Small work item – less than a day of effort label Aug 10, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 6, 2020
@rix0rrr rix0rrr removed their assignment Jun 3, 2021
@ghost
Copy link

ghost commented Jul 15, 2021

Any progress ?

@LukvonStrom
Copy link
Contributor

@DharmSonariya If I understand the issue correctly you want to have the ability to specify the region parameter for the aws s3 cp command? My suggestion is implementing this, but only if set explicitly.
I.e. it is not added in case no region parameter is provided to `add_s3_download_command, but when a region parameter is provided it is added.

@DharmSonariya
Copy link
Author

@DharmSonariya If I understand the issue correctly you want to have the ability to specify the region parameter for the aws s3 cp command? My suggestion is implementing this, but only if set explicitly.
I.e. it is not added in case no region parameter is provided to `add_s3_download_command, but when a region parameter is provided it is added.

It seems to be the perfect solution.

@LukvonStrom
Copy link
Contributor

@DharmSonariya my proposed PR should suffice to fix your issue.

@DharmSonariya
Copy link
Author

@DharmSonariya my proposed PR should suffice to fix your issue.

Thank you for your time and effort.

@mergify mergify bot closed this as completed in #16667 Oct 25, 2021
mergify bot pushed a commit that referenced this issue Oct 25, 2021
…#16667)

Allow the specification of a region in `addS3DownloadCommand()` in the UserData helper.

Fixes #8287


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
…aws#16667)

Allow the specification of a region in `addS3DownloadCommand()` in the UserData helper.

Fixes aws#8287


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants