我有一个命令行应用程序,用于将某些文件上传到AWS。我使用了认证示例
var options = new CredentialProfileOptions
{
AccessKey = "bleh",
SecretKey = "bleh"
};
var profile = new CredentialProfile("basic_profile", options);
profile.Region = RegionEndpoint.USEast2;
var netSDKFile = new NetSDKCredentialsFile();
netSDKFile.RegisterProfile(profile);
var manager = new ArchiveTransferManager(Amazon.RegionEndpoint.USEast2);
是时候上传了
archiveToUpload = System.IO.Path.Combine(record.FolderName, record.FileName);
string archiveId = manager.UploadAsync(vaultName, "upload archivetest",archiveToUpload).Result.ArchiveId;
我收到“无法从EC2实例元数据服务获取IAM安全凭证”异常。这正在我的开发桌面上运行。 IAM用户还可以完全访问S3和冰川进行测试。我的开发环境是否缺少某些配置?我还安装了适用于VS2019的AWS开发工具包,并验证basic_profile可以探索S3。
谢谢!
答案 0 :(得分:0)