Skip to content

Region in configuration file is ignored when I make a Sign URL Service request. #42

@kmcgarra

Description

@kmcgarra

Home Assistant OS: 12.4
Home Assistant Core: 2024.6.4
HASS-S3: 1.12 installed with HACS

The region in configuration file is ignored when I make a Sign URL Service request.

I have the following in my configuration.yaml:

s3:
  aws_access_key_id: <key>
  aws_secret_access_key: <secret>
  region_name: us-east-2

I am using the Sign URL Service request in a script:

get_snapshot_url:
  alias: Get snapshot URL
  sequence:
    - service: s3.signurl
      data:
        bucket: <bucket>
        key: snapshots/backyard/snapshot.jpg
        duration: 3600

I have confirmed the image exists on my S3 bucket.

The URL I get back gives me the following error:
InvalidRequestThe authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

I added a log statement to line 239 of custom_components/s3/init.py to log the region being used:
_LOGGER.error("Region %s", entry.data[CONF_REGION])

"Region us-east-1" is printed in the log.
Screen Shot 2024-09-09 at 9 37 58 AM

Everything works if I hard code the region as below.
Screen Shot 2024-09-09 at 9 33 01 AM

The Put Service was working as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions