我正在尝试在停止实例后第二次添加用户数据,并在重新启动时我想再次传递一些用户数据,为此我正在使用
public InstanceStatusResponse startEc2Instance(AmazonEC2 ec2Client, String instanceId) {
BlockDeviceMapping blockDeviceMappings = new BlockDeviceMapping();
blockDeviceMappings.setDeviceName(storageProperties.getDeviceName());
System.out.println("vatsal");
ModifyInstanceAttributeRequest modifyInstanceAttributeRequest = new ModifyInstanceAttributeRequest()
.withUserData(userdata())
ModifyInstanceAttributeRequest request = new ModifyInstanceAttributeRequest();
request.setUserData(userdata());
System.out.println(modifyInstanceAttributeRequest.withUserData(userdata()));
System.out.println(modifyInstanceAttributeRequest.getUserData());
StartInstancesRequest startInstancesRequest = new StartInstancesRequest().withInstanceIds(instanceId);
ec2Client.startInstances(startInstancesRequest);
//System.out.println();
System.out.println("Starting the ec2 instance");
return instanceStatusResponse(ec2Client, instanceId);
}
我正在传递一些用户数据,我也根据需求使用 base64 编码,但我无法将值发送到那台 ec2 机器。
萧十郎
Helenr
相关分类