在 AWS-IoT 中使用 http 创建东西 api?

create things api using http in AWS-IoT?

我是这个 AWS IoT 的新手。我在创造事物时遇到问题。为此,我阅读了这份文件:

https://docs.aws.amazon.com/iot/latest/apireference/API_CreateThing.html

我在授权方面遇到问题。我收到此错误:

Failed to open TCP connection to xxxxxx.iot.us-east.amazonaws.com:443 (getaddrinfo: Name or service not known)

我通过以下方式在 AWS IoT 上创建了东西:

class AwsIotService

  def self.create_thing(thing_name)
    begin
      iot = Aws::IoT::Client.new(region: ENV['AWS_REGION'],
                             access_key_id: ENV['AWS_ACCESS_KEY_ID'],
                             secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'])
      iot.create_thing(thing_name: thing_name)
    rescue Aws::IoT::Errors::ServiceError
    end
  end
end