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

Could not configure S3 bucket region. S3 bucket is expected to be in the same region where an ec2 instance is getting created. #672

Open
vinoth2710 opened this issue Oct 14, 2021 · 0 comments
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@vinoth2710
Copy link

vinoth2710 commented Oct 14, 2021

I'm trying to create an ec2 server with knife ec2 server create

In my knife.rb file I have configured options to get keys from S3 like

knife[:validation_key_url]    = "s3://xxx--ks-ops/chef_pem_keys/#{org_name}-validator.pem"
knife[:s3_secret]    = "s3://xxx-ks-ops/chef_pem_keys/encrypted_data_bag_secret"

The bucket is present in us-east-1 region.

Now if I try to create an ec2 instance with knife command in us-west-1 region, knife initializes the S3 client in us-west-1 region(but I actually want it in us-east-1 region), which causes the the error,

Output

Waiting for EC2 to create the instance
Instance ID: i-0f0218a05e0xx8a8
Flavor: m5.large
Image: ami-0461281d457e8aaeb
Region: us-west-1
Availability Zone: us-west-1c
Security Group Ids: sg-8a485ee8
IAM Profile: app_staging
AWS Tags: Name: xxx-staging-web-server-456, Environment: staging, ServerRole: temp_web, Purpose: knife_bug_fix, Schedule: none, CreatedBy: Ops
SSH Key: xx
T2/T3 Unlimited: Disabled

Subnet ID: subnet-6690480e
Tenancy: default
Public IP Address: 54.193.xx.xxx
Private IP Address: 192.168.25.169
ERROR: Aws::S3::Errors::PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

Versions:
Chef Infra Client: 16.8.14
knife-ec2 2.1.4

Environment:
Ubuntu:18.04

Shouldn't there be an option ideally to configure S3 client region?

@vinoth2710 vinoth2710 added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant