AWS SDK S3 example giving network error - ruby

I am trying to learn to use the AWS SDK for Ruby, and I started by running the sample programs on S3. But the S3 example gives me this error:
/var/lib/gems/1.9.1/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:318:in 'return_or_raise':AWS::Core::Client::NetworkError (AWS::Core::Client::NetworkError)
from /var/lib/gems/1.9.1/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:in 'client_request'
from (eval):3:in 'put_object'
from /var/lib/gems/1.9.1/gems/aws-sdk-1.8.0/lib/aws/s3/s3_object.rb:1655:in 'write_with_put_object'
from /var/lib/gems/1.9.1/gems/aws-sdk-1.8.0/lib/aws/s3/s3_object.rb:600:in 'write'
from s3/upload_file.rb:31:in 'main'
I have already checked using s3cmd and it is working fine.
I am using Ruby 1.9.1 and AWS SDK version is 1.8.0.

Related

Intermittent "Context Canceled" error on Terraform Plan

I'm running a terraform plan through AWS Codebuild. terraform init works consistently but terraform plan intermittently throws this error:
Error: rpc error: code = Canceled desc = context canceled
terraform version: 0.12.31
aws provider version: ~> 3.55.0
The intention here was to change Python lambda runtimes from 3.6 to 3.9. In this regard, I upgraded terraform from 0.12.21 to 0.12.31 and aws provider version from ~>2 to ~> 3.55.0 (aws provider version 3.55.0 is the first version that supports python 3.9 runtime)
I've seen that others have had similar issues and what seemed to have worked for them is trying a different version of the provider. I wanted to keep these versions of terraform and aws provider because if I upgrade it further here, it would have consequences elsewhere in our pipeline. Does anyone have any ideas on how I can move forward?
I've finally solved it. I increased the Compute resources allocated to Codebuild by following this page: https://docs.aws.amazon.com/codebuild/latest/userguide/change-project-cli.html
All my builds are running through successfully now. So it looks like it was just the resource constraint all along.

Unable to install PowerShell module on AWS EC2 Windows 2019 Server

I am experiencing a problem installing the PowerShell module on the Windows 2019 server. The server is a cloud server hosted on an AWS Ec2 instance. I have followed all the online resources to debug the issue, and I have enabled the tls12 on the server. But still, I am facing a problem with installing any of the modules.
Getting the PackageManagement error as well as the source warning.
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/PackageManagement/1.4.7' is not valid.
PackageManagement\Install-Package : Package 'PackageManagement' failed to download. Here is the screenshot of the error from PowerShell session

ibmmq with nodejs- Unable to make it work with aws lambda

I am trying to read data from IBM MQ using ibmmq node module. The lambda function works fine with serverless-offline plugin with the below changes in my local environment.
Downgrading python version to 2.x
Installing windows build tools, node-gyp, Windows8.0 SDK, visual studio 2015
But the same lambda when deployed in AWS throws the below error
module initialization error: Error
at Error (native)
at bindings (/var/task/node_modules/ibmmq/node_modules/bindings/bindings.js:76:44)
at Object. (/var/task/node_modules/ibmmq/node_modules/ref/lib/ref.js:5:47)
at Module._compile (module.js:570:32)
I have added windows-build-tools to my dependencies. Any ideas on how to make this work

How to Use DBInstanceID from the ROS to query the database urls by Aliyun CLI

I am trying to work with Alibaba Cloud from Command line by use Aliyun CLI & Aliyun ROS CLI.
When creating a stack by ROS template, I got the outputs are DBInstanceStatus and DBInstanceID.
So How to Use DBInstanceID from the ROS to query the database URLs by Aliyun CLI?
One more question Can we do a backup restore the database with Aliyun CLI commands or not? If yes, how to do it?
Thanks,
You can not query the MongoDB connection information by using ROS CLI. You should use MongoDB API:
DescribeReplicaSetRole or DescribeShardingNetworkAddress
The related python sdk is aliyun-python-sdk-dds
pip install aliyun-python-sdk-dds
https://github.com/aliyun/aliyun-openapi-python-sdk/tree/master/aliyun-python-sdk-dds

Installing Mahout on Amazon EC2 instance - get_reference_source command not found

As my school project, I've created a AWS EC2 instance and trying to install different "Dev Tools" and software as per AWS doc [http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/compile-software.html.
][1]
I'm trying to get mahout tarball using get_reference_source -p mahout while connecting to AWS instance via putty.
But this command gives error "get_reference_source " command not found. I'm searching for it since morning and found nothing.

Resources