ohad
Intern
Intern
  • UID5896
  • Fans0
  • Follows0
  • Posts1
Reads:41219Replies:1

Launch linux instance with user data

Created#
More Posted time:Jul 5, 2018 21:58 PM
Hi
I'm trying to lauch linux instance with user data script using the java SDK
But i'm getting this error: Forbidden.RiskControl, This operation is forbidden by Aliyun RiskControl system
Any idea?

This is my code:

CommonRequest commonRequest = new CommonRequest();
commonRequest.setDomain("ecs.aliyuncs.com");
commonRequest.setMethod(MethodType.POST);
commonRequest.setVersion("2014-05-26");
commonRequest.setAction("RunInstances");
commonRequest.setRegionId("us-west-1");
commonRequest.putBodyParameter("ImageId", "centos_6_09_64_20G_alibase_20180326.vhd");
commonRequest.putBodyParameter("InstanceType", "ecs.sn1.medium");
commonRequest.putBodyParameter("SecurityGroupId", "sg-1234");
commonRequest.putBodyParameter("VSwitchId", "vsw-1234");
commonRequest.putBodyParameter("KeyPairName", "key-pair");
commonRequest.putBodyParameter("InternetMaxBandwidthOut", 1);
commonRequest.putBodyParameter("UserData", "IyEvYmluL2Jhc2gNCg0KZWNobyAiaGVsbG8iID4gL3RtcC9maWxlMS50eHQNCmVjaG8gImhlbGxvIiA+IGZpbGUxLnR4dA==");

CommonResponse commonResponse = client2.getCommonResponse(commonRequest);
Guest