Skip to content

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

@vinoth2710

Description

@vinoth2710

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UntriagedAn issue that has yet to be triaged.Type: BugDoes not work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions