Closed eniskonuk closed 6 years ago
The problem is your code example has defined hsm
twice, in different contexts. When you're calling it in the block, it's now a type shape, not the client. Here is code which will work:
hsm_client = Aws::CloudHSMV2::Client.new(
:http_wire_trace => false,
:region => region, :credentials => @aws_cred, :logger => @aws_logger
)
begin
resp_c = hsm_client.describe_clusters
resp_c.clusters.each do |cc|
cc.hsms.each do |hsm|
hsm_client.delete_hsm(cluster_id: hsm.cluster_id, hsm_id: hsm.hsm_id)
end
hsm_client.delete_cluster(cluster_id: cc.cluster_id)
end
rescue => e
end
You're absolutely right @awood45. I feel like a dufus.
Please fill out the sections below to help us address your issue
Issue description
Even though the delete_hsm API endpoint is defined in docs and in the api definition for CloudHSMV2, the delete_hsm method does not seem to get auto-generated in any of the current gem version. Tested on 2.10.84, 2.10.100 and 3.x.x.
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk 2.10.100
Version of Ruby, OS environment
2.4.1/Ubuntu 16.04LTS
Code snippets / steps to reproduce