Skip to content

Allow option to disable host prefix injection #6898

@wong-a

Description

@wong-a

Describe the feature

AWS Python SDK/boto has inject_host_prefix setting so clients can disable host prefix injection but AWS CLI does not allow customers to configure this.

Setting this to False disables the injection of operation parameters into the prefix of the hostname. This is useful for clients providing custom endpoints that should not have their host prefix modified.

Use Case

Clients providing a custom endpoint through the --endpoint option should not have their host prefix modified.

One example is with Step Functions Local, where clients will use the AWS CLI to call a local version of Step Functions on localhost. When calling start-sync-execution Host prefix injection preprends sync- to the hostname, which not reachable.

aws stepfunctions start-sync-execution --endpoint http://localhost:8083 --statemachine-arn <my_state_machine>

Error:

Could not connect to the endpoint URL http://sync-localhost:8083

Proposed Solution

Add a new optional boolean parameter to AWS CLI --inject_host_prefix that allows the caller to disable host prefix injection. The parameter would set the inject_host_prefix setting for the boto client.

aws stepfunctions start-sync-execution --endpoint http://localhost:8083 --statemachine-arn <my_state_machine> --inject_host_prefix=False

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

2.4.27

Environment details (OS name and version, etc.)

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions