User Data - add_s3_download_command missing --region so it fails to download in the ISOLATED zone through S3 VPC gateway
See original GitHub issueasset = 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Troubleshoot connecting to Amazon S3 from VPC endpoints
You can access Amazon S3 objects using VPC endpoint only when the S3 objects are in the same Region as the Amazon S3...
Read more >@aws-cdk/aws-ec2 - npm
If region and account are not specified, the stack could be deployed anywhere and it will have to make a safe choice, limiting...
Read more >AWS Security Best Practices - Awsstatic
You must download and securely store the private key of the. Amazon EC2 key pair. AWS does not store the private key; if...
Read more >Managing Amazon S3 access with VPC endpoints and S3 ...
Access Points are unique to an account and Region. ... We then create an Amazon S3 VPC Gateway endpoint to make sure that...
Read more >Top 100+ AWS Interview Questions and Answers for 2023
Utilizing VPC makes it possible (Virtual Private Cloud). 20. Define Amazon EC2 regions and availability zones? Availability zones are ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for your time and effort.
Any progress ?